65 #include <mathlib/mathlib.h> 112 if (_param_lndmc_ffall_thr.get() < 0.1f ||
113 _param_lndmc_ffall_thr.get() > 10.0f) {
125 return (accel.norm() < _param_lndmc_ffall_thr.get());
141 bool vertical_movement =
false;
152 float max_climb_rate = ((land_speed_threshold * 0.5f) < _param_lndmc_z_vel_max.get()) ? (0.5
f * land_speed_threshold) :
153 _param_lndmc_z_vel_max.get();
165 bool hit_ground =
_in_descend && !vertical_movement;
191 float landThresholdFactor = 1.0f;
195 landThresholdFactor = 2.5f;
199 float max_rotation_scaled =
math::radians(_param_lndmc_rot_max.get()) * landThresholdFactor;
245 float valid_altitude_max = _param_lndmc_alt_max.get();
247 if (valid_altitude_max < 0.0
f) {
252 valid_altitude_max = _param_lndmc_alt_max.get() * 0.75f;
256 valid_altitude_max = _param_lndmc_alt_max.get() * 0.5f;
260 valid_altitude_max = _param_lndmc_alt_max.get() * 0.25f;
263 return valid_altitude_max;
291 _param_lndmc_low_t_thr.get();
304 sys_min_throttle = (
_params.minManThrottle + 0.01f);
struct land_detector::MulticopterLandDetector::@99 _params
bool _get_maybe_landed_state() override
virtual void _update_topics()
Updates subscribed uORB topics.
vehicle_local_position_s _vehicle_local_position
__EXPORT int param_get(param_t param, void *val)
Copy the value of a parameter.
struct land_detector::MulticopterLandDetector::@98 _paramHandle
Handles for interesting parameters.
bool flag_control_climb_rate_enabled
bool _has_altitude_lock()
bool _get_landed_state() override
actuator_armed_s _actuator_armed
vehicle_control_mode_s _vehicle_control_mode
static constexpr hrt_abstime LAND_DETECTOR_TRIGGER_TIME_US
Time in us that landing conditions have to hold before triggering a land.
hrt_abstime _min_trust_start
timestamp when minimum trust was applied first
bool _get_ground_effect_state() override
systemlib::Hysteresis _maybe_landed_hysteresis
actuator_controls_s _actuator_controls
bool _in_descend
vehicle is desending
void _update_params() override
Updates parameters.
systemlib::Hysteresis _ground_contact_hysteresis
uORB::Subscription _vehicle_angular_velocity_sub
Land detection implementation for multicopters.
bool _has_position_lock()
vehicle_acceleration_s _vehicle_acceleration
static constexpr hrt_abstime LAND_DETECTOR_LAND_PHASE_TIME_US
Time interval in us in which wider acceptance thresholds are used after landed.
static constexpr hrt_abstime GROUND_CONTACT_TRIGGER_TIME_US
Time in us that ground contact condition have to hold before triggering contact ground.
void _update_topics() override
Updates subscribed uORB topics.
bool _get_ground_contact_state() override
bool _has_minimal_thrust()
MulticopterLandDetector()
battery_status_s _battery_status
uORB::Subscription _vehicle_control_mode_sub
vehicle_angular_velocity_s _vehicle_angular_velocity
bool _horizontal_movement
vehicle is moving horizontally
constexpr T radians(T degrees)
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
static hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
Compute the delta between a timestamp taken in the past and now.
bool _get_freefall_state() override
vehicle_local_position_setpoint_s _vehicle_local_position_setpoint
bool _is_climb_rate_enabled()
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
static constexpr hrt_abstime MAYBE_LAND_DETECTOR_TRIGGER_TIME_US
Time in us that almost landing conditions have to hold before triggering almost landed ...
__EXPORT param_t param_find(const char *name)
Look up a parameter by name.
void set_hysteresis_time_from(const bool from_state, const hrt_abstime new_hysteresis_time_us)
virtual void _update_params()
Updates parameters.
constexpr _Tp max(_Tp a, _Tp b)
uORB::Subscription _battery_sub
float _get_max_altitude() override
systemlib::Hysteresis _freefall_hysteresis
uORB::Subscription _vehicle_local_position_setpoint_sub
bool update(void *dst)
Update the struct.
systemlib::Hysteresis _landed_hysteresis
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
uORB::Subscription _actuator_controls_sub