bolderflight / invensense-imu

Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MIT License
497 stars 210 forks source link

X and Y axis accelerometer readings are swapped. #121

Closed sayantanvlabs closed 1 year ago

sayantanvlabs commented 1 year ago

Hi I am getting swapped readings for x and y axis, also the z axis is also inverted. I have described the issue here: https://electronics.stackexchange.com/questions/680084/how-to-determine-orientation-for-mpu9250-accelerometer Is this behaviour expected?

flybrianfly commented 1 year ago

Yes, please refer to the documentation on the README for the orientation of the outputs from this library.

By default, the MPU-9250 gyro and accel values are in a different orientation than the magnetometer values (refer to page 38 of the MPU-9250 datasheet). This library rotates the outputs so they all have the same orientation and to match a common orientation for aeronautical systems (+X out the nose, +Y out the right wing, +Z down).