mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 16:13:33 +08:00
sensors: move accel filtering to sensors/vehicle_acceleration
I've added a queue depth of 4 for sensor_accel and sensor_gyro. This is initially added because it's not always possible for the `vehicle_acceleration` to keep up with every publication of the primary accelerator as it runs in the same thread as ekf2, various controllers, etc. Later this mechanism will be used in a few areas - rate limit `vehicle_angular_velocity` and `vehicle_acceleration` without missing any raw data - move IMU integration to `vehicle_imu` and out of the actual driver threads, eliminating the need for sensor_accel_integrated and sensor_gyro_integrated - integrate raw gyro synchronized with optical flow measurements
This commit is contained in:
@@ -258,8 +258,6 @@ ADIS16448::set_sample_rate(uint16_t desired_sample_rate_hz)
|
||||
return false;
|
||||
}
|
||||
|
||||
_px4_accel.set_sample_rate(desired_sample_rate_hz);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ ADIS16477::ADIS16477(int bus, uint32_t device, enum Rotation rotation) :
|
||||
#endif // GPIO_SPI1_RESET_ADIS16477
|
||||
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_ADIS16477);
|
||||
_px4_accel.set_sample_rate(ADIS16477_DEFAULT_RATE);
|
||||
_px4_accel.set_scale(1.25f * CONSTANTS_ONE_G / 1000.0f); // accel 1.25 mg/LSB
|
||||
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_ADIS16477);
|
||||
|
||||
@@ -84,7 +84,6 @@ ADIS16497::ADIS16497(int bus, uint32_t device, enum Rotation rotation) :
|
||||
#endif // GPIO_SPI1_RESET_ADIS16497
|
||||
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_ADIS16497);
|
||||
_px4_accel.set_sample_rate(ADIS16497_DEFAULT_RATE);
|
||||
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_ADIS16497);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,7 @@ BMI160::BMI160(int bus, uint32_t device, enum Rotation rotation) :
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi160_duplicates"))
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_BMI160);
|
||||
_px4_accel.set_sample_rate(BMI160_ACCEL_DEFAULT_RATE);
|
||||
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_BMI160);
|
||||
_px4_accel.set_sample_rate(BMI160_GYRO_DEFAULT_RATE);
|
||||
}
|
||||
|
||||
BMI160::~BMI160()
|
||||
|
||||
@@ -58,8 +58,6 @@ ICM20602::ICM20602(int bus, uint32_t device, enum Rotation rotation) :
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_ICM20602);
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_ICM20602);
|
||||
|
||||
_px4_accel.set_sample_rate(ACCEL_RATE);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
_px4_gyro.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ ICM20608G::ICM20608G(int bus, uint32_t device, enum Rotation rotation) :
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_ICM20608);
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_ICM20608);
|
||||
|
||||
_px4_accel.set_sample_rate(ACCEL_RATE);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
_px4_gyro.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,6 @@ LSM303D::accel_set_samplerate(unsigned frequency)
|
||||
}
|
||||
|
||||
_call_accel_interval = 1000000 / accel_samplerate;
|
||||
_px4_accel.set_sample_rate(accel_samplerate);
|
||||
|
||||
modify_reg(ADDR_CTRL_REG1, clearbits, setbits);
|
||||
|
||||
|
||||
@@ -52,8 +52,6 @@ ISM330DLC::ISM330DLC(int bus, uint32_t device, enum Rotation rotation) :
|
||||
_px4_accel.set_device_type(DRV_DEVTYPE_ST_ISM330DLC);
|
||||
_px4_gyro.set_device_type(DRV_DEVTYPE_ST_ISM330DLC);
|
||||
|
||||
_px4_accel.set_sample_rate(ST_ISM330DLC::LA_ODR);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
_px4_gyro.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
}
|
||||
|
||||
@@ -48,8 +48,6 @@ LSM9DS1::LSM9DS1(int bus, uint32_t device, enum Rotation rotation) :
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
|
||||
_px4_accel.set_sample_rate(ST_LSM9DS1::LA_ODR);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / _fifo_interval);
|
||||
_px4_gyro.set_update_rate(1000000 / _fifo_interval);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user