FW land detector: expose trigger time in parameter (LNDFW_TRIG_TIME)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2022-11-03 16:23:28 +01:00
parent 71835f57c9
commit 5161165d85
3 changed files with 17 additions and 4 deletions

View File

@ -47,7 +47,7 @@ namespace land_detector
FixedwingLandDetector::FixedwingLandDetector()
{
// 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);
}

View File

@ -65,8 +65,6 @@ protected:
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;
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_AIRSPD_MAX>) _param_lndfw_airspd,
(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
);
};

View File

@ -88,3 +88,17 @@ PARAM_DEFINE_FLOAT(LNDFW_XYACC_MAX, 8.0f);
* @group Land Detector
*/
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);