forked from Archive/PX4-Autopilot
geofence: disable altitude check if not configured
It currently cannot be configured via mavlink mission protocol.
This commit is contained in:
parent
2981ece921
commit
4c1328483d
|
@ -260,8 +260,10 @@ bool Geofence::checkPolygons(double lat, double lon, float altitude)
|
|||
}
|
||||
|
||||
/* Vertical check */
|
||||
if (altitude > _altitude_max || altitude < _altitude_min) {
|
||||
return false;
|
||||
if (_altitude_max > _altitude_min) { // only enable vertical check if configured properly
|
||||
if (altitude > _altitude_max || altitude < _altitude_min) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Horizontal check: iterate all polygons */
|
||||
|
|
Loading…
Reference in New Issue