-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathminimu9.h
56 lines (44 loc) · 1.37 KB
/
minimu9.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
// TODO: I'd rather have the minimu9 and imu class not know anything about
// floating point vectors and calibration. Maybe just provide floating
// point scaling factors so that higher-level code can make sense of the
// raw vectors.
#include "imu.h"
#include "lsm303.h"
#include "l3g.h"
#include "lsm6.h"
#include "lis3mdl.h"
#include "sensor_set.h"
namespace minimu9
{
// Represents the sensors of the MinIMU-9 and how to communicate with them.
struct comm_config {
lsm303::comm_config lsm303;
l3g::comm_config l3g;
lis3mdl::comm_config lis3mdl;
lsm6::comm_config lsm6;
};
comm_config auto_detect(const std::string & i2c_bus_name);
sensor_set config_sensor_set(const comm_config &);
comm_config disable_redundant_sensors(const comm_config &, const sensor_set &);
class handle : public imu {
public:
void open(const comm_config &);
comm_config config;
lsm6::handle lsm6;
lis3mdl::handle lis3mdl;
lsm303::handle lsm303;
l3g::handle l3g;
virtual void read_acc_raw();
virtual void read_mag_raw();
virtual void read_gyro_raw();
virtual float get_acc_scale() const;
virtual float get_gyro_scale() const;
virtual vector read_acc();
virtual vector read_mag();
virtual vector read_gyro();
virtual void enable();
virtual void load_calibration();
virtual void measure_offsets();
};
}