Copter: remove redundant init of controllers when auto is started

individual do_* commands are responsible for setting roll-pitch, yaw and
throttle modes.  Removing this redundant setting of the controllers
removes the short period (10th second max) where loiter and waypoint
controller's desired roll and pitch were used even before the
controllers have been run once.
This commit is contained in:
Randy Mackay 2013-05-10 10:51:13 +09:00
parent 870b9b0fbb
commit 98732ae4e8

View File

@ -372,12 +372,8 @@ static void set_mode(uint8_t mode)
case AUTO:
ap.manual_throttle = false;
ap.manual_attitude = false;
set_yaw_mode(YAW_HOLD); // yaw mode will be set by mission command
set_roll_pitch_mode(AUTO_RP);
set_throttle_mode(AUTO_THR);
// we do not set nav mode for auto because it will be overwritten when first command runs
// loads the commands from where we left off
init_commands();
// roll-pitch, throttle and yaw modes will all be set by the first nav command
init_commands(); // clear the command queues. will be reloaded when "run_autopilot" calls "update_commands" function
break;
case CIRCLE: