From 144516c9415f27c2f8504c278acb4ba58d9a4d43 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 14 Aug 2013 14:57:23 +1000 Subject: [PATCH] AP_L1_Control: set min groundspeed to 0.1 this works better for slow rovers --- libraries/AP_L1_Control/AP_L1_Control.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_L1_Control/AP_L1_Control.cpp b/libraries/AP_L1_Control/AP_L1_Control.cpp index bbe5ffda5b..454398de39 100644 --- a/libraries/AP_L1_Control/AP_L1_Control.cpp +++ b/libraries/AP_L1_Control/AP_L1_Control.cpp @@ -111,11 +111,11 @@ void AP_L1_Control::update_waypoint(const struct Location &prev_WP, const struct //Calculate groundspeed float groundSpeed = _groundspeed_vector.length(); - if (groundSpeed < 1.0f) { + if (groundSpeed < 0.1f) { // use a small ground speed vector in the right direction, // allowing us to use the compass heading at zero GPS velocity - _groundspeed_vector = Vector2f(cosf(_ahrs.yaw), sinf(_ahrs.yaw)); - groundSpeed = 1.0f; + groundSpeed = 0.1f; + _groundspeed_vector = Vector2f(cosf(_ahrs.yaw), sinf(_ahrs.yaw)) * groundSpeed; } // Calculate time varying control parameters