mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 21:43:33 +08:00
geofence: disable altitude check if not configured
It currently cannot be configured via mavlink mission protocol.
This commit is contained in:
@@ -260,8 +260,10 @@ bool Geofence::checkPolygons(double lat, double lon, float altitude)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Vertical check */
|
/* Vertical check */
|
||||||
if (altitude > _altitude_max || altitude < _altitude_min) {
|
if (_altitude_max > _altitude_min) { // only enable vertical check if configured properly
|
||||||
return false;
|
if (altitude > _altitude_max || altitude < _altitude_min) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Horizontal check: iterate all polygons */
|
/* Horizontal check: iterate all polygons */
|
||||||
|
|||||||
Reference in New Issue
Block a user