From 3ff1fc67fd598db5fa16815531a9a0d0a17b494f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isak=20=C3=85slund?= Date: Fri, 2 Oct 2026 22:48:19 +0200 Subject: [PATCH] fix(flight_mode_manager): zero acceleration seed before takeoff (#28979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(flight_mode_manager): do not seed takeoff trajectories with the ground acceleration estimate FlightModeManager calls reActivate() every cycle until the takeoff ramp starts. Since bfb48ad17e (#27652) activate() falls back to the EKF acceleration estimate when the previous setpoint has none, so every cycle on the ground reseeded the manual flight tasks with it. With props spinning slowly that estimate is vibration noise of several m/s^2, and whatever sample was current at the start of the ramp became the initial acceleration of the jerk-limited trajectories. In Position mode with centred sticks this produced tilt setpoints up to the takeoff tilt limit and sideways velocity setpoints of several m/s, and a downward seed held the vehicle on the ground despite full climb stick. A vehicle tipped over on takeoff and was terminated by the attitude failure detector. Seed zero acceleration on the ground, as before #27652 and as FlightTaskAuto::reActivate() already does. Mode switches in the air keep using the estimate. Signed-off-by: Isak Åslund * refactor(FlightTask): use shorter matrix library form to zero out acceleration --------- Signed-off-by: Isak Åslund Co-authored-by: Matthias Grob (cherry picked from commit 34526db0263789a39c429529149644579de988c5) Signed-off-by: Ramon Roche --- src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp b/src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp index 58d02530126..805ac3c672d 100644 --- a/src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp +++ b/src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp @@ -22,6 +22,8 @@ void FlightTask::reActivate() // Preserve vertical velocity while on the ground to allow descending by stick for reliable land detection trajectory_setpoint_s setpoint_preserve_vertical{empty_trajectory_setpoint}; setpoint_preserve_vertical.velocity[2] = _velocity_setpoint(2); + // Start from zero acceleration to make sure no accelration measurement driven by vibration gets used on the ground + matrix::Vector3f(0.f, 0.f, 0.f).copyTo(setpoint_preserve_vertical.acceleration); activate(setpoint_preserve_vertical); }