Skip to content

Commit

Permalink
fix: fixed units for IMU
Browse files Browse the repository at this point in the history
  • Loading branch information
clemens committed Mar 19, 2023
1 parent ff77e80 commit 1aa4ecb
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];
acceleration_mss[1] = accelerometer[1];
acceleration_mss[2] = accelerometer[2];
acceleration_mss[0] = accelerometer[0] * 9.81;
acceleration_mss[1] = accelerometer[1] * 9.81;
acceleration_mss[2] = accelerometer[2] * 9.81;

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

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

0 comments on commit 1aa4ecb

Please sign in to comment.