Extended and refactored library for BNO055, an intelligent 9-axis absolute orientation sensor by Bosch Sensortec. It includes ACC, MAG and GYRO sensors and Cortex-M0 processor.

Fork of BNO055_fusion by Kenji Arai

Please note: pitch and roll in get_euler_angles are switched, the code should be like this:

h = dt[1] << 8 | dt[0]; r = dt[3] << 8 | dt[2]; p = dt[5] << 8 | dt[4];

See https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf

Revision:
9:e7c8d34bf79a
Parent:
8:46134e7474e7
Child:
10:63a9849f0e97
--- a/BNO055.cpp	Sun Jan 28 19:38:51 2018 +0000
+++ b/BNO055.cpp	Sun Jan 28 19:46:06 2018 +0000
@@ -303,7 +303,7 @@
     page_flag = 0xff;
     select_page(0);
     // Check Acc & Mag & Gyro are available of not
-    check_id();
+    get_id();
     // Set initial data
     set_initial_dt_to_regs();
     // Unit selection
@@ -352,7 +352,7 @@
     _i2c.stop();
     page_flag = 0xff;
     select_page(0);
-    check_id();
+    get_id();
     if (chip_id != I_AM_BNO055_CHIP){
         return 1;
     } else {
@@ -369,7 +369,7 @@
 }
 
 /////////////// Check Who am I? ///////////////////////////
-void BNO055::check_id(void)
+void BNO055::get_id(void)
 {
     select_page(0);
     // ID
@@ -433,7 +433,7 @@
     uint8_t current_mode;
 
     select_page(0);
-    current_mode = check_operating_mode();
+    current_mode = get_operating_mode();
     switch (mode) {
         case CONFIGMODE:
             dt[0] = BNO055_OPR_MODE;
@@ -462,7 +462,7 @@
     }
 }
 
-uint8_t BNO055::check_operating_mode(void)
+uint8_t BNO055::get_operating_mode(void)
 {
     select_page(0);
     dt[0] = BNO055_OPR_MODE;
@@ -478,7 +478,7 @@
     uint8_t remap_sign;
     uint8_t current_mode;
 
-    current_mode = check_operating_mode();
+    current_mode = get_operating_mode();
     change_fusion_mode(CONFIGMODE);
     switch (position) {
         case MT_P0:
@@ -543,7 +543,7 @@
     uint8_t current_mode;
     uint8_t d;
 
-    current_mode = check_operating_mode();
+    current_mode = get_operating_mode();
     change_fusion_mode(CONFIGMODE);
     dt[0] = addr;
     dt[1] = data;
@@ -567,7 +567,7 @@
     uint8_t current_mode;
     uint8_t d;
 
-    current_mode = check_operating_mode();
+    current_mode = get_operating_mode();
     change_fusion_mode(CONFIGMODE);
     select_page(1);
     dt[0] = addr;