2011-09-08 22:29:39 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
2014-03-13 10:57:32 -03:00
|
|
|
// forward declaration of verify_command to keep compiler happy
|
|
|
|
static bool verify_command(const AP_Mission::Mission_Command& cmd);
|
|
|
|
|
2014-03-03 09:50:45 -04:00
|
|
|
// called by update navigation at 10Hz
|
2011-09-08 22:29:39 -03:00
|
|
|
// --------------------
|
|
|
|
static void update_commands(void)
|
|
|
|
{
|
2012-08-16 21:50:15 -03:00
|
|
|
if(control_mode == AUTO) {
|
2014-03-14 10:32:06 -03:00
|
|
|
if (home_is_set) {
|
2014-03-13 10:57:32 -03:00
|
|
|
if(mission.state() == AP_Mission::MISSION_RUNNING) {
|
|
|
|
mission.update();
|
2014-03-13 23:06:40 -03:00
|
|
|
} else {
|
2014-03-14 10:32:06 -03:00
|
|
|
// auto_rtl_command should have been set to MAV_CMD_NAV_LOITER_UNLIM by exit_mission
|
2014-03-14 10:08:56 -03:00
|
|
|
verify_command(auto_rtl_command);
|
2014-03-13 10:57:32 -03:00
|
|
|
}
|
2012-08-16 21:50:15 -03:00
|
|
|
}
|
|
|
|
}
|
2011-09-08 22:29:39 -03:00
|
|
|
}
|
|
|
|
|