stereolabs / zed-sdk

⚡️The spatial perception framework for rapidly building smart robots and spaces
https://stereolabs.com
MIT License
795 stars 463 forks source link

Is an IMU orientation calculated from gyroscope and accelerometer only? #404

Closed yyc9268 closed 3 years ago

yyc9268 commented 3 years ago

Hi, I feel curious about how the IMU orientation is caculated. I refered this code. In the code, 'sensors_data.get_imu_data().get_pose().get_orientation().get()' function returns quaternion orientation. Since its an child function of 'get_imu_data()' I guess its been filtered fusing only IMU sensor data (gyroscope and accelerometer). In my best knowledge, accelerometer cannot prevent drifts of Yaw of gyroscope data. The orientation seems very accurate than I have expected. Could any staff in Stereolabs give me the official comments about this? I wonder whether its been calculated from only IMU or been aided by additional sensors like magnetometer or barometer.

Thanks,

obraun-sl commented 3 years ago

Hi, Orientation of sensors_data is calculated by using gyroscope and accelerometer only. Currently magnetometer is not used in the imu fusion. Accelerometer is used to compensate drifts for pitch and roll. For yaw, only integration of the gyroscope can be used. Note that we also have internally a factory calibration of the IMU (that will adjust bias of gyro and accelero) + a runtime calibration of the bias of the gyroscope. This means that when the camera is static, the bias of the gyroscope will be adjusted to compensate drift along yaw axis.

yyc9268 commented 3 years ago

@obraun-sl Thank you very much. It is awesome that the pose from IMU only fusion is accurate enough.