mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-08 02:17:07 +08:00
geofence fix combined simple and polygon logic
- require being inside both fences, not either
This commit is contained in:
committed by
Lorenz Meier
parent
bce7ecb0f6
commit
17990cf5dc
@@ -168,7 +168,9 @@ bool Geofence::inside(double lat, double lon, float altitude)
|
||||
}
|
||||
}
|
||||
|
||||
inside_fence |= inside_polygon(lat, lon, altitude);
|
||||
// to be inside the geofence both fences have to report being inside
|
||||
// as they both report being inside when not enabled
|
||||
inside_fence = inside_fence && inside_polygon(lat, lon, altitude);
|
||||
|
||||
if (inside_fence) {
|
||||
_outside_counter = 0;
|
||||
|
||||
Reference in New Issue
Block a user