From 1e8047838f382e306971e71f40199e235825c9a3 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Thu, 25 Nov 2021 10:19:27 +0100 Subject: [PATCH] TECS: fix publishing of tecs_status Signed-off-by: Silvan Fuhrer --- src/lib/tecs/TECS.cpp | 6 ++++++ src/lib/tecs/TECS.hpp | 4 +++- src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp | 2 -- src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp | 4 +--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/tecs/TECS.cpp b/src/lib/tecs/TECS.cpp index 1428a5f8d38a..a02cf8ff43ba 100644 --- a/src/lib/tecs/TECS.cpp +++ b/src/lib/tecs/TECS.cpp @@ -50,6 +50,12 @@ static constexpr float DT_MAX = 1.0f; ///< max value of _dt allowed before a fil * @author Paul Riseborough */ + +TECS::TECS() +{ + _tecs_status_pub.advertise(); +} + /* * This function implements a complementary filter to estimate the climb rate when * inertial nav data is not available. It also calculates a true airspeed derivative diff --git a/src/lib/tecs/TECS.hpp b/src/lib/tecs/TECS.hpp index 3b80e82ea7c2..cf3dc725b779 100644 --- a/src/lib/tecs/TECS.hpp +++ b/src/lib/tecs/TECS.hpp @@ -56,7 +56,7 @@ class TECS { public: - TECS() = default; + TECS(); ~TECS() = default; // no copy, assignment, move, move assignment @@ -371,4 +371,6 @@ class TECS ManualVelocitySmoothingZ _velocity_control_traj_generator; // generates height rate and altitude setpoint trajectory when height rate is commanded + uORB::Publication _tecs_status_pub{ORB_ID(tecs_status)}; + }; diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 07212efc1ed4..53c94ced5d0e 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -70,8 +70,6 @@ FixedwingPositionControl::FixedwingPositionControl(bool vtol) : // limit to 50 Hz _local_pos_sub.set_interval_ms(20); - _tecs_status_pub.advertise(); - /* fetch initial parameter values */ parameters_update(); } diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp index 5319838b2270..3ffeb02519d8 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp @@ -156,8 +156,7 @@ class FixedwingPositionControl final : public ModuleBase _attitude_sp_pub; uORB::Publication _pos_ctrl_status_pub{ORB_ID(position_controller_status)}; ///< navigation capabilities publication - uORB::Publication _pos_ctrl_landing_status_pub{ORB_ID(position_controller_landing_status)}; ///< landing status publication - uORB::Publication _tecs_status_pub{ORB_ID(tecs_status)}; ///< TECS status publication + uORB::Publication _pos_ctrl_landing_status_pub{ORB_ID(position_controller_landing_status)}; ///< landing status publication ///< TECS status publication uORB::PublicationMulti _orbit_status_pub{ORB_ID(orbit_status)}; manual_control_setpoint_s _manual_control_setpoint {}; ///< r/c channel data @@ -282,7 +281,6 @@ class FixedwingPositionControl final : public ModuleBase