Skip to content
Snippets Groups Projects
Commit 98732ae4 authored by Randy Mackay's avatar Randy Mackay
Browse files

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.
parent 870b9b0f
No related branches found
No related tags found
No related merge requests found
...@@ -372,12 +372,8 @@ static void set_mode(uint8_t mode) ...@@ -372,12 +372,8 @@ static void set_mode(uint8_t mode)
case AUTO: case AUTO:
ap.manual_throttle = false; ap.manual_throttle = false;
ap.manual_attitude = false; ap.manual_attitude = false;
set_yaw_mode(YAW_HOLD); // yaw mode will be set by mission command // roll-pitch, throttle and yaw modes will all be set by the first nav command
set_roll_pitch_mode(AUTO_RP); init_commands(); // clear the command queues. will be reloaded when "run_autopilot" calls "update_commands" function
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();
break; break;
case CIRCLE: case CIRCLE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment