UnknownFreeOccupied / ufomap

UFOMap: An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
https://unknownfreeoccupied.github.io/
BSD 2-Clause "Simplified" License
255 stars 46 forks source link

Segmentation fault in nearest neighbour search #7

Open dringakn opened 3 years ago

dringakn commented 3 years ago

I have been trying the following sample test code, however, it appears that there is some error in the nearest neighbor search implementation.

include <ufo/map/occupancy_map.h>

include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[]) { ufo::map::OccupancyMap map(0.25, 16); map.updateOccupancy(1, 1, 1, 1); map.updateOccupancy(1, 1, -1, 1); for (auto it = map.beginNNLeaves(ufo::map::Point3(1, 1, 1), true, true, true, false, 0); it != map.endNNLeaves(); ++it) { } return 0; }

dringakn commented 2 years ago

is there any update on the issue?

dringakn commented 2 years ago

The problem seems when validNode(...) calls following funciton:

bool containsUnknown(INNER_NODE const& node) const { return static_cast<INNER_NODE const&>(node).contains_unknown; }

bool containsFree(INNER_NODE const& node) const
{
    return static_cast<INNER_NODE const&>(node).contains_free;
}

why the inner_node is invalid?