Skip to content

Commit

Permalink
Checkpoint: navigation state machine as discussed with Lorenz
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Oes committed Feb 21, 2013
1 parent 0e29f25 commit ebe0285
Show file tree
Hide file tree
Showing 7 changed files with 373 additions and 152 deletions.
Binary file modified Documentation/flight_mode_state_machine.odg
Binary file not shown.
16 changes: 2 additions & 14 deletions apps/commander/commander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ int commander_thread_main(int argc, char *argv[])

/* make sure we are in preflight state */
memset(&current_status, 0, sizeof(current_status));
current_status.navigation_state = NAVIGATION_STATE_STANDBY;
current_status.navigation_state = NAVIGATION_STATE_INIT;
current_status.arming_state = ARMING_STATE_INIT;
current_status.hil_state = HIL_STATE_OFF;
current_status.flag_system_armed = false;
Expand Down Expand Up @@ -1857,19 +1857,7 @@ int commander_thread_main(int argc, char *argv[])
}

/* Now it's time to handle the stick inputs */

if (current_status.arming_state == ARMING_STATE_ARMED) {

if (current_status.mode_switch == MODE_SWITCH_MANUAL) {
do_navigation_state_update(stat_pub, &current_status, mavlink_fd, NAVIGATION_STATE_MANUAL );
} else if (current_status.mode_switch == MODE_SWITCH_SEATBELT) {
do_navigation_state_update(stat_pub, &current_status, mavlink_fd, NAVIGATION_STATE_SEATBELT );
} else if (current_status.mode_switch == MODE_SWITCH_AUTO) {
if (current_status.navigation_state == NAVIGATION_STATE_MANUAL) {
do_navigation_state_update(stat_pub, &current_status, mavlink_fd, NAVIGATION_STATE_MISSION );
}
}
}
navigation_state_update(stat_pub, &current_status, mavlink_fd);

/* handle the case where RC signal was regained */
if (!current_status.rc_signal_found_once) {
Expand Down
Loading

0 comments on commit ebe0285

Please sign in to comment.