mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 03:43:35 +08:00
imu drivers: do not set on-chip filter based on driver filter setting
The description of IMU_GYRO_CUTOFF was incorrectly saying that it only affects the driver filtering, but in fact it also set the on-chip filter to the next higher supported value. This patch fixes that. And because the IMU_GYRO_CUTOFF and not the IMU_ACCEL_CUTOFF was used for the on-chip filter, after #9070 which sets the default gyro filter to 80, we were effectively using a dlpf of 98 Hz. For this reason this patch changes the on-chip cutoff frequency to 98 as well, so that the overall default behavior is unchanged.
This commit is contained in:
@@ -655,14 +655,12 @@ BMI160::ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||
// adjust filters
|
||||
float cutoff_freq_hz = _accel_filter_x.get_cutoff_freq();
|
||||
float sample_rate = 1.0e6f / ticks;
|
||||
_set_dlpf_filter(cutoff_freq_hz);
|
||||
_accel_filter_x.set_cutoff_frequency(sample_rate, cutoff_freq_hz);
|
||||
_accel_filter_y.set_cutoff_frequency(sample_rate, cutoff_freq_hz);
|
||||
_accel_filter_z.set_cutoff_frequency(sample_rate, cutoff_freq_hz);
|
||||
|
||||
|
||||
float cutoff_freq_hz_gyro = _gyro_filter_x.get_cutoff_freq();
|
||||
_set_dlpf_filter(cutoff_freq_hz_gyro);
|
||||
_gyro_filter_x.set_cutoff_frequency(sample_rate, cutoff_freq_hz_gyro);
|
||||
_gyro_filter_y.set_cutoff_frequency(sample_rate, cutoff_freq_hz_gyro);
|
||||
_gyro_filter_z.set_cutoff_frequency(sample_rate, cutoff_freq_hz_gyro);
|
||||
|
||||
Reference in New Issue
Block a user