mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +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:
committed by
Silvan Fuhrer
parent
2625c5211b
commit
18b4b18a75
@@ -71,9 +71,13 @@ bool FixedwingLandDetector::_get_landed_state()
|
|||||||
|
|
||||||
} else if (hrt_elapsed_time(&_vehicle_local_position.timestamp) < 1_s) {
|
} else if (hrt_elapsed_time(&_vehicle_local_position.timestamp) < 1_s) {
|
||||||
|
|
||||||
// Horizontal velocity complimentary filter.
|
float val = 0.0f;
|
||||||
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);
|
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)) {
|
if (PX4_ISFINITE(val)) {
|
||||||
_velocity_xy_filtered = val;
|
_velocity_xy_filtered = val;
|
||||||
|
|||||||
Reference in New Issue
Block a user