adis16470: fix accel and gyro scaling

This commit is contained in:
Daniel Agar 2022-08-15 09:02:24 -04:00
parent baab4501f6
commit 8a54b21e7d
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
1 changed files with 5 additions and 5 deletions

View File

@ -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;
}