mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 03:23:35 +08:00
navigator geofence: switch to new dataman data structure, support multiple polygons
This also removes the 'navigator fence <lon> <lat>' command to simplify code (I don't think there's still use for that anymore). However the file loading is still supported. If goefence.txt does not exist, navigator will not clear the geofence anymore on startup.
This commit is contained in:
@@ -188,7 +188,8 @@ MissionFeasibilityChecker::checkGeofence(dm_item_t dm_current, size_t nMissionIt
|
||||
// Geofence function checks against home altitude amsl
|
||||
missionitem.altitude = missionitem.altitude_is_relative ? missionitem.altitude + home_alt : missionitem.altitude;
|
||||
|
||||
if (MissionBlock::item_contains_position(&missionitem) && !geofence.inside(missionitem)) {
|
||||
if (MissionBlock::item_contains_position(&missionitem) &&
|
||||
!geofence.check(missionitem)) {
|
||||
|
||||
mavlink_log_critical(_navigator->get_mavlink_log_pub(), "Geofence violation for waypoint %d", i + 1);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user