fix: IMU axis mapping for CW270 orientation (#15) #20
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-firmware/fix-axis-orientation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The MAMBA F722S mounts the MPU6000 at CW270 (clockwise 270°). This applies rotation matrix
R = [[0,1,0],[-1,0,0],[0,0,1]](Betaflight convention) to transform sensor axes to board axes.Firmware (
mpu6000.c)accel_pitchatan2(ax, az)atan2(ay, az)accel_rollatan2(ay, az)atan2(-ax, az)gyro_pitch_rate+raw.gx-raw.gxgyro_roll_rateraw.gyraw.gygyro_yaw_rateraw.gzraw.gzUI (
index.html) rotation sign fixes+rotation.x: correct — Three.js+xtilts nose up ✓-rotation.z: Three.js+z= CCW from camera = left bank; right-bank-positive convention requires negation-rotation.y: Three.js+y= CCW from above; sensor_Z points down on MAMBA (az ≈ +1gwhen level), sogz+= CW physical rotation; negate so model spins correctlyTest plan
Closes #15.
Flash-tested, all axes streaming correctly.