mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 04:53:34 +08:00
commander: only warn if termination happens
The termination warnings were printed even if termination was not actually enabled. This was confusing and is therefore fixed.
This commit is contained in:
@@ -2300,7 +2300,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
|
||||
|
||||
/* Check for mission flight termination */
|
||||
if (armed.armed && mission_result.flight_termination) {
|
||||
if (armed.armed && mission_result.flight_termination &&
|
||||
!status_flags.circuit_breaker_flight_termination_disabled) {
|
||||
armed.force_failsafe = true;
|
||||
status_changed = true;
|
||||
static bool flight_termination_printed = false;
|
||||
@@ -2631,7 +2632,8 @@ int commander_thread_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Check for failure combinations which lead to flight termination */
|
||||
if (armed.armed) {
|
||||
if (armed.armed &&
|
||||
!status_flags.circuit_breaker_flight_termination_disabled) {
|
||||
/* At this point the data link and the gps system have been checked
|
||||
* If we are not in a manual (RC stick controlled mode)
|
||||
* and both failed we want to terminate the flight */
|
||||
@@ -2879,6 +2881,7 @@ get_circuit_breaker_params()
|
||||
status_flags.circuit_breaker_engaged_airspd_check = circuit_breaker_enabled("CBRK_AIRSPD_CHK", CBRK_AIRSPD_CHK_KEY);
|
||||
status_flags.circuit_breaker_engaged_enginefailure_check = circuit_breaker_enabled("CBRK_ENGINEFAIL", CBRK_ENGINEFAIL_KEY);
|
||||
status_flags.circuit_breaker_engaged_gpsfailure_check = circuit_breaker_enabled("CBRK_GPSFAIL", CBRK_GPSFAIL_KEY);
|
||||
status_flags.circuit_breaker_flight_termination_disabled = circuit_breaker_enabled("CBRK_FLIGHTTERM", CBRK_FLIGHTTERM_KEY);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -76,6 +76,7 @@ struct status_flags_s {
|
||||
bool circuit_breaker_engaged_airspd_check;
|
||||
bool circuit_breaker_engaged_enginefailure_check;
|
||||
bool circuit_breaker_engaged_gpsfailure_check;
|
||||
bool circuit_breaker_flight_termination_disabled;
|
||||
bool circuit_breaker_engaged_usb_check;
|
||||
bool offboard_control_signal_found_once;
|
||||
bool offboard_control_signal_lost;
|
||||
|
||||
Reference in New Issue
Block a user