mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_Beacon: do not include fence closing/duplicate point in polygon boundary
This commit is contained in:
parent
de9fa4c730
commit
da81c5fe39
@ -295,8 +295,10 @@ void AP_Beacon::update_boundary_points()
|
|||||||
}
|
}
|
||||||
// if duplicate is found, remove all boundary points before the duplicate because they are inner points
|
// if duplicate is found, remove all boundary points before the duplicate because they are inner points
|
||||||
if (dup_found) {
|
if (dup_found) {
|
||||||
uint8_t num_pts = curr_boundary_idx - dup_idx + 1;
|
// note that the closing/duplicate point is not
|
||||||
if (num_pts > AP_BEACON_MINIMUM_FENCE_BEACONS) {
|
// included in the boundary points.
|
||||||
|
const uint8_t num_pts = curr_boundary_idx - dup_idx;
|
||||||
|
if (num_pts >= AP_BEACON_MINIMUM_FENCE_BEACONS) { // we consider three points to be a polygon
|
||||||
// success, copy boundary points to boundary array and convert meters to cm
|
// success, copy boundary points to boundary array and convert meters to cm
|
||||||
for (uint8_t j = 0; j < num_pts; j++) {
|
for (uint8_t j = 0; j < num_pts; j++) {
|
||||||
boundary[j] = boundary_points[j+dup_idx] * 100.0f;
|
boundary[j] = boundary_points[j+dup_idx] * 100.0f;
|
||||||
|
Loading…
Reference in New Issue
Block a user