MRMS
mrm-imu.h
1 #pragma once
2 #include <Wire.h>
3 #include "bno055.h"// bno055.h and bno055.cpp files must be in Arduino libraries.
4 #ifdef ESP_PLATFORM
5 #include <mrm-board.h>
6 #else
7 #include <Arduino.h>
8 #endif
9 
17 #define MAX_MRM_IMU 1 //Maximum number of IMUs.
18 
19 typedef bool(*BreakCondition)();
20 
21 class Mrm_imu
22 {
23  bool defaultI2CAddresses[MAX_MRM_IMU]; //If true, it will use default I2C address (0x29) otherwise 0x28.
24  struct bno055_t bno055; // Structure declaration.
25  int nextFree;
26 #ifdef ESP_PLATFORM
27  Robot* robotContainer;
28 #endif
29 
30  void bno055Initialize(bool defaultI2CAddress = true); //IMU initialization of the sensor. It should be called once, after Wire.begin().
31 
32  s32 bno055_data_readout_template(void); //A function You do not use.
33 
34  void errorGeneric() { Serial.println("Error."); }
35 
36  void testHelper();
37 
38 public:
42 #ifdef ESP_PLATFORM
43  Mrm_imu(Robot* robot = NULL);
44 #else
45  Mrm_imu();
46 #endif
47 
48  ~Mrm_imu();
49 
53  uint8_t accelerationCalibration();
54 
58  void add(bool defautI2CAddress = true);
59 
63  uint8_t gyroCalibration();
64 
68  float heading();
69 
73  uint8_t magneticCalibration();
74 
78  float pitch();
79 
83  float roll();
84 
88  uint8_t systemCalibration();
89 
92  void test();
93 };
94 
95 //Declaration of error function. Definition is in Your code.
96 extern void error(char* message);
BNO055 Sensor Driver Support Header File.
signed int s32
Definition: bno055.h:188
Definition: mrm-imu.h:22
float pitch()
Definition: mrm-imu.cpp:53
uint8_t accelerationCalibration()
Definition: mrm-imu.cpp:73
Mrm_imu()
Definition: mrm-imu.cpp:13
float heading()
Definition: mrm-imu.cpp:44
uint8_t magneticCalibration()
Definition: mrm-imu.cpp:115
uint8_t gyroCalibration()
Definition: mrm-imu.cpp:94
float roll()
Definition: mrm-imu.cpp:64
void add(bool defautI2CAddress=true)
Definition: mrm-imu.cpp:23
void test()
Definition: mrm-imu.cpp:156
uint8_t systemCalibration()
Definition: mrm-imu.cpp:136
Definition: mrm-robot.h:42
bno055 struct
Definition: bno055.h:517