EKF: Fix variable names to match convention

This commit is contained in:
Paul Riseborough
2016-11-07 22:23:12 +11:00
parent afd6e54b2a
commit 5ad329b641
3 changed files with 30 additions and 30 deletions
+9 -9
View File
@@ -259,10 +259,10 @@ bool Ekf::initialiseFilter(void)
// increment the sample count and apply a LPF to the measurement
_mag_counter ++;
// don't start using data until we can be certain all bad initial data has been flushed
if (_mag_counter == (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
if (_mag_counter == (uint8_t)(_obs_buffer_length + 1)) {
// initialise filter states
_mag_filt_state = _mag_sample_delayed.mag;
} else if (_mag_counter > (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
} else if (_mag_counter > (uint8_t)(_obs_buffer_length + 1)) {
// noise filter the data
_mag_filt_state = _mag_filt_state * 0.9f + _mag_sample_delayed.mag * 0.1f;
}
@@ -306,10 +306,10 @@ bool Ekf::initialiseFilter(void)
// increment the sample count and apply a LPF to the measurement
_hgt_counter ++;
// don't start using data until we can be certain all bad initial data has been flushed
if (_hgt_counter == (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
if (_hgt_counter == (uint8_t)(_obs_buffer_length + 1)) {
// initialise filter states
_rng_filt_state = _range_sample_delayed.rng;
} else if (_hgt_counter > (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
} else if (_hgt_counter > (uint8_t)(_obs_buffer_length + 1)) {
// noise filter the data
_rng_filt_state = 0.9f * _rng_filt_state + 0.1f * _range_sample_delayed.rng;
}
@@ -330,10 +330,10 @@ bool Ekf::initialiseFilter(void)
// increment the sample count and apply a LPF to the measurement
_hgt_counter ++;
// don't start using data until we can be certain all bad initial data has been flushed
if (_hgt_counter == (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
if (_hgt_counter == (uint8_t)(_obs_buffer_length + 1)) {
// initialise filter states
_baro_hgt_offset = _baro_sample_delayed.hgt;
} else if (_hgt_counter > (uint8_t)(OBS_BUFFER_LENGTH + 1)) {
} else if (_hgt_counter > (uint8_t)(_obs_buffer_length + 1)) {
// noise filter the data
_baro_hgt_offset = 0.9f * _baro_hgt_offset + 0.1f * _baro_sample_delayed.hgt;
}
@@ -347,9 +347,9 @@ bool Ekf::initialiseFilter(void)
}
// check to see if we have enough measurements and return false if not
bool hgt_count_fail = _hgt_counter <= 2*OBS_BUFFER_LENGTH;
bool mag_count_fail = _mag_counter <= 2*OBS_BUFFER_LENGTH;
bool ev_count_fail = ((_params.fusion_mode & MASK_USE_EVPOS) || (_params.fusion_mode & MASK_USE_EVYAW)) && (_ev_counter <= 2*OBS_BUFFER_LENGTH);
bool hgt_count_fail = _hgt_counter <= 2*_obs_buffer_length;
bool mag_count_fail = _mag_counter <= 2*_obs_buffer_length;
bool ev_count_fail = ((_params.fusion_mode & MASK_USE_EVPOS) || (_params.fusion_mode & MASK_USE_EVYAW)) && (_ev_counter <= 2*_obs_buffer_length);
if (hgt_count_fail || mag_count_fail || ev_count_fail) {
return false;