mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Commander - Remove old code that overrides state_machine_helper logic
This commit is contained in:
parent
6d8d8e3c88
commit
02f0533ee9
@ -2227,61 +2227,6 @@ Commander::run()
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for failure combinations which lead to flight termination */
|
||||
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 */
|
||||
if (internal_state.main_state != commander_state_s::MAIN_STATE_MANUAL &&
|
||||
internal_state.main_state != commander_state_s::MAIN_STATE_ACRO &&
|
||||
internal_state.main_state != commander_state_s::MAIN_STATE_RATTITUDE &&
|
||||
internal_state.main_state != commander_state_s::MAIN_STATE_STAB &&
|
||||
internal_state.main_state != commander_state_s::MAIN_STATE_ALTCTL &&
|
||||
internal_state.main_state != commander_state_s::MAIN_STATE_POSCTL &&
|
||||
status.data_link_lost) {
|
||||
|
||||
armed.force_failsafe = true;
|
||||
status_changed = true;
|
||||
static bool flight_termination_printed = false;
|
||||
|
||||
if (!flight_termination_printed) {
|
||||
mavlink_log_critical(&mavlink_log_pub, "DL and GPS lost: flight termination");
|
||||
flight_termination_printed = true;
|
||||
}
|
||||
|
||||
if (counter % (1000000 / COMMANDER_MONITORING_INTERVAL) == 0) {
|
||||
mavlink_log_critical(&mavlink_log_pub, "DL and GPS lost: flight termination");
|
||||
}
|
||||
}
|
||||
|
||||
/* At this point the rc signal and the gps system have been checked
|
||||
* If we are in manual (controlled with RC):
|
||||
* if both failed we want to terminate the flight */
|
||||
if ((internal_state.main_state == commander_state_s::MAIN_STATE_ACRO ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_RATTITUDE ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_MANUAL ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_STAB ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_ALTCTL ||
|
||||
internal_state.main_state == commander_state_s::MAIN_STATE_POSCTL) &&
|
||||
status.rc_signal_lost) {
|
||||
|
||||
armed.force_failsafe = true;
|
||||
status_changed = true;
|
||||
static bool flight_termination_printed = false;
|
||||
|
||||
if (!flight_termination_printed) {
|
||||
warnx("Flight termination because of RC signal loss and GPS failure");
|
||||
flight_termination_printed = true;
|
||||
}
|
||||
|
||||
if (counter % (1000000 / COMMANDER_MONITORING_INTERVAL) == 0) {
|
||||
mavlink_log_critical(&mavlink_log_pub, "RC and GPS lost! Flight terminated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check for failure detector status */
|
||||
if (armed.armed) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user