mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 04:03:33 +08:00
Geofence: rework the way to check all GF at once
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
a41f24a2e2
commit
3c194d552a
@@ -1469,8 +1469,8 @@ bool Navigator::geofence_allows_position(const vehicle_global_position_s &pos)
|
||||
if ((_geofence.getGeofenceAction() != geofence_result_s::GF_ACTION_NONE) &&
|
||||
(_geofence.getGeofenceAction() != geofence_result_s::GF_ACTION_WARN)) {
|
||||
|
||||
if (PX4_ISFINITE(pos.lat) && PX4_ISFINITE(pos.lon)) {
|
||||
return _geofence.check(pos, _gps_pos);
|
||||
if (PX4_ISFINITE(pos.lat) && PX4_ISFINITE(pos.lon) && PX4_ISFINITE(pos.alt)) {
|
||||
return _geofence.checkPointAgainstAllGeofences(pos.lat, pos.lon, pos.alt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user