From cf517f50d82c8e2013348e553c5cbdfc17057909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=96zkan?= Date: Tue, 7 Apr 2026 22:08:09 +0300 Subject: [PATCH] docs(control-allocator): clarify torque-triggered setpoint handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clarify the unclear intention of how torque and thrust are handled. Signed-off-by: Onur Özkan --- src/modules/control_allocator/ControlAllocator.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index 93d8d36463..99420ee95a 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -186,8 +186,15 @@ private: int _num_actuators[(int)ActuatorType::COUNT] {}; // Inputs + // + // Torque and thrust setpoints are usually published together. + // Only torque drives the callback so control allocation runs once, then Run() reads the latest thrust. + // Refs: + // - https://github.com/PX4/PX4-Autopilot/pull/24955 + // - https://github.com/PX4/PX4-Autopilot/issues/24230 + // - https://github.com/PX4/PX4-Autopilot/issues/26971 uORB::SubscriptionCallbackWorkItem _vehicle_torque_setpoint_sub{this, ORB_ID(vehicle_torque_setpoint)}; /**< vehicle torque setpoint subscription */ - uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription */ + uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription, polled when torque is triggered*/ uORB::Subscription _vehicle_torque_setpoint1_sub{ORB_ID(vehicle_torque_setpoint), 1}; /**< vehicle torque setpoint subscription (2. instance) */ uORB::Subscription _vehicle_thrust_setpoint1_sub{ORB_ID(vehicle_thrust_setpoint), 1}; /**< vehicle thrust setpoint subscription (2. instance) */