ekf2: fix barometer kconfig

This commit is contained in:
Daniel Agar 2023-10-17 13:33:06 -04:00
parent 988705831d
commit 6eae9fb371
3 changed files with 11 additions and 0 deletions

View File

@ -65,7 +65,12 @@ void Ekf::initialiseCovariance()
P.uncorrelateCovarianceSetVariance<State::vel.dof>(State::vel.idx, Vector3f(vel_var, vel_var, sq(1.5f) * vel_var)); P.uncorrelateCovarianceSetVariance<State::vel.dof>(State::vel.idx, Vector3f(vel_var, vel_var, sq(1.5f) * vel_var));
// position // position
#if defined(CONFIG_EKF2_BAROMETER)
float z_pos_var = sq(fmaxf(_params.baro_noise, 0.01f)); float z_pos_var = sq(fmaxf(_params.baro_noise, 0.01f));
#else
float z_pos_var = sq(1.f);
#endif // CONFIG_EKF2_BAROMETER
#if defined(CONFIG_EKF2_GNSS) #if defined(CONFIG_EKF2_GNSS)
const float xy_pos_var = sq(fmaxf(_params.gps_pos_noise, 0.01f)); const float xy_pos_var = sq(fmaxf(_params.gps_pos_noise, 0.01f));

View File

@ -563,10 +563,12 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
max_time_delay_ms = math::max(_params.auxvel_delay_ms, max_time_delay_ms); max_time_delay_ms = math::max(_params.auxvel_delay_ms, max_time_delay_ms);
#endif // CONFIG_EKF2_AUXVEL #endif // CONFIG_EKF2_AUXVEL
#if defined(CONFIG_EKF2_BAROMETER)
// using baro // using baro
if (_params.baro_ctrl > 0) { if (_params.baro_ctrl > 0) {
max_time_delay_ms = math::max(_params.baro_delay_ms, max_time_delay_ms); max_time_delay_ms = math::max(_params.baro_delay_ms, max_time_delay_ms);
} }
#endif // CONFIG_EKF2_BAROMETER
#if defined(CONFIG_EKF2_AIRSPEED) #if defined(CONFIG_EKF2_AIRSPEED)
// using airspeed // using airspeed

View File

@ -229,7 +229,9 @@ EKF2::~EKF2()
perf_free(_ecl_ekf_update_perf); perf_free(_ecl_ekf_update_perf);
perf_free(_ecl_ekf_update_full_perf); perf_free(_ecl_ekf_update_full_perf);
perf_free(_msg_missed_imu_perf); perf_free(_msg_missed_imu_perf);
#if defined(CONFIG_EKF2_BAROMETER)
perf_free(_msg_missed_air_data_perf); perf_free(_msg_missed_air_data_perf);
#endif // CONFIG_EKF2_BAROMETER
#if defined(CONFIG_EKF2_AIRSPEED) #if defined(CONFIG_EKF2_AIRSPEED)
perf_free(_msg_missed_airspeed_perf); perf_free(_msg_missed_airspeed_perf);
#endif // CONFIG_EKF2_AIRSPEED #endif // CONFIG_EKF2_AIRSPEED
@ -398,7 +400,9 @@ int EKF2::print_status()
perf_print_counter(_ecl_ekf_update_perf); perf_print_counter(_ecl_ekf_update_perf);
perf_print_counter(_ecl_ekf_update_full_perf); perf_print_counter(_ecl_ekf_update_full_perf);
perf_print_counter(_msg_missed_imu_perf); perf_print_counter(_msg_missed_imu_perf);
#if defined(CONFIG_EKF2_BAROMETER)
perf_print_counter(_msg_missed_air_data_perf); perf_print_counter(_msg_missed_air_data_perf);
#endif // CONFIG_EKF2_BAROMETER
#if defined(CONFIG_EKF2_AIRSPEED) #if defined(CONFIG_EKF2_AIRSPEED)
perf_print_counter(_msg_missed_airspeed_perf); perf_print_counter(_msg_missed_airspeed_perf);
#endif // CONFIG_EKF2_AIRSPEED #endif // CONFIG_EKF2_AIRSPEED