mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
FW land detector: do not check for groundspeed if invalid.
In case the local position speed estimate is not valid, it is assumed to be 0m/s and thus check always passes.
This commit is contained in:
parent
2625c5211b
commit
18b4b18a75
@ -71,9 +71,13 @@ bool FixedwingLandDetector::_get_landed_state()
|
||||
|
||||
} else if (hrt_elapsed_time(&_vehicle_local_position.timestamp) < 1_s) {
|
||||
|
||||
// Horizontal velocity complimentary filter.
|
||||
float val = 0.97f * _velocity_xy_filtered + 0.03f * sqrtf(_vehicle_local_position.vx * _vehicle_local_position.vx +
|
||||
_vehicle_local_position.vy * _vehicle_local_position.vy);
|
||||
float val = 0.0f;
|
||||
|
||||
if (_vehicle_local_position.v_xy_valid) {
|
||||
// Horizontal velocity complimentary filter.
|
||||
val = 0.97f * _velocity_xy_filtered + 0.03f * sqrtf(_vehicle_local_position.vx * _vehicle_local_position.vx +
|
||||
_vehicle_local_position.vy * _vehicle_local_position.vy);
|
||||
}
|
||||
|
||||
if (PX4_ISFINITE(val)) {
|
||||
_velocity_xy_filtered = val;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user