48 LandDetector::LandDetector() :
49 ModuleParams(nullptr),
50 ScheduledWorkItem(MODULE_NAME,
px4::wq_configurations::att_pos_ctrl)
118 _param_total_flight_time_high.set(flight_time);
119 _param_total_flight_time_high.commit_no_notification();
123 _param_total_flight_time_low.set(flight_time);
124 _param_total_flight_time_low.commit_no_notification();
167 _total_flight_time =
static_cast<uint64_t
>(_param_total_flight_time_high.get()) << 32;
virtual float _get_max_altitude()
virtual void _update_topics()
Updates subscribed uORB topics.
vehicle_local_position_s _vehicle_local_position
virtual bool _get_landed_state()=0
perf_counter_t _cycle_perf
hrt_abstime _total_flight_time
total vehicle flight time in microseconds
uORB::Subscription _vehicle_local_position_sub
actuator_armed_s _actuator_armed
static constexpr uint32_t LAND_DETECTOR_UPDATE_INTERVAL
Run main land detector loop at this interval.
systemlib::Hysteresis _maybe_landed_hysteresis
void _update_total_flight_time()
systemlib::Hysteresis _ground_contact_hysteresis
void set_state_and_update(const bool new_state, const hrt_abstime &now_us)
bool _previous_armed_state
stores the previous actuator_armed.armed state
vehicle_acceleration_s _vehicle_acceleration
uORB::Subscription _actuator_armed_sub
uORB::Subscription _vehicle_acceleration_sub
bool publish(const T &data)
Publish the struct.
void perf_free(perf_counter_t handle)
Free a counter.
virtual bool _get_ground_contact_state()
static hrt_abstime hrt_elapsed_time(const hrt_abstime *then)
Compute the delta between a timestamp taken in the past and now.
void perf_end(perf_counter_t handle)
End a performance event.
bool updated()
Check if there is a new update.
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
hrt_abstime _takeoff_time
virtual bool _get_ground_effect_state()
virtual void _update_params()
Updates parameters.
virtual bool _get_maybe_landed_state()
uORB::Publication< vehicle_land_detected_s > _vehicle_land_detected_pub
systemlib::Hysteresis _ground_effect_hysteresis
uORB::Subscription _parameter_update_sub
systemlib::Hysteresis _freefall_hysteresis
Land detector interface for multicopter, fixedwing and VTOL implementations.
bool update(void *dst)
Update the struct.
vehicle_land_detected_s _land_detected
virtual bool _get_freefall_state()
bool copy(void *dst)
Copy the struct.
systemlib::Hysteresis _landed_hysteresis
void perf_begin(perf_counter_t handle)
Begin a performance event.
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
void start()
Get the work queue going.