diff --git a/src/modules/land_detector/FixedwingLandDetector.cpp b/src/modules/land_detector/FixedwingLandDetector.cpp index 8e24c31655..66882dc822 100644 --- a/src/modules/land_detector/FixedwingLandDetector.cpp +++ b/src/modules/land_detector/FixedwingLandDetector.cpp @@ -41,28 +41,15 @@ #include #include + #include -#include #include "FixedwingLandDetector.h" - namespace land_detector { -FixedwingLandDetector::FixedwingLandDetector() : - _paramHandle(), - _params(), - _controlStateSub(-1), - _armingSub(-1), - _airspeedSub(-1), - _controlState{}, - _arming{}, - _airspeed{}, - _velocity_xy_filtered(0.0f), - _velocity_z_filtered(0.0f), - _airspeed_filtered(0.0f), - _accel_horz_lp(0.0f) +FixedwingLandDetector::FixedwingLandDetector() { _paramHandle.maxVelocity = param_find("LNDFW_VEL_XY_MAX"); _paramHandle.maxClimbRate = param_find("LNDFW_VEL_Z_MAX"); diff --git a/src/modules/land_detector/FixedwingLandDetector.h b/src/modules/land_detector/FixedwingLandDetector.h index c5b3be4d96..9037d0aa00 100644 --- a/src/modules/land_detector/FixedwingLandDetector.h +++ b/src/modules/land_detector/FixedwingLandDetector.h @@ -57,21 +57,15 @@ public: FixedwingLandDetector(); protected: - virtual void _initialize_topics() override; + void _initialize_topics() override; + void _update_params() override; + void _update_topics() override; + bool _get_landed_state() override; + bool _get_maybe_landed_state() override; + bool _get_ground_contact_state() override; + bool _get_freefall_state() override; + float _get_max_altitude() override; - virtual void _update_params() override; - - virtual void _update_topics() override; - - virtual bool _get_landed_state() override; - - virtual bool _get_maybe_landed_state() override; - - virtual bool _get_ground_contact_state() override; - - virtual bool _get_freefall_state() override; - - virtual float _get_max_altitude() override; private: /** Time in us that landing conditions have to hold before triggering a land. */ @@ -82,27 +76,27 @@ private: param_t maxClimbRate; param_t maxAirSpeed; param_t maxIntVelocity; - } _paramHandle; + } _paramHandle{}; struct { float maxVelocity; float maxClimbRate; float maxAirSpeed; float maxIntVelocity; - } _params; + } _params{}; - int _controlStateSub; - int _armingSub; - int _airspeedSub; + int _controlStateSub{-1}; + int _armingSub{-1}; + int _airspeedSub{-1}; - struct control_state_s _controlState; - struct actuator_armed_s _arming; - struct airspeed_s _airspeed; + control_state_s _controlState{}; + actuator_armed_s _arming{}; + airspeed_s _airspeed{}; - float _velocity_xy_filtered; - float _velocity_z_filtered; - float _airspeed_filtered; - float _accel_horz_lp; + float _velocity_xy_filtered{0.0f}; + float _velocity_z_filtered{0.0f}; + float _airspeed_filtered{0.0f}; + float _accel_horz_lp{0.0f}; }; } // namespace land_detector