Skip to content

Commit

Permalink
fix: IMU values were off by a factor of 1000.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clemens committed Mar 21, 2023
1 parent 83ba99d commit 07e0a6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Firmware/LowLevel/src/imu/LSM6DSO/imu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ bool imu_read(float *acceleration_mss, float *gyro_rads, float *mag_uT)
success &= IMU.Get_X_Axes(accelerometer) == 0;
success &= IMU.Get_G_Axes(gyroscope) == 0;

acceleration_mss[0] = accelerometer[0] * 9.81;
acceleration_mss[1] = accelerometer[1] * 9.81;
acceleration_mss[2] = accelerometer[2] * 9.81;
acceleration_mss[0] = accelerometer[0] * 9.81 / 1000.0;
acceleration_mss[1] = accelerometer[1] * 9.81 / 1000.0;
acceleration_mss[2] = accelerometer[2] * 9.81 / 1000.0;

gyro_rads[0] = gyroscope[0] * (PI/180.0);
gyro_rads[1] = gyroscope[1] * (PI/180.0);
gyro_rads[2] = -gyroscope[2] * (PI/180.0);
gyro_rads[0] = gyroscope[0] * (PI/180.0) / 1000.0;
gyro_rads[1] = gyroscope[1] * (PI/180.0) / 1000.0;
gyro_rads[2] = -gyroscope[2] * (PI/180.0) / 1000.0;

mag_uT[0] = 0;
mag_uT[1] = 0;
Expand Down

0 comments on commit 07e0a6c

Please sign in to comment.