AP_InertialSensor: fixed filter setup on 2nd accel/gyro
This commit is contained in:
parent
0c92331762
commit
32ed0d58f3
@ -212,9 +212,9 @@ void AP_InertialSensor_Backend::update_gyro(uint8_t instance)
|
||||
}
|
||||
|
||||
// possibly update filter frequency
|
||||
if (_last_gyro_filter_hz != _gyro_filter_cutoff()) {
|
||||
if (_last_gyro_filter_hz[instance] != _gyro_filter_cutoff()) {
|
||||
_imu._gyro_filter[instance].set_cutoff_frequency(_gyro_raw_sample_rate(instance), _gyro_filter_cutoff());
|
||||
_last_gyro_filter_hz = _gyro_filter_cutoff();
|
||||
_last_gyro_filter_hz[instance] = _gyro_filter_cutoff();
|
||||
}
|
||||
|
||||
hal.scheduler->resume_timer_procs();
|
||||
@ -233,9 +233,9 @@ void AP_InertialSensor_Backend::update_accel(uint8_t instance)
|
||||
}
|
||||
|
||||
// possibly update filter frequency
|
||||
if (_last_accel_filter_hz != _accel_filter_cutoff()) {
|
||||
if (_last_accel_filter_hz[instance] != _accel_filter_cutoff()) {
|
||||
_imu._accel_filter[instance].set_cutoff_frequency(_accel_raw_sample_rate(instance), _accel_filter_cutoff());
|
||||
_last_accel_filter_hz = _accel_filter_cutoff();
|
||||
_last_accel_filter_hz[instance] = _accel_filter_cutoff();
|
||||
}
|
||||
|
||||
hal.scheduler->resume_timer_procs();
|
||||
|
@ -140,8 +140,8 @@ protected:
|
||||
void update_accel(uint8_t instance);
|
||||
|
||||
// support for updating filter at runtime
|
||||
int8_t _last_accel_filter_hz;
|
||||
int8_t _last_gyro_filter_hz;
|
||||
int8_t _last_accel_filter_hz[INS_MAX_INSTANCES];
|
||||
int8_t _last_gyro_filter_hz[INS_MAX_INSTANCES];
|
||||
|
||||
// note that each backend is also expected to have a static detect()
|
||||
// function which instantiates an instance of the backend sensor
|
||||
|
Loading…
Reference in New Issue
Block a user