mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
FW land detector: expose trigger time in parameter (LNDFW_TRIG_TIME)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -47,7 +47,7 @@ namespace land_detector
|
|||||||
FixedwingLandDetector::FixedwingLandDetector()
|
FixedwingLandDetector::FixedwingLandDetector()
|
||||||
{
|
{
|
||||||
// Use Trigger time when transitioning from in-air (false) to landed (true) / ground contact (true).
|
// Use Trigger time when transitioning from in-air (false) to landed (true) / ground contact (true).
|
||||||
_landed_hysteresis.set_hysteresis_time_from(false, LANDED_TRIGGER_TIME_US);
|
_landed_hysteresis.set_hysteresis_time_from(false, _param_lndfw_trig_time.get() * 1_s);
|
||||||
_landed_hysteresis.set_hysteresis_time_from(true, FLYING_TRIGGER_TIME_US);
|
_landed_hysteresis.set_hysteresis_time_from(true, FLYING_TRIGGER_TIME_US);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** Time in us that landing conditions have to hold before triggering a land. */
|
|
||||||
static constexpr hrt_abstime LANDED_TRIGGER_TIME_US = 2_s;
|
|
||||||
static constexpr hrt_abstime FLYING_TRIGGER_TIME_US = 0_us;
|
static constexpr hrt_abstime FLYING_TRIGGER_TIME_US = 0_us;
|
||||||
|
|
||||||
uORB::Subscription _airspeed_validated_sub{ORB_ID(airspeed_validated)};
|
uORB::Subscription _airspeed_validated_sub{ORB_ID(airspeed_validated)};
|
||||||
@@ -81,7 +79,8 @@ private:
|
|||||||
(ParamFloat<px4::params::LNDFW_XYACC_MAX>) _param_lndfw_xyaccel_max,
|
(ParamFloat<px4::params::LNDFW_XYACC_MAX>) _param_lndfw_xyaccel_max,
|
||||||
(ParamFloat<px4::params::LNDFW_AIRSPD_MAX>) _param_lndfw_airspd,
|
(ParamFloat<px4::params::LNDFW_AIRSPD_MAX>) _param_lndfw_airspd,
|
||||||
(ParamFloat<px4::params::LNDFW_VEL_XY_MAX>) _param_lndfw_vel_xy_max,
|
(ParamFloat<px4::params::LNDFW_VEL_XY_MAX>) _param_lndfw_vel_xy_max,
|
||||||
(ParamFloat<px4::params::LNDFW_VEL_Z_MAX>) _param_lndfw_vel_z_max
|
(ParamFloat<px4::params::LNDFW_VEL_Z_MAX>) _param_lndfw_vel_z_max,
|
||||||
|
(ParamFloat<px4::params::LNDFW_TRIG_TIME>) _param_lndfw_trig_time
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -88,3 +88,17 @@ PARAM_DEFINE_FLOAT(LNDFW_XYACC_MAX, 8.0f);
|
|||||||
* @group Land Detector
|
* @group Land Detector
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(LNDFW_AIRSPD_MAX, 6.00f);
|
PARAM_DEFINE_FLOAT(LNDFW_AIRSPD_MAX, 6.00f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fixed-wing land detection trigger time
|
||||||
|
*
|
||||||
|
* Time the land conditions (speeds and acceleration) have to be satisfied to detect a landing.
|
||||||
|
*
|
||||||
|
* @unit s
|
||||||
|
* @min 0.1
|
||||||
|
* @decimal 1
|
||||||
|
*
|
||||||
|
* @reboot_required true
|
||||||
|
* @group Land Detector
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(LNDFW_TRIG_TIME, 2.f);
|
||||||
|
|||||||
Reference in New Issue
Block a user