What is the coordinate system convention in which the IMU values are reported?
I am reading the raw IMU values using the MSP_RAW_IMU message from a GY-86 breakout board (#define GY_86). The sensor coordinate system is rotated by:
Code: Select all
#define ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = -X; imu.accADC[PITCH] = -Y; imu.accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = Y; imu.gyroADC[PITCH] = -X; imu.gyroADC[YAW] = -Z;}
#define MAG_ORIENTATION(X, Y, Z) {imu.magADC[ROLL] = X; imu.magADC[PITCH] = Y; imu.magADC[YAW] = -Z;}
If I assume the sensor coordinate system follows the "East-North-Up" convention, that is x pointing forward, y left, z up, this seems to transform the values into the "North-East-Down" coordinate system (https://en.wikipedia.org/wiki/Axes_conventions#Conventions_for_aircraft_local_reference_frames).
RPY angles of airplanes and other air vehicles:
If I mount the sensor such that its coordinate system matches with the body frame of the aircraft (x forward, x right, z down), the IMU values would be reported in the world frame (y forward, x left, z down). E.g. when rotating the GY-86 around its x axis, the gyro y value changes.
This this case, the reported roll and pitch (MSP_ATTITUDE) are still switched.
How do I need to mount the coordinate system of my sensor such that I get the correct IMU and orientation of the aircraft?
Thanks.