05-05-2021 10:06 AM - edited 05-05-2021 11:10 AM
Hello community,
i would like to remap my axis for the given position of my sensor. Now i looked through the datasheet, where it tells my the remap sign and stuff. But i am not sure what kind of code i need to make this happen in the Arduino IDE.
https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bno055-ds000.pdf (page 27)
I know i need to be in the CONFIG mode to remap the axis, this i can achieve by:
bno055_set_operation_mode(OPERATION_MODE_CONFIG);
Now i am just missing the command for the axis remapping.
If you know how to do this please let me know 🙂
Have a good day
xeonus
Solved! Go to Solution.
05-11-2021 06:20 PM
Hi,
After you do,
bno055_set_operation_mode(OPERATION_MODE_CONFIG);
0x24; // this value is written to register 0x41
0x05; // this value is written to register 0x42
then you can read back register 0x41 and 0x42 to verify if the above two values have been successfully written to the registers or not. If yes, then BNO055 will be at P7 orientation. Its z axis is up side down. At this moment if you read accelerometer data from BNO055 which are data registers from 0x08 to 0x0D, you will find out that when BNO055 z axis is pointing to sky, BNO055 accelerometer z axis data will be -1g or -9.8m/s^2. This means that the axis remapping takes effect, because the default orientation is P1 with values of 0x24, 0x00 for register 0x41 and 0x42 respectively and when z axis is pointing to sky z axis data should be +1g or +9.8m/s^2.
Thanks.
05-13-2021 10:13 AM - edited 05-13-2021 10:20 AM
Thanks again for your help!
Oh okay so it actually works that way.
I tried to read back the registers by:
Serial.println(0x41);
Serial.println(0x42);
for (0x41): it says: 65
for (0x42): 66.
not sure if I did something wrong, or I can't interpret it.
But by checking the z axis, i know the axis manipulation did not work. And additionally I am also bit confused why the gravitational force (1g) is positive, when the z axis is by default looking into the sky, but gravity get is stuck to the earth and not to the sky. I hope it is understandable what i mean. In my head 9,8 m/s should be - 9,8 m/s if z is looking upwards.
A explenation would be for me, if it is already pre manipulated for P1 to have positive numbers..
Have a good day!
05-13-2021 05:52 PM
Hi,
By default we use ENU (east-north-up) coordinate system for MEMS sensors. So when z axis is pointing to sky we define +1g for the accelerometer. If you use NED (north-east-down) coordinate system like aircraft, then z axis is +1g when it is pointing to ground. You can do your own axes remapping on any MEMS sensor. But BNO055 provides you with this feature built-in.
Thanks.
05-17-2021 11:40 PM - edited 05-17-2021 11:48 PM
Hi xeonus,
I just registered to this forum to help you out, haha 😋
Considering that you´re surprised that the result of Serial.println(0x41); is 65, shows me that you´re a newbie as I am 😄
0x41 is a hexadecimal number value, which converted to a decimal value is 65. For better understanding: Click here for hexadecimal table
Serial.printIn is also no command to read any registers from BNO0555 sensor. In easy words this command says "Send the thing, which is in the brackets, via serial port to your serial monitor console." So by writing Serial.println(0x41);, you´re basically saying Serial.println(65);, which means: "Display the value 65 in the serial monitor"
I assume that you´re using some type of Arduino board and a BNO055 Breakout Board?
If yes, then just download and copy this library to your Arduino-libraries-folder:
https://github.com/arduino-libraries/BNO055
Then open up in Arduino IDE the "Basic.ino" example and replace the void setup with this:
void setup() //This code is executed once
{
//Initialize I2C communication
Wire.begin();//Initialization of the BNO055
BNO_Init(&myBNO); //Assigning the structure to hold information about the device//Configuration to Config mode
bno055_set_operation_mode(OPERATION_MODE_CONFIG);delay(1);
bno055_set_axis_remap_value(REMAP_X_Y);
delay(1);
bno055_set_x_remap_sign(0x01);
delay(1);
bno055_set_y_remap_sign(0x01);
delay(1);
bno055_set_z_remap_sign(0x01);
}
In the file BNO055.h in line 521 you can see that REMAP_X_Y stands for 0X21.
In the file BNO055.c you can look up how the talented boys and girls from Bosch wrote the functions bno055_set_operation_mode, bno055_set_axis_remap_value, bno055_set_x_remap_sign, ... .
I´m not 100% sure, if my suggested commands for the remap_sign are correct, but reading the BNO055.c, I think it could work. 😄
I guess the moderator didn´t answered all of your questions, because you´re asking for really basic stuff ^^
Hopefully I could help you in some way and it´ll work... 😛
Best regards
06-08-2021 01:49 AM
Hi
I'm trying to do the same thing with my very limited programming experience. I want to reorient the BNO055 in the vertical position for an application I'm working on. Can anyone comment on this below and make a suggestions, please and thank you. Im trying to swap the Z axis for the Y axis
void setup() {
Wire.begin();
BNO_Init(&myBNO);
bno055_set_operation_mode(OPERATION_MODE_CONFIG);
delay(1);
bno055_set_axis_remap_value(REMAP_Y_Z);
delay(1);
bno055_set_x_remap_sign(0x01);
delay(1);
bno055_set_y_remap_sign(0x01);
delay(1);
bno055_set_z_remap_sign(0x01);
}