mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 02:03:35 +08:00
Allow to in-air restore the FMU and IO arming state if only one of the two fails
This commit is contained in:
@@ -1260,6 +1260,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
param_get(param_find("SYS_FAILSAVE_LL"), &failsafe_lowlevel_timeout_ms);
|
||||
|
||||
param_t _param_sys_type = param_find("MAV_TYPE");
|
||||
param_t _param_system_id = param_find("MAV_SYS_ID");
|
||||
param_t _param_component_id = param_find("MAV_COMP_ID");
|
||||
|
||||
/* welcome user */
|
||||
warnx("I am in command now!\n");
|
||||
@@ -1444,6 +1446,7 @@ int commander_thread_main(int argc, char *argv[])
|
||||
/* parameters changed */
|
||||
orb_copy(ORB_ID(parameter_update), param_changed_sub, ¶m_changed);
|
||||
|
||||
|
||||
/* update parameters */
|
||||
if (!current_status.flag_system_armed) {
|
||||
if (param_get(_param_sys_type, &(current_status.system_type)) != OK) {
|
||||
@@ -1460,6 +1463,10 @@ int commander_thread_main(int argc, char *argv[])
|
||||
current_status.flag_external_manual_override_ok = true;
|
||||
}
|
||||
|
||||
/* check and update system / component ID */
|
||||
param_get(_param_system_id, &(current_status.system_id));
|
||||
param_get(_param_component_id, &(current_status.component_id));
|
||||
|
||||
} else {
|
||||
warnx("ARMED, rejecting sys type change\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user