2011-09-08 22:29:39 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
2015-05-13 03:09:36 -03:00
|
|
|
#include "Plane.h"
|
2014-03-13 10:57:32 -03:00
|
|
|
|
2014-03-03 09:50:45 -04:00
|
|
|
// called by update navigation at 10Hz
|
2011-09-08 22:29:39 -03:00
|
|
|
// --------------------
|
2015-05-13 03:09:36 -03:00
|
|
|
void Plane::update_commands(void)
|
2011-09-08 22:29:39 -03:00
|
|
|
{
|
2012-08-16 21:50:15 -03:00
|
|
|
if(control_mode == AUTO) {
|
2015-02-20 19:14:18 -04:00
|
|
|
if (home_is_set != HOME_UNSET) {
|
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
|
|
|
}
|
|
|
|
|