diff --git a/src/modules/land_detector/FixedwingLandDetector.cpp b/src/modules/land_detector/FixedwingLandDetector.cpp index 16e5d33fb9..e27a4c592c 100644 --- a/src/modules/land_detector/FixedwingLandDetector.cpp +++ b/src/modules/land_detector/FixedwingLandDetector.cpp @@ -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); } diff --git a/src/modules/land_detector/FixedwingLandDetector.h b/src/modules/land_detector/FixedwingLandDetector.h index b8ca63a0af..9c5fd865b5 100644 --- a/src/modules/land_detector/FixedwingLandDetector.h +++ b/src/modules/land_detector/FixedwingLandDetector.h @@ -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) _param_lndfw_xyaccel_max, (ParamFloat) _param_lndfw_airspd, (ParamFloat) _param_lndfw_vel_xy_max, - (ParamFloat) _param_lndfw_vel_z_max + (ParamFloat) _param_lndfw_vel_z_max, + (ParamFloat) _param_lndfw_trig_time ); }; diff --git a/src/modules/land_detector/land_detector_params_fw.c b/src/modules/land_detector/land_detector_params_fw.c index ba889693b1..02ab459032 100644 --- a/src/modules/land_detector/land_detector_params_fw.c +++ b/src/modules/land_detector/land_detector_params_fw.c @@ -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);