mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
commander: Add prearm check for flight termination
This commit is contained in:
committed by
Daniel Agar
parent
6359c8c008
commit
45dff7f71a
@@ -24,6 +24,7 @@ bool position_reliant_on_optical_flow
|
||||
bool position_reliant_on_vision_position
|
||||
|
||||
bool dead_reckoning
|
||||
bool flight_terminated
|
||||
|
||||
bool circuit_breaker_engaged_power_check
|
||||
bool circuit_breaker_engaged_airspd_check
|
||||
|
||||
@@ -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