diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-20 07:45:01 +0200 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-08-20 07:45:01 +0200 |
commit | 760a7ff548bcef6910f84beaa981600f3609358b (patch) | |
tree | b5326d0c8566c545846fbd57f6ac1673822fc126 /src/modules/commander/state_machine_helper.cpp | |
parent | 64ca94412e710164fb2ae69f6dfc3edbeff9c12b (diff) | |
download | px4-firmware-760a7ff548bcef6910f84beaa981600f3609358b.tar.gz px4-firmware-760a7ff548bcef6910f84beaa981600f3609358b.tar.bz2 px4-firmware-760a7ff548bcef6910f84beaa981600f3609358b.zip |
gpsfailure: add skeleton class, activate in commander
Diffstat (limited to 'src/modules/commander/state_machine_helper.cpp')
-rw-r--r-- | src/modules/commander/state_machine_helper.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 3f4bfaa1c..404bafb04 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -499,12 +499,15 @@ bool set_nav_state(struct vehicle_status_s *status, const bool data_link_loss_en status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL; } else if (status->data_link_lost_cmd) { status->nav_state = NAVIGATION_STATE_AUTO_RTGS; - //} else if (status->gps_failure_cmd) { - //status->nav_state = NAVIGATION_STATE_AUTO_***; + } else if (status->gps_failure_cmd) { + status->nav_state = NAVIGATION_STATE_AUTO_LANDGPSFAIL; } else if (status->rc_signal_lost_cmd) { status->nav_state = NAVIGATION_STATE_AUTO_RTGS; //XXX + /* Finished handling commands which have priority , now handle failures */ } else if (status->engine_failure) { status->nav_state = NAVIGATION_STATE_AUTO_LANDENGFAIL; + } else if (status->gps_failure) { + status->nav_state = NAVIGATION_STATE_AUTO_LANDGPSFAIL; } else if (((status->data_link_lost && data_link_loss_enabled) && status->rc_signal_lost) || (!data_link_loss_enabled && status->rc_signal_lost && mission_finished)) { status->failsafe = true; |