Skip to content

Commit 6af68d5

Browse files
CasperClarkelaurensvalk
authored andcommitted
pybricks.common.IMU: Fix gyro read values.
This was accidentally changed recently in af76eec
1 parent 50c185d commit 6af68d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/pbio/drv/imu/imu_lsm6ds3tr_c_stm32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ void pbdrv_imu_gyro_read(pbdrv_imu_dev_t *imu_dev, float *values) {
292292
// Output is signed such that we have a right handed coordinate system
293293
// consistent with the coordinate system above. Positive rotations along
294294
// those axes then follow the right hand rule.
295-
values[0] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_X * imu_dev->data[0] * imu_dev->accel_scale;
296-
values[1] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_Y * imu_dev->data[1] * imu_dev->accel_scale;
297-
values[2] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_Z * imu_dev->data[2] * imu_dev->accel_scale;
295+
values[0] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_X * imu_dev->data[3] * imu_dev->gyro_scale;
296+
values[1] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_Y * imu_dev->data[4] * imu_dev->gyro_scale;
297+
values[2] = PBDRV_CONFIG_IMU_LSM6S3TR_C_STM32_SIGN_Z * imu_dev->data[5] * imu_dev->gyro_scale;
298298
}
299299

300300
float pbdrv_imu_temperature_read(pbdrv_imu_dev_t *imu_dev) {

0 commit comments

Comments
 (0)