diff --git a/src/modules/land_detector/FixedwingLandDetector.cpp b/src/modules/land_detector/FixedwingLandDetector.cpp index 4ed4a353ab..db077d6504 100644 --- a/src/modules/land_detector/FixedwingLandDetector.cpp +++ b/src/modules/land_detector/FixedwingLandDetector.cpp @@ -121,7 +121,9 @@ bool FixedwingLandDetector::_get_landed_state() const float vel_xy_max_threshold = airspeed_invalid ? 0.7f * _param_lndfw_vel_xy_max.get() : _param_lndfw_vel_xy_max.get(); - const float max_rotation_threshold = math::radians(_param_lndfw_rot_max.get()) ; + // only use the max rotational threshold if neither airspeed nor groundspeed can be used for landing detection + const float max_rotation_threshold = (!_vehicle_local_position.v_xy_valid + && airspeed_invalid) ? math::radians(_param_lndfw_rot_max.get()) : INFINITY; // Crude land detector for fixedwing. landDetected = _airspeed_filtered < _param_lndfw_airspd.get() diff --git a/src/modules/land_detector/land_detector_params_fw.c b/src/modules/land_detector/land_detector_params_fw.c index 6ab78fb867..11eaac239c 100644 --- a/src/modules/land_detector/land_detector_params_fw.c +++ b/src/modules/land_detector/land_detector_params_fw.c @@ -107,6 +107,7 @@ PARAM_DEFINE_FLOAT(LNDFW_TRIG_TIME, 2.f); * Fixed-wing land detector: max rotational speed * * Maximum allowed norm of the angular velocity in the landed state. + * Only used if neither airspeed nor groundspeed can be used for landing detection. * * @unit deg/s * @decimal 1