mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 02:03:33 +08:00
geofence: remove fence & fence_vertex messages
- this was never read - it was implemented wrong, leading to memory access violations in publishFence (an integer was passed instead of the fence_s struct)
This commit is contained in:
@@ -237,7 +237,6 @@ Geofence::addPoint(int argc, char *argv[])
|
||||
|
||||
if ((argc == 1) && (strcmp("-clear", argv[0]) == 0)) {
|
||||
dm_clear(DM_KEY_FENCE_POINTS);
|
||||
publishFence(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,7 +264,6 @@ Geofence::addPoint(int argc, char *argv[])
|
||||
|
||||
if (dm_write(DM_KEY_FENCE_POINTS, ix, DM_PERSIST_POWER_ON_RESET, &vertex, sizeof(vertex)) == sizeof(vertex)) {
|
||||
if (last) {
|
||||
publishFence((unsigned)ix + 1);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -274,16 +272,6 @@ Geofence::addPoint(int argc, char *argv[])
|
||||
PX4_WARN("can't store fence point");
|
||||
}
|
||||
|
||||
void
|
||||
Geofence::publishFence(unsigned vertices)
|
||||
{
|
||||
if (_fence_pub == nullptr) {
|
||||
_fence_pub = orb_advertise(ORB_ID(fence), &vertices);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(fence), _fence_pub, &vertices);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
Geofence::loadFromFile(const char *filename)
|
||||
|
||||
Reference in New Issue
Block a user