Hi.I'm a new user to OAK-D-PRO-W with BMI270 IMU Onboard.When I rotating the camera, it seems that the IMU is using a left handed coordinate system(By axis orientation and angular_velocity follows Left-hand rule).But the datasheet of BMI270 shows that the sensor is using a right handed coordinate system.So I wonder what might cause this issue.
About OAK-D-PRO-W IMU Coordinate System
Hey, I can confirm your observation. This is become a problem for me during calibration using Kalibr. Have you found the reason for the change in coordinate systems between the datasheet and readings? Looking forward to an update from anyone.
- Edited
Hi Tony_neol @RangerOnMars ,
We apologize for the issue. By default, DepthAI uses left-handed coordinate system for the IMU (even though the BMI/BNO IMUs use right-handed one). We will specify this in the docs asap.
Thanks, Erik
Edit: I'm not actually sure, checking with the team..
@Tony_neol / @RangerOnMars disregard the comment above. This was confirmed by the development team;
As IMU is mounted at the back of the PCB. So compared to optical frame coord system, you get IMU coord system by applying the following rotation:
--roll', '3.14159', '--pitch', '0', '--yaw', '1.5708'
I hope this is correct, but I'm still not 100% sure.
Thanks, Erik
- Edited
erik I have used the imu_gyroscope_accelerometer.py to measure the ACCELEROMETER_RAW data from the OAK-D, and observed a left handed orientation as follows:
Accelerometer [m/s^2]: x: -8.762778 y: -0.622492 z: -0.852336
With Device placed in up right position. X axis is -1G. Which means X is facing down in our perspective.
Accelerometer [m/s^2]: x: 2.643199 y: 0.095768 z: -9.873688
lying on the back of the device with camera facing upwards. Z is facing back in other perspective.
from the looks of your diagram. I think your inference is inverse of what I am infering here.
I will cross-check on which is the correct convention and get back to you.
I found it confusing when transforming the coordinate system of IMU, using the imu.py script in depthai.
When running the 'Luxonis/depthai: IMUComponent/imu.py' the visualizer graph miss labels the Y and Z axis's acceleration by swapping their colors. When the axis are excited according to the datasheet orientation, the bug can be seen clearly. However the gyroscope values are consistent with the datasheet. Therefore the colors should be miss matched with the legend.
I also tested the raw data output with the 'Luxonis/depthai-python: imu_gyroscope_accelerometer.py' script and the readings were correct according to the datasheet.
I have labeled the coordinate systems from both programs, along with the imu.py graph with positive rotation of the camera along the Y axis, but acceleration shows in green(Z axis).
I'm also curious as to why a left handed coordinate frame is used? Use of a right handed system is the convention.
@Tony_neol did you find a solution for converting to a right hand frame for use in Kalibr?
@Tony_neol sorry for the issue. the one in depthai-python is correct. the other one is wrong. Will be fixed in the next release of SDK.
Here is an image of the readings with each axis facing up. This aligns with X-axis facing down, Y-axis facing towards the right camera and Z-axis facing backwards for the IMU axises. That also satisfies the IMU being on right hand coordinate system.