stae machine helper: remove unnecessary check for RC loss

This commit is contained in:
Thomas Gubler 2014-08-23 14:02:22 +02:00
parent ffd2fa7386
commit 3c10b78e20
2 changed files with 2 additions and 15 deletions

View File

@ -566,7 +566,7 @@ bool handle_command(struct vehicle_status_s *status_local, const struct safety_s
status_local->rc_signal_lost_cmd = false; status_local->rc_signal_lost_cmd = false;
if ((int)cmd->param2 <= 0) { if ((int)cmd->param2 <= 0) {
/* reset all commanded failure modes */ /* reset all commanded failure modes */
warnx("revert to normal mode"); warnx("reset all non-flighttermination failsafe commands");
} else if ((int)cmd->param2 == 1) { } else if ((int)cmd->param2 == 1) {
/* trigger engine failure mode */ /* trigger engine failure mode */
status_local->engine_failure_cmd = true; status_local->engine_failure_cmd = true;

View File

@ -548,22 +548,9 @@ bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_en
break; break;
case MAIN_STATE_AUTO_LOITER: case MAIN_STATE_AUTO_LOITER:
/* go into failsafe on a engine failure or if datalink and RC is lost */ /* go into failsafe on a engine failure */
if (status->engine_failure) { if (status->engine_failure) {
status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL; status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL;
} else if ((status->data_link_lost && data_link_loss_enabled) && status->rc_signal_lost) {
status->failsafe = true;
if (status->condition_global_position_valid && status->condition_home_position_valid) {
status->nav_state = NAVIGATION_STATE_AUTO_RTL;
} else if (status->condition_local_position_valid) {
status->nav_state = NAVIGATION_STATE_LAND;
} else if (status->condition_local_altitude_valid) {
status->nav_state = NAVIGATION_STATE_DESCEND;
} else {
status->nav_state = NAVIGATION_STATE_TERMINATION;
}
/* also go into failsafe if just datalink is lost */ /* also go into failsafe if just datalink is lost */
} else if (status->data_link_lost && data_link_loss_enabled) { } else if (status->data_link_lost && data_link_loss_enabled) {
status->failsafe = true; status->failsafe = true;