Mission feasibility: Geofence check fix

Current implementation checks against geofence only if it is in polygon form.
When it's created via params, it accepts all the waypoints as the number of vertices = 0.
Thus, changed the function to the one that is used to check whether geofence is breached in flight.
This commit is contained in:
Michal Stasiak
2016-10-21 13:33:31 +02:00
committed by Lorenz Meier
parent bf9a1c5a18
commit 2bfac7ff4f
4 changed files with 18 additions and 6 deletions
+5
View File
@@ -126,6 +126,11 @@ bool Geofence::inside(const struct vehicle_global_position_s &global_position,
}
}
bool Geofence::inside(const struct mission_item_s &mission_item)
{
return inside(mission_item.lat, mission_item.lon, mission_item.altitude);
}
bool Geofence::inside(double lat, double lon, float altitude)
{
float max_horizontal_distance = _param_max_hor_distance.get();