From f0b05ea7cfd9de4113f4cd63e8068cf8089bc158 Mon Sep 17 00:00:00 2001 From: Silvan Date: Mon, 2 Jun 2025 14:24:43 +0200 Subject: [PATCH] ControlAllocator: only use torque, not thrust sp as callback item Signed-off-by: Silvan --- src/modules/control_allocator/ControlAllocator.cpp | 6 ------ src/modules/control_allocator/ControlAllocator.hpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index 99e280dd71..c3950aed4f 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -95,11 +95,6 @@ ControlAllocator::init() return false; } - if (!_vehicle_thrust_setpoint_sub.registerCallback()) { - PX4_ERR("callback registration failed"); - return false; - } - #ifndef ENABLE_LOCKSTEP_SCHEDULER // Backup schedule would interfere with lockstep ScheduleDelayed(50_ms); #endif @@ -309,7 +304,6 @@ ControlAllocator::Run() { if (should_exit()) { _vehicle_torque_setpoint_sub.unregisterCallback(); - _vehicle_thrust_setpoint_sub.unregisterCallback(); exit_and_cleanup(); return; } diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index 1f91f7d17d..ce92c5036b 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -175,7 +175,7 @@ private: // Inputs uORB::SubscriptionCallbackWorkItem _vehicle_torque_setpoint_sub{this, ORB_ID(vehicle_torque_setpoint)}; /**< vehicle torque setpoint subscription */ - uORB::SubscriptionCallbackWorkItem _vehicle_thrust_setpoint_sub{this, ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription */ + uORB::Subscription _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription */ 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) */