forked from Archive/PX4-Autopilot
geofence fix combined simple and polygon logic
- require being inside both fences, not either
This commit is contained in:
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;
|
||||
|
|
Loading…
Reference in New Issue