mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 03:33:33 +08:00
Land detector: Protect fixed wing logic from false-positives due to bad input data
This commit is contained in:
@@ -85,9 +85,16 @@ bool FixedwingLandDetector::update()
|
|||||||
bool landDetected = false;
|
bool landDetected = false;
|
||||||
|
|
||||||
if (hrt_elapsed_time(&_vehicleLocalPosition.timestamp) < 500 * 1000) {
|
if (hrt_elapsed_time(&_vehicleLocalPosition.timestamp) < 500 * 1000) {
|
||||||
_velocity_xy_filtered = 0.95f * _velocity_xy_filtered + 0.05f * sqrtf(_vehicleLocalPosition.vx *
|
float val = 0.95f * _velocity_xy_filtered + 0.05f * sqrtf(_vehicleLocalPosition.vx *
|
||||||
_vehicleLocalPosition.vx + _vehicleLocalPosition.vy * _vehicleLocalPosition.vy);
|
_vehicleLocalPosition.vx + _vehicleLocalPosition.vy * _vehicleLocalPosition.vy);
|
||||||
_velocity_z_filtered = 0.95f * _velocity_z_filtered + 0.05f * fabsf(_vehicleLocalPosition.vz);
|
if (isfinite(val)) {
|
||||||
|
_velocity_xy_filtered = val;
|
||||||
|
}
|
||||||
|
val = 0.95f * _velocity_z_filtered + 0.05f * fabsf(_vehicleLocalPosition.vz);
|
||||||
|
|
||||||
|
if (isfinite(val)) {
|
||||||
|
_velocity_z_filtered = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hrt_elapsed_time(&_airspeed.timestamp) < 500 * 1000) {
|
if (hrt_elapsed_time(&_airspeed.timestamp) < 500 * 1000) {
|
||||||
|
|||||||
Reference in New Issue
Block a user