mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:28:53 +08:00
land_detector add missing header and init all vtol fields (#7754)
This commit is contained in:
@@ -46,14 +46,7 @@
|
||||
namespace land_detector
|
||||
{
|
||||
|
||||
VtolLandDetector::VtolLandDetector() :
|
||||
_paramHandle(),
|
||||
_params(),
|
||||
_airspeedSub(-1),
|
||||
_vehicle_status_sub(-1),
|
||||
_airspeed{},
|
||||
_was_in_air(false),
|
||||
_airspeed_filtered(0)
|
||||
VtolLandDetector::VtolLandDetector()
|
||||
{
|
||||
_paramHandle.maxAirSpeed = param_find("LNDFW_AIRSPD_MAX");
|
||||
}
|
||||
@@ -76,7 +69,6 @@ void VtolLandDetector::_update_topics()
|
||||
|
||||
bool VtolLandDetector::_get_maybe_landed_state()
|
||||
{
|
||||
|
||||
// Only trigger in RW mode
|
||||
if (!_vehicle_status.is_rotary_wing) {
|
||||
return false;
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <uORB/topics/airspeed.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
|
||||
#include "MulticopterLandDetector.h"
|
||||
|
||||
@@ -60,24 +61,23 @@ protected:
|
||||
bool _get_landed_state() override;
|
||||
bool _get_maybe_landed_state() override;
|
||||
|
||||
|
||||
private:
|
||||
struct {
|
||||
param_t maxAirSpeed;
|
||||
} _paramHandle;
|
||||
} _paramHandle{};
|
||||
|
||||
struct {
|
||||
float maxAirSpeed;
|
||||
} _params;
|
||||
} _params{};
|
||||
|
||||
int _airspeedSub;
|
||||
int _vehicle_status_sub;
|
||||
int _airspeedSub{-1};
|
||||
int _vehicle_status_sub{-1};
|
||||
|
||||
struct airspeed_s _airspeed;
|
||||
struct vehicle_status_s _vehicle_status;
|
||||
airspeed_s _airspeed{};
|
||||
vehicle_status_s _vehicle_status{};
|
||||
|
||||
bool _was_in_air; /**< indicates whether the vehicle was in the air in the previous iteration */
|
||||
float _airspeed_filtered; /**< low pass filtered airspeed */
|
||||
bool _was_in_air{false}; /**< indicates whether the vehicle was in the air in the previous iteration */
|
||||
float _airspeed_filtered{0.0f}; /**< low pass filtered airspeed */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user