Closed MatthiasNieuwenhuisen closed 6 years ago
Thanks, and good catch! That file looks like a really a useful test for many cases.
Would you mind submitting a fix as pull request?
I think the pull request solves this issue. Due to the lack of an easy method to get all neighboring voxels in a pruned OctoMap, I might have missed some corner cases, but it works with all my test cases including rendering the tree until a user specified depth.
Hi,
the RViz plugin iterates over the neighboring keys of a node to determine if it is visible or not:
https://github.com/OctoMap/octomap_rviz_plugins/blob/0a80d0c6ac513836ba543346ba3776b708a0ecc5/src/occupancy_grid_display.cpp#L534
This does not work on other levels than the leaves of the octree, as keys to not consider the octree depth. Consequently, nodes on the lowest level are rendered, but inner nodes are not rendered correctly if visualizing a pruned octree.
If I change https://github.com/OctoMap/octomap_rviz_plugins/blob/0a80d0c6ac513836ba543346ba3776b708a0ecc5/src/occupancy_grid_display.cpp#L523
to be always true (nodes are rendered regardless of their visibility) then I get the expected behavior:
I publish this octree: clusters.bt.gz
with
rosrun octomap_server octomap_server_node clusters.bt
.Best, Matthias