Cherry pick the directory and voted_sensors_update.h from PR #9756.

Consolidate _update_params() methods for improved inheritance from the LandDetector base class.
Move common uORB::Subscriptions to the base class for inheritance.
Deprecate redundant override methods.
This commit is contained in:
mcsauder
2019-10-14 21:25:57 +02:00
committed by Matthias Grob
parent c44e4b9578
commit fb12ddb69a
8 changed files with 63 additions and 102 deletions
@@ -42,10 +42,9 @@
#pragma once
#include <matrix/math.hpp>
#include <uORB/Subscription.hpp>
#include <uORB/topics/airspeed.h>
#include <uORB/topics/vehicle_acceleration.h>
#include <uORB/topics/vehicle_local_position.h>
#include "LandDetector.h"
@@ -60,12 +59,13 @@ public:
FixedwingLandDetector();
protected:
void _update_params() override;
void _update_topics() override;
bool _get_landed_state() override;
float _get_max_altitude() override;
void _update_topics() override;
private:
/** Time in us that landing conditions have to hold before triggering a land. */
@@ -73,13 +73,8 @@ private:
static constexpr hrt_abstime FLYING_TRIGGER_TIME_US = 0_us;
uORB::Subscription _airspeed_sub{ORB_ID(airspeed)};
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
uORB::Subscription _vehicle_acceleration_sub{ORB_ID(vehicle_acceleration)};
uORB::Subscription _vehicle_local_position_sub{ORB_ID(vehicle_local_position)};
airspeed_s _airspeed{};
vehicle_acceleration_s _vehicle_acceleration{};
vehicle_local_position_s _vehicle_local_position{};
float _airspeed_filtered{0.0f};
float _velocity_xy_filtered{0.0f};
@@ -93,7 +88,6 @@ private:
(ParamFloat<px4::params::LNDFW_VEL_XY_MAX>) _param_lndfw_vel_xy_max,
(ParamFloat<px4::params::LNDFW_VEL_Z_MAX>) _param_lndfw_vel_z_max
);
};
} // namespace land_detector