Skip to content

Commit 263ab4b

Browse files
committed
clarify torque-triggered setpoint handling
Clarify the unclear intention of how torque and thrust are handled. Signed-off-by: Onur Özkan <work@onurozkan.dev>
1 parent 3ba440c commit 263ab4b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/modules/control_allocator/ControlAllocator.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,15 @@ class ControlAllocator : public ModuleBase, public ModuleParams, public px4::Sch
186186
int _num_actuators[(int)ActuatorType::COUNT] {};
187187

188188
// Inputs
189+
//
190+
// Torque and thrust setpoints are usually published together.
191+
// Only torque drives the callback so control allocation runs once, then Run() reads the latest thrust.
192+
// Refs:
193+
// - https://github.com/PX4/PX4-Autopilot/pull/24955
194+
// - https://github.com/PX4/PX4-Autopilot/issues/24230
195+
// - https://github.com/PX4/PX4-Autopilot/issues/26971
189196
uORB::SubscriptionCallbackWorkItem _vehicle_torque_setpoint_sub{this, ORB_ID(vehicle_torque_setpoint)}; /**< vehicle torque setpoint subscription */
190-
uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription */
197+
uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription, polled when torque is triggered*/
191198

192199
uORB::Subscription _vehicle_torque_setpoint1_sub{ORB_ID(vehicle_torque_setpoint), 1}; /**< vehicle torque setpoint subscription (2. instance) */
193200
uORB::Subscription _vehicle_thrust_setpoint1_sub{ORB_ID(vehicle_thrust_setpoint), 1}; /**< vehicle thrust setpoint subscription (2. instance) */

0 commit comments

Comments
 (0)