From 610d1d17957d16c07a9746fa1fb6cda6544fc0db Mon Sep 17 00:00:00 2001 From: Jason Short Date: Thu, 19 Jul 2012 17:41:52 -0700 Subject: [PATCH] Arducopter: deprecated the get_nav_yaw_offset function. Small Toy mode updates --- ArduCopter/Attitude.pde | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index 55bfb2b524..272efa24bc 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -479,8 +479,10 @@ static void reset_stability_I(void) throttle control ****************************************************************/ +/* Depricated + static long -get_nav_yaw_offset(int yaw_input, int reset) +//get_nav_yaw_offset(int yaw_input, int reset) { int32_t _yaw; @@ -501,6 +503,7 @@ get_nav_yaw_offset(int yaw_input, int reset) } } } +*/ static int16_t get_angle_boost(int16_t value) { @@ -784,22 +787,22 @@ void roll_pitch_toy() // user from Loiter mode int16_t yaw_rate = g.rc_1.control_in / g.toy_yaw_rate; - //nav_yaw += yaw_rate / 100; - //nav_yaw = wrap_360(nav_yaw); - //g.rc_4.servo_out = get_stabilize_yaw(nav_yaw); - if(g.rc_1.control_in != 0){ // roll g.rc_4.servo_out = get_acro_yaw(yaw_rate/2); yaw_stopped = false; yaw_timer = 150; + }else if (!yaw_stopped){ g.rc_4.servo_out = get_acro_yaw(0); yaw_timer--; - if(yaw_timer == 0){ + + if((yaw_timer == 0) || (fabs(omega.z) < .17)){ yaw_stopped = true; nav_yaw = ahrs.yaw_sensor; } }else{ + if(motors.armed() == false) + nav_yaw = ahrs.yaw_sensor; g.rc_4.servo_out = get_stabilize_yaw(nav_yaw); }