From 3499b6ff89c6fdae3226a67583e3c745ba31acb9 Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 9 May 2019 14:08:18 +0200 Subject: [PATCH] AutoLineSmoothVel - Do not generate heading from trajectory if the velocity vector is smaller than 10cm/s This is done to avoid generating large yaw changes when the velocity vector is small; for example when switching into loiter or reaching the last waypoint. --- .../tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp index f03e1fab33..cd03313fe7 100644 --- a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp +++ b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp @@ -91,7 +91,7 @@ bool FlightTaskAutoLineSmoothVel::_generateHeadingAlongTraj() bool res = false; Vector2f vel_sp_xy(_velocity_setpoint); - if (vel_sp_xy.length() > .01f) { + if (vel_sp_xy.length() > .1f) { // Generate heading from velocity vector, only if it is long enough _compute_heading_from_2D_vector(_yaw_setpoint, vel_sp_xy); res = true;