mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 14:41:35 +08:00
Failure Detector - move "force_failsafe" flag inside circuit_breaker protection; remove PX4_WARN and send mavlink msg only once
This commit is contained in:
@@ -2294,20 +2294,17 @@ Commander::run()
|
|||||||
if (failure_status.roll ||
|
if (failure_status.roll ||
|
||||||
failure_status.pitch) {
|
failure_status.pitch) {
|
||||||
|
|
||||||
armed.force_failsafe = true;
|
|
||||||
status.attitude_failure = true;
|
status.attitude_failure = true;
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
|
|
||||||
// Only display an user message if the circuit-breaker is disabled
|
// Only display an user message if the circuit-breaker is disabled
|
||||||
if (!status_flags.circuit_breaker_flight_termination_disabled) {
|
if (!status_flags.circuit_breaker_flight_termination_disabled) {
|
||||||
|
|
||||||
if (!_failure_detector_termination_printed) {
|
armed.force_failsafe = true;
|
||||||
PX4_WARN("Flight termination because of attitude exceeding maximum values");
|
|
||||||
_failure_detector_termination_printed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (counter % (1000000 / COMMANDER_MONITORING_INTERVAL) == 0) {
|
if (!_failure_detector_termination_printed) {
|
||||||
mavlink_log_critical(&mavlink_log_pub, "Attitude failure detected: force failsafe");
|
mavlink_log_critical(&mavlink_log_pub, "Attitude failure detected: force failsafe");
|
||||||
|
_failure_detector_termination_printed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user