Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about data structure for /cloud_map and /octomap_occupied_space #1258

Open
GilMe opened this issue Dec 17, 2024 · 1 comment
Open

Comments

@GilMe
Copy link

GilMe commented Dec 17, 2024

Hello,
I am subscribing to the output of the PointCloud2 topics /cloud_map and /octomap_occupied_space. When receiving a new message I want to compare it to the old version I have and find the new points that were added (in case there is no loop closure and the whole map changes).
The PointCloud2 messages that I am getting have an is_dense (bool) value of true so that means that the point cloud in the data field (uint8[]) is unstructured.
I presumed that the new points were appended to the end of the array but checks revealed that this was not the case. I was curious if the points are stored in a specific data structure (such as a tree) that I could leverage to efficiently extract the most recent points.

Thank you.

@matlabbe
Copy link
Member

For cloud_map, the new points are appended to previous assembled point cloud, then a voxel filter is applied. The voxel filter may not keep the points ordered. On loop closure, the whole point cloud is re-assembled and voxel filter applied again, some old points may disappear or would be "merged" together with the new points. Another thing is that cloud_map is the result of cloud_obstacles + cloud_ground, which both expand when a new node is added. I would suggest to subscribe to cloud_obstacles and cloud_ground directly, then if you disable the voxel filter (cloud_output_voxelized:=false), you may see only the new points appended at the end.

For octomap_occupied_space, it is an exported point cloud from the current occupied cells in the OctoMap. If you want a structured format, you can subscribe to /octomap_full or /octomap_binary topics (Octree format), though I am not sure you could know efficiently which cells switched between occupied and empty (in particular if ray tracing is enabled).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants