From b65d7146755e7a9ac6609f15ff955470fc60cfdc Mon Sep 17 00:00:00 2001 From: Randy Mackay <rmackay9@yahoo.com> Date: Fri, 10 May 2013 10:51:46 +0900 Subject: [PATCH] Copter: set yaw-mode in do_loiter mission command --- ArduCopter/ArduCopter.pde | 1 + ArduCopter/commands_logic.pde | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index b74311653..ac7a70b1a 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1906,6 +1906,7 @@ void update_throttle_mode(void) get_throttle_althold_with_slew(wp_nav.get_desired_alt(), -wp_nav.get_descent_velocity(), wp_nav.get_climb_velocity()); set_target_alt_for_reporting(wp_nav.get_desired_alt()); // To-Do: return get_destination_alt if we are flying to a waypoint } + // To-Do: explicitly set what the throttle output should be (probably min throttle). Without setting it the throttle is simply left in it's last position although that is probably zero throttle anyway break; case THROTTLE_LAND: diff --git a/ArduCopter/commands_logic.pde b/ArduCopter/commands_logic.pde index 74c0ab88d..31b8bd25d 100644 --- a/ArduCopter/commands_logic.pde +++ b/ArduCopter/commands_logic.pde @@ -254,7 +254,6 @@ static void do_takeoff() } // do_nav_wp - initiate move to next waypoint -// note: caller should set yaw mode static void do_nav_wp() { // set roll-pitch mode @@ -319,6 +318,9 @@ static void do_loiter_unlimited() // set throttle mode to AUTO which, if not already active, will default to hold at our current altitude set_throttle_mode(THROTTLE_AUTO); + // hold yaw + set_yaw_mode(YAW_HOLD); + // get current position // To-Do: change this to projection based on current location and velocity Vector3f curr = inertial_nav.get_position(); @@ -384,6 +386,9 @@ static void do_loiter_time() // set throttle mode to AUTO which, if not already active, will default to hold at our current altitude set_throttle_mode(THROTTLE_AUTO); + // hold yaw + set_yaw_mode(YAW_HOLD); + // get current position // To-Do: change this to projection based on current location and velocity Vector3f curr = inertial_nav.get_position(); -- GitLab