Skip to content

Commit

Permalink
TECS: fix publishing of tecs_status
Browse files Browse the repository at this point in the history
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed Nov 25, 2021
1 parent 57e6dcc commit 1e80478
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/lib/tecs/TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/lib/tecs/TECS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
class TECS
{
public:
TECS() = default;
TECS();
~TECS() = default;

// no copy, assignment, move, move assignment
Expand Down Expand Up @@ -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_s> _tecs_status_pub{ORB_ID(tecs_status)};

};
2 changes: 0 additions & 2 deletions src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 1 addition & 3 deletions src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ class FixedwingPositionControl final : public ModuleBase<FixedwingPositionContro

uORB::Publication<vehicle_attitude_setpoint_s> _attitude_sp_pub;
uORB::Publication<position_controller_status_s> _pos_ctrl_status_pub{ORB_ID(position_controller_status)}; ///< navigation capabilities publication
uORB::Publication<position_controller_landing_status_s> _pos_ctrl_landing_status_pub{ORB_ID(position_controller_landing_status)}; ///< landing status publication
uORB::Publication<tecs_status_s> _tecs_status_pub{ORB_ID(tecs_status)}; ///< TECS status publication
uORB::Publication<position_controller_landing_status_s> _pos_ctrl_landing_status_pub{ORB_ID(position_controller_landing_status)}; ///< landing status publication ///< TECS status publication
uORB::PublicationMulti<orbit_status_s> _orbit_status_pub{ORB_ID(orbit_status)};

manual_control_setpoint_s _manual_control_setpoint {}; ///< r/c channel data
Expand Down Expand Up @@ -282,7 +281,6 @@ class FixedwingPositionControl final : public ModuleBase<FixedwingPositionContro
DASH_FULL
};

// bool _conditions_for_eco_dash_met{false};
hrt_abstime _time_conditions_not_met{0};

float _last_airspeed_setpoint{NAN};
Expand Down

0 comments on commit 1e80478

Please sign in to comment.