From 63135a044fcf9c31b5b31a307018f5802d21dc8d Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Thu, 15 May 2014 22:13:11 +0900 Subject: [PATCH] Copter: remove setting Z-axis target in Hybrid This workaround is no longer required because AC_WPNav's set_loiter_target call no longer sets the position controller's z-axis target --- ArduCopter/control_hybrid.pde | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ArduCopter/control_hybrid.pde b/ArduCopter/control_hybrid.pde index 7ccc0df9ae..5222c1ab76 100644 --- a/ArduCopter/control_hybrid.pde +++ b/ArduCopter/control_hybrid.pde @@ -399,9 +399,7 @@ static void hybrid_run() hybrid.pitch_mode = HYBRID_BRAKE_TO_LOITER; hybrid.brake_to_loiter_timer = HYBRID_BRAKE_TO_LOITER_TIMER; // init loiter controller - Vector3f curr_pos = inertial_nav.get_position(); - curr_pos.z = pos_control.get_alt_target(); // We don't set alt_target to current altitude but to the current alt_target... the easiest would be to set only x/y as it was on pre-onion code - wp_nav.set_loiter_target(curr_pos, hybrid.loiter_reset_I); // (false) to avoid I_term reset. In original code, velocity(0,0,0) was used instead of current velocity: wp_nav.init_loiter_target(inertial_nav.get_position(), Vector3f(0,0,0)); + wp_nav.set_loiter_target(inertial_nav.get_position(), hybrid.loiter_reset_I); // (false) to avoid I_term reset. In original code, velocity(0,0,0) was used instead of current velocity: wp_nav.init_loiter_target(inertial_nav.get_position(), Vector3f(0,0,0)); // at this stage, we are going to run update_loiter that will reset I_term once. From now, we ensure next time that we will enter loiter and update it, I_term won't be reset anymore hybrid.loiter_reset_I = false; // set delay to start of wind compensation estimate updates