From a0e43bca96f37205e2713c53ef9971996edc16d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 10 Nov 2021 10:26:09 +0100 Subject: [PATCH] msg: remove unused vehicle_actuator_setpoint topic --- msg/CMakeLists.txt | 1 - msg/vehicle_actuator_setpoint.msg | 6 ----- .../ActuatorEffectiveness.hpp | 1 - .../ControlAllocation/ControlAllocation.hpp | 1 - .../control_allocator/ControlAllocator.cpp | 22 +++---------------- .../control_allocator/ControlAllocator.hpp | 5 +---- src/modules/logger/logged_topics.cpp | 1 - 7 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 msg/vehicle_actuator_setpoint.msg diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index 565df56730..324f888ce8 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -164,7 +164,6 @@ set(msg_files ulog_stream.msg ulog_stream_ack.msg vehicle_acceleration.msg - vehicle_actuator_setpoint.msg vehicle_air_data.msg vehicle_angular_acceleration.msg vehicle_angular_acceleration_setpoint.msg diff --git a/msg/vehicle_actuator_setpoint.msg b/msg/vehicle_actuator_setpoint.msg deleted file mode 100644 index 54c0c9b61f..0000000000 --- a/msg/vehicle_actuator_setpoint.msg +++ /dev/null @@ -1,6 +0,0 @@ -uint64 timestamp # time since system start (microseconds) -uint64 timestamp_sample # the timestamp the data this control response is based on was sampled - -uint8 NUM_ACTUATOR_SETPOINT = 16 - -float32[16] actuator diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp index 68fbc6dd9d..a99947b6c6 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp @@ -44,7 +44,6 @@ #include #include -#include class ActuatorEffectiveness { diff --git a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp index 482d20cd04..e075e0006b 100644 --- a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp +++ b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp @@ -70,7 +70,6 @@ #pragma once #include -#include class ControlAllocation { diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index 156147595f..9f8bebd087 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -335,13 +335,10 @@ ControlAllocator::Run() _control_allocation->allocate(); // Publish actuator setpoint and allocator status - publish_actuator_setpoint(); + publish_actuator_controls(); publish_control_allocator_status(); - // Publish on legacy topics for compatibility with - // the current mixer system and multicopter controller - // TODO: remove - publish_legacy_actuator_controls(); + } perf_end(_loop_perf); @@ -373,19 +370,6 @@ ControlAllocator::update_effectiveness_matrix_if_needed(bool force) } } -void -ControlAllocator::publish_actuator_setpoint() -{ - matrix::Vector actuator_sp = _control_allocation->getActuatorSetpoint(); - - vehicle_actuator_setpoint_s vehicle_actuator_setpoint{}; - vehicle_actuator_setpoint.timestamp = hrt_absolute_time(); - vehicle_actuator_setpoint.timestamp_sample = _timestamp_sample; - actuator_sp.copyTo(vehicle_actuator_setpoint.actuator); - - _vehicle_actuator_setpoint_pub.publish(vehicle_actuator_setpoint); -} - void ControlAllocator::publish_control_allocator_status() { @@ -434,7 +418,7 @@ ControlAllocator::publish_control_allocator_status() } void -ControlAllocator::publish_legacy_actuator_controls() +ControlAllocator::publish_actuator_controls() { actuator_motors_s actuator_motors; actuator_motors.timestamp = hrt_absolute_time(); diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index 0f07a7e49a..47e47ddc98 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -67,7 +67,6 @@ #include #include #include -#include #include class ControlAllocator : public ModuleBase, public ModuleParams, public px4::WorkItem @@ -108,10 +107,9 @@ private: void update_effectiveness_matrix_if_needed(bool force = false); - void publish_actuator_setpoint(); void publish_control_allocator_status(); - void publish_legacy_actuator_controls(); + void publish_actuator_controls(); enum class AllocationMethod { NONE = -1, @@ -137,7 +135,6 @@ private: uORB::SubscriptionCallbackWorkItem _vehicle_thrust_setpoint_sub{this, ORB_ID(vehicle_thrust_setpoint)}; /**< vehicle thrust setpoint subscription */ // Outputs - uORB::Publication _vehicle_actuator_setpoint_pub{ORB_ID(vehicle_actuator_setpoint)}; /**< actuator setpoint publication */ uORB::Publication _control_allocator_status_pub{ORB_ID(control_allocator_status)}; /**< actuator setpoint publication */ uORB::Publication _actuator_motors_pub{ORB_ID(actuator_motors)}; diff --git a/src/modules/logger/logged_topics.cpp b/src/modules/logger/logged_topics.cpp index e6b030d046..bc703e4d0a 100644 --- a/src/modules/logger/logged_topics.cpp +++ b/src/modules/logger/logged_topics.cpp @@ -198,7 +198,6 @@ void LoggedTopics::add_default_topics() if (sys_ctrl_alloc >= 1) { add_topic("actuator_motors", 100); add_topic("actuator_servos", 100); - add_topic("vehicle_actuator_setpoint", 20); add_topic("vehicle_angular_acceleration", 20); add_topic("vehicle_angular_acceleration_setpoint", 20); add_topic("vehicle_thrust_setpoint", 20);