|
|
|
@ -277,32 +277,32 @@ void ICM40609D::ConfigureGyro()
@@ -277,32 +277,32 @@ void ICM40609D::ConfigureGyro()
|
|
|
|
|
{ |
|
|
|
|
const uint8_t GYRO_FS_SEL = RegisterRead(Register::BANK_0::GYRO_CONFIG0) & (Bit7 | Bit6 | Bit5); // 7:5 GYRO_FS_SEL
|
|
|
|
|
|
|
|
|
|
float range_dps = 0.f; |
|
|
|
|
|
|
|
|
|
switch (GYRO_FS_SEL) { |
|
|
|
|
case GYRO_FS_SEL_125_DPS: |
|
|
|
|
_px4_gyro.set_scale(math::radians(1.f / 262.f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(125.f)); |
|
|
|
|
range_dps = 125.f; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case GYRO_FS_SEL_250_DPS: |
|
|
|
|
_px4_gyro.set_scale(math::radians(1.f / 131.f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(250.f)); |
|
|
|
|
range_dps = 250.f; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case GYRO_FS_SEL_500_DPS: |
|
|
|
|
_px4_gyro.set_scale(math::radians(1.f / 65.5f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(500.f)); |
|
|
|
|
range_dps = 500.f; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case GYRO_FS_SEL_1000_DPS: |
|
|
|
|
_px4_gyro.set_scale(math::radians(1.f / 32.8f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(1000.f)); |
|
|
|
|
range_dps = 1000.f; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case GYRO_FS_SEL_2000_DPS: |
|
|
|
|
_px4_gyro.set_scale(math::radians(1.f / 16.4f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(2000.f)); |
|
|
|
|
range_dps = 2000.f; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_px4_gyro.set_scale(math::radians(range_dps / 32768.f)); |
|
|
|
|
_px4_gyro.set_range(math::radians(range_dps)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ICM40609D::ConfigureSampleRate(int sample_rate) |
|
|
|
|