-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix euler angles representation for strain2 #286
Conversation
We used to leave the axis as it is (P1) but the imu on strain2 is mounted in the configuration P6 of datasheet. This allows us to configure the imu correctly at startup and do not do any conversion when gathering the data
Unfortunately, this analysis had some flaws and it didn't solve the problem. Looking at the bno055 datasheet I found out that it is possible to request to bno055 a different axis mapping, we can define it at the startup of the sensor, and then the data that will publish will respect that reference system. We have to define the mapping as follows: We have
Then with this piece of code: #if defined(STM32HAL_BOARD_STRAIN2)
// In strain2 we have the P6 configuration reported in the bno055 datasheet
embot::hw::bno055::write(pImpl->config.sensor, embot::hw::bno055::Register::AXIS_MAP_CONFIG, 0x21, 5*embot::core::time1millisec);
embot::hw::bno055::write(pImpl->config.sensor, embot::hw::bno055::Register::AXIS_MAP_SIGN, 0x07, 5*embot::core::time1millisec);
#endif On strain2 we have the p6 configuration This change allowed us to remove all the conversions around the code, the only conversion that remains is the one regarding the Euler angle that was addressed in robotology/icub-main#701 | #154 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
compiled on 2022 july 29 w/ - icub-firmware-shared SHA-1: e9d8baf4a9af7bb623a0e5632fb6d5c559254b0c - icub-firmware SHA-1: 2aa2ecb differences w/ previous versions: - strain2: it fixes the euler angle representation. See robotology/icub-firmware#286 - mtb4 and rfe: no new features. just recompilation since the original code has changed.
This PR fixes the Euler angles representation on strain2.
This conversion keep count of this math:
That results in this conversion;
To be tested on the hardware