L1: Do only check for wrong tangent_vel if in circle_mode

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2020-11-27 17:04:06 +03:00
committed by Roman Bapst
parent c5486ca47e
commit 646b5bb578
+2 -2
View File
@@ -264,8 +264,8 @@ ECL_L1_Pos_Controller::navigate_loiter(const Vector2f &vector_A, const Vector2f
/* calculate velocity on circle / along tangent */
float tangent_vel = xtrack_vel_center * loiter_direction;
/* prevent PD output from turning the wrong way */
if (tangent_vel < 0.0f) {
/* prevent PD output from turning the wrong way when in circle mode */
if (tangent_vel < 0.0f && _circle_mode) {
lateral_accel_sp_circle_pd = math::max(lateral_accel_sp_circle_pd, 0.0f);
}