Skip to content

Commit 921dc67

Browse files
committed
FW land detector: only use LNDFW_ROT_MAX if speeds are not valid
The rotational speed threshold on fixed-wing vehicles is triggering easily if the plane is lifted prior to takeoff (hand-launch), and can cause issues for the auto takeoff state machine. Thus if either airspeed or groundspeed is valid, it's better to rely on these for land detection, and only use the rotational speed if they're invalid. Signed-off-by: Silvan <silvan@auterion.com>
1 parent fa3f255 commit 921dc67

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/modules/land_detector/FixedwingLandDetector.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ bool FixedwingLandDetector::_get_landed_state()
121121
const float vel_xy_max_threshold = airspeed_invalid ? 0.7f * _param_lndfw_vel_xy_max.get() :
122122
_param_lndfw_vel_xy_max.get();
123123

124-
const float max_rotation_threshold = math::radians(_param_lndfw_rot_max.get()) ;
124+
// only use the max rotational threshold if neither airspeed nor groundspeed can be used for landing detection
125+
const float max_rotation_threshold = (!_vehicle_local_position.v_xy_valid
126+
&& airspeed_invalid) ? math::radians(_param_lndfw_rot_max.get()) : INFINITY;
125127

126128
// Crude land detector for fixedwing.
127129
landDetected = _airspeed_filtered < _param_lndfw_airspd.get()

src/modules/land_detector/land_detector_params_fw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ PARAM_DEFINE_FLOAT(LNDFW_TRIG_TIME, 2.f);
107107
* Fixed-wing land detector: max rotational speed
108108
*
109109
* Maximum allowed norm of the angular velocity in the landed state.
110+
* Only used if neither airspeed nor groundspeed can be used for landing detection.
110111
*
111112
* @unit deg/s
112113
* @decimal 1

0 commit comments

Comments
 (0)