From 49d87f190742272e8d52f1459ef337b04750a397 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 15 Aug 2022 09:02:24 -0400 Subject: [PATCH] adis16470: fix accel and gyro scaling --- src/drivers/imu/analog_devices/adis16470/ADIS16470.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/drivers/imu/analog_devices/adis16470/ADIS16470.cpp b/src/drivers/imu/analog_devices/adis16470/ADIS16470.cpp index f978513b80..a26b66d9f2 100644 --- a/src/drivers/imu/analog_devices/adis16470/ADIS16470.cpp +++ b/src/drivers/imu/analog_devices/adis16470/ADIS16470.cpp @@ -375,13 +375,13 @@ bool ADIS16470::Configure() } } - _px4_accel.set_scale(CONSTANTS_ONE_G / 2048.f); + // accel: ±40 g, 800 LSB/g (16-bit format) _px4_accel.set_range(40.f * CONSTANTS_ONE_G); - _px4_gyro.set_scale(math::radians(1.f / 0.1f)); // 1 LSB = 0.1°/sec - _px4_gyro.set_range(math::radians(2000.f)); + _px4_accel.set_scale(CONSTANTS_ONE_G / 800.f); // scaling 800 LSB/g -> m/s^2 per LSB - _px4_accel.set_scale(1.25f * CONSTANTS_ONE_G / 1000.0f); // accel 1.25 mg/LSB - _px4_gyro.set_scale(math::radians(0.025f)); // gyro 0.025 °/sec/LSB + // gyro: ±2000, 10 LSB/°/sec (16-bit format) + _px4_gyro.set_range(math::radians(2000.f)); + _px4_gyro.set_scale(math::radians(1.f / 10.f)); // scaling 10 LSB/°/sec -> rad/s per LSB return success; }