Commander: move first preflight check run to constructor

This commit is contained in:
Matthias Grob 2022-06-13 11:25:07 +02:00 committed by Daniel Agar
parent 0f41a5e385
commit aa575d6af0
1 changed files with 4 additions and 4 deletions

View File

@ -853,6 +853,10 @@ Commander::Commander() :
_param_rc_map_fltmode = param_find("RC_MAP_FLTMODE");
updateParameters();
// run preflight immediately to find all relevant parameters, but don't report
PreFlightCheck::preflightCheck(&_mavlink_log_pub, _vehicle_status, _vehicle_status_flags, _vehicle_control_mode,
false, true, hrt_elapsed_time(&_boot_timestamp));
}
Commander::~Commander()
@ -2189,10 +2193,6 @@ Commander::run()
arm_auth_init(&_mavlink_log_pub, &_vehicle_status.system_id);
// run preflight immediately to find all relevant parameters, but don't report
PreFlightCheck::preflightCheck(&_mavlink_log_pub, _vehicle_status, _vehicle_status_flags, _vehicle_control_mode,
false, true, hrt_elapsed_time(&_boot_timestamp));
while (!should_exit()) {
perf_begin(_loop_perf);