mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-27 00:48:23 +08:00
* fix(fw_mode_manager): honor DO_CHANGE_SPEED in manual airspeed modes Re-anchor the throttle-stick airspeed interpolation on the last MAV_CMD_DO_CHANGE_SPEED value (falling back to FW_AIRSPD_TRIM if none). Previously, _commanded_manual_airspeed_setpoint was stored but never read when FW_POS_STK_CONF bit 1 was set (the default), so DO_CHANGE_SPEED had no effect in Position/Altitude. With this change: - Stick centered = commanded cruise speed (= FW_AIRSPD_TRIM if no command). - Stick deflection deviates from cruise between FW_AIRSPD_MIN/MAX. - Disconnecting the controller collapses the interpolation to the cruise (Sticks zeroes the throttle channel on manual_control_signal_lost). - No setpoint jump when a controller is plugged in with stick centered. - No behavior change for users who never send DO_CHANGE_SPEED. * fix(fw_mode_manager): clear DO_CHANGE_SPEED override on mode change Reset _commanded_manual_airspeed_setpoint to NaN when entering a manual airspeed mode from outside the manual airspeed pair, so a prior MAV_CMD_DO_CHANGE_SPEED does not silently anchor the manual airspeed setpoint after the pilot has left and re-entered manual airspeed control. Toggling between Position and Altitude preserves the commanded value since both modes share the same airspeed mechanic. Also fold in a make-format whitespace fix in get_manual_airspeed_setpoint. * docs(flight_modes_fw): document DO_CHANGE_SPEED in manual airspeed modes Describe how MAV_CMD_DO_CHANGE_SPEED re-anchors the throttle-stick cruise airspeed in Position and Altitude mode, matching the new behavior in the fw_mode_manager. Covers the centered-stick anchor, deflection scaling between FW_AIRSPD_MIN/MAX, the shared setpoint across both modes, and the reset to trim when entering from any other mode. Signed-off-by: Gregor Hohl <gregor.hohl@auterion.com> * Subedit * fix(fw_mode_manager): reset DO_CHANGE_SPEED override on any mode change Reset _commanded_manual_airspeed_setpoint to NaN whenever the position control mode changes, instead of only when entering manual airspeed control from outside the Position/Altitude pair. This makes the manual airspeed setpoint revert to FW_AIRSPD_TRIM on every mode change, including toggling between Position and Altitude, for predictable behavior. Signed-off-by: Gregor Hohl <gregor.hohl@auterion.com> * docs(flight_modes_fw): note manual airspeed resets on mode change Clarify that the commanded airspeed defaults to FW_AIRSPD_TRIM when no airspeed has been commanded, and document that the commanded airspeed resets on every flight mode change. Signed-off-by: Gregor Hohl <gregor.hohl@auterion.com> * docs(flight_modes_fw): clarify DO_CHANGE_SPEED param1/param2 handling Signed-off-by: Gregor Hohl <gregor.hohl@auterion.com> --------- Signed-off-by: Gregor Hohl <gregor.hohl@auterion.com> Co-authored-by: Hamish Willee <hamishwillee@gmail.com>