mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 17:33:33 +08:00
commander: Add prearm check for flight termination
This commit is contained in:
committed by
Daniel Agar
parent
6359c8c008
commit
45dff7f71a
@@ -79,6 +79,12 @@ bool PreFlightCheck::preArmCheck(orb_advert_t *mavlink_log_pub, const vehicle_st
|
||||
prearm_ok = false;
|
||||
}
|
||||
|
||||
if (status_flags.flight_terminated) {
|
||||
if (report_fail) { mavlink_log_critical(mavlink_log_pub, "Arming denied! Flight termination active"); }
|
||||
|
||||
prearm_ok = false;
|
||||
}
|
||||
|
||||
// USB not connected
|
||||
if (!status_flags.circuit_breaker_engaged_usb_check && status_flags.usb_connected) {
|
||||
if (report_fail) { mavlink_log_critical(mavlink_log_pub, "Arming denied! Flying with USB is not safe"); }
|
||||
|
||||
@@ -2911,6 +2911,8 @@ Commander::run()
|
||||
checkWindAndWarn();
|
||||
}
|
||||
|
||||
_status_flags.flight_terminated = _armed.force_failsafe || _armed.lockdown || _armed.manual_lockdown;
|
||||
|
||||
/* Get current timestamp */
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user