mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
AC_Fence: fixed fence count for old upload
when uploading a fence that is smaller than an old fence we were not correctly setting the inclusion fence size.
This commit is contained in:
parent
0a8bd53f5e
commit
50c14e62cf
@ -1535,11 +1535,18 @@ void AC_PolyFence_loader::handle_msg_fence_point(GCS_MAVLINK &link, const mavlin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (packet.idx == _total-1) {
|
} else if (packet.idx == _total-1) {
|
||||||
// this is the fence closing point; don't store it, and don't
|
/* this is the fence closing point. We use this to set the vertex
|
||||||
// check it against the first point in the fence as we may be
|
count of the inclusion fence
|
||||||
// receiving the fence points out of order. Note that if the
|
*/
|
||||||
// GCS attempts to read this back before sending the first
|
const FenceIndex *inclusion_fence = get_or_create_include_fence();
|
||||||
// point they will get 0s.
|
if (inclusion_fence == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// write type and length
|
||||||
|
fence_storage.write_uint8(inclusion_fence->storage_offset, uint8_t(AC_PolyFenceType::POLYGON_INCLUSION));
|
||||||
|
fence_storage.write_uint8(inclusion_fence->storage_offset+1, packet.idx-1);
|
||||||
|
// and write end of storage marker
|
||||||
|
fence_storage.write_uint8(inclusion_fence->storage_offset+2+(packet.idx-1)*8, uint8_t(AC_PolyFenceType::END_OF_STORAGE));
|
||||||
} else {
|
} else {
|
||||||
const FenceIndex *inclusion_fence = get_or_create_include_fence();
|
const FenceIndex *inclusion_fence = get_or_create_include_fence();
|
||||||
if (inclusion_fence == nullptr) {
|
if (inclusion_fence == nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user