mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 01:33:33 +08:00
IMU: parameterize IMU integration time (IMU_INTEG_RATE)
- default integration rate now 200 Hz (5000 us interval) - set update rate for all drivers and simulators using PX4Accelerometer/PX4Gyroscope
This commit is contained in:
@@ -115,6 +115,9 @@ bool ADIS16448::reset()
|
||||
return false;
|
||||
}
|
||||
|
||||
_px4_accel.set_update_rate(_sample_rate);
|
||||
_px4_gyro.set_update_rate(_sample_rate);
|
||||
|
||||
// Set gyroscope scale to default value.
|
||||
//if (!set_gyro_dyn_range(GYRO_INITIAL_SENSITIVITY)) {
|
||||
// return false;
|
||||
|
||||
@@ -69,8 +69,10 @@ ADIS16477::ADIS16477(I2CSPIBusOption bus_option, int bus, int32_t device, enum R
|
||||
#endif // GPIO_SPI1_RESET_ADIS16477
|
||||
|
||||
_px4_accel.set_scale(1.25f * CONSTANTS_ONE_G / 1000.0f); // accel 1.25 mg/LSB
|
||||
_px4_accel.set_update_rate(ADIS16477_DEFAULT_RATE);
|
||||
|
||||
_px4_gyro.set_scale(math::radians(0.025f)); // gyro 0.025 °/sec/LSB
|
||||
_px4_gyro.set_update_rate(ADIS16477_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
ADIS16477::~ADIS16477()
|
||||
|
||||
@@ -84,6 +84,9 @@ ADIS16497::ADIS16497(I2CSPIBusOption bus_option, int bus, int32_t device, enum R
|
||||
// Configure hardware reset line
|
||||
px4_arch_configgpio(GPIO_SPI1_RESET_ADIS16497);
|
||||
#endif // GPIO_SPI1_RESET_ADIS16497
|
||||
|
||||
_px4_accel.set_update_rate(ADIS16497_DEFAULT_RATE);
|
||||
_px4_gyro.set_update_rate(ADIS16497_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
ADIS16497::~ADIS16497()
|
||||
|
||||
@@ -182,6 +182,7 @@ BMA180::BMA180(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotatio
|
||||
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read"))
|
||||
{
|
||||
_px4_accel.set_update_rate(1000);
|
||||
}
|
||||
|
||||
BMA180::~BMA180()
|
||||
|
||||
@@ -54,6 +54,7 @@ BMI055_accel::BMI055_accel(I2CSPIBusOption bus_option, int bus, const char *path
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi055_accel_duplicates")),
|
||||
_got_duplicate(false)
|
||||
{
|
||||
_px4_accel.set_update_rate(BMI055_ACCEL_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI055_accel::~BMI055_accel()
|
||||
|
||||
@@ -57,6 +57,7 @@ BMI055_gyro::BMI055_gyro(I2CSPIBusOption bus_option, int bus, const char *path_g
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_transfers")),
|
||||
_bad_registers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_registers"))
|
||||
{
|
||||
_px4_gyro.set_update_rate(BMI055_GYRO_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI055_gyro::~BMI055_gyro()
|
||||
|
||||
@@ -63,6 +63,7 @@ BMI088_accel::BMI088_accel(I2CSPIBusOption bus_option, int bus, const char *path
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi088_accel_duplicates")),
|
||||
_got_duplicate(false)
|
||||
{
|
||||
_px4_accel.set_update_rate(BMI088_ACCEL_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI088_accel::~BMI088_accel()
|
||||
|
||||
@@ -65,6 +65,7 @@ BMI088_gyro::BMI088_gyro(I2CSPIBusOption bus_option, int bus, const char *path_g
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_transfers")),
|
||||
_bad_registers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_registers"))
|
||||
{
|
||||
_px4_gyro.set_update_rate(BMI088_GYRO_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI088_gyro::~BMI088_gyro()
|
||||
|
||||
@@ -64,6 +64,7 @@ BMI160::BMI160(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotatio
|
||||
_reset_retries(perf_alloc(PC_COUNT, MODULE_NAME":reset retries")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": duplicates"))
|
||||
{
|
||||
_px4_gyro.set_update_rate(BMI160_GYRO_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI160::~BMI160()
|
||||
|
||||
@@ -75,6 +75,7 @@ FXAS21002C::FXAS21002C(device::Device *interface, I2CSPIBusOption bus_option, in
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad register")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": duplicate reading"))
|
||||
{
|
||||
_px4_gyro.set_update_rate(FXAS21002C_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
FXAS21002C::~FXAS21002C()
|
||||
|
||||
@@ -66,6 +66,8 @@ FXOS8701CQ::FXOS8701CQ(device::Device *interface, I2CSPIBusOption bus_option, in
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad reg")),
|
||||
_accel_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": acc dupe"))
|
||||
{
|
||||
_px4_accel.set_update_rate(FXOS8701C_ACCEL_DEFAULT_RATE);
|
||||
|
||||
#if !defined(BOARD_HAS_NOISY_FXOS8700_MAG)
|
||||
_px4_mag.set_scale(0.001f);
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,7 @@ L3GD20::L3GD20(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotati
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad_reg")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": dupe"))
|
||||
{
|
||||
_px4_gyro.set_update_rate(L3GD20_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
L3GD20::~L3GD20()
|
||||
|
||||
@@ -127,6 +127,7 @@ LSM303D::reset()
|
||||
|
||||
accel_set_range(LSM303D_ACCEL_DEFAULT_RANGE_G);
|
||||
accel_set_samplerate(LSM303D_ACCEL_DEFAULT_RATE);
|
||||
_px4_accel.set_update_rate(LSM303D_ACCEL_DEFAULT_RATE);
|
||||
|
||||
// we setup the anti-alias on-chip filter as 50Hz. We believe
|
||||
// this operates in the analog domain, and is critical for
|
||||
|
||||
@@ -160,6 +160,8 @@ int MPU6000::reset()
|
||||
|
||||
// SAMPLE RATE
|
||||
_set_sample_rate(1000);
|
||||
_px4_accel.set_update_rate(1000);
|
||||
_px4_gyro.set_update_rate(1000);
|
||||
px4_usleep(1000);
|
||||
|
||||
_set_dlpf_filter(MPU6000_DEFAULT_ONCHIP_FILTER_FREQ);
|
||||
|
||||
@@ -189,6 +189,8 @@ MPU9250::reset_mpu()
|
||||
|
||||
// SAMPLE RATE
|
||||
_set_sample_rate(_sample_rate);
|
||||
_px4_accel.set_update_rate(_sample_rate);
|
||||
_px4_gyro.set_update_rate(_sample_rate);
|
||||
|
||||
_set_dlpf_filter(MPU9250_DEFAULT_ONCHIP_FILTER_FREQ);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user