Closed boxanm closed 9 months ago
@boxanm Could you please confirm that this is the same issue as #454?
The bug I described shouldn't make random parts of the cloud disappear. Instead, the bug causes incorrect sampling inside individual cells. So points, that should be sampled are preserved and the output contains more points, than the number of cells in the octree. Therefore I don't think #454 is related.
I accidentally noticed this bug when unit testing an NDT-inspired octree sampling method. The current octree sampling implementation takes into account the situation when the indexed point was already processed; see this example:
However, we don't know whether
mapidx[d]
doesn't again point to an index that was also processed. What actually needs to be done, is to propagate all the changes that were made on all previously used indexes ofmapidx
. So in this PR, I replaced the above code example and similar byI haven't had time to check other Octree implementations and see how they deal with this situation. Naturally, the use of the while cycle slows down the execution. There's probably a more clever solution using pointers?