How to find intersection of two octrees?

255 views
Skip to first unread message

Aaron O'Toole <airuno2L@gmail.com>

unread,
Apr 17, 2015, 12:49:56 PM4/17/15
to oct...@googlegroups.com
The title pretty much says it all. I'm maintaining two separate but collocated octrees and I want a function that returns an octree containing all the nodes that are occupied in both of the input octrees. Does anything like that already exist?
 
Thanks,
Aaron

Armin Hornung

unread,
Apr 20, 2015, 12:26:56 PM4/20/15
to oct...@googlegroups.com
Hi Aaron,

I'm not aware of that functionality, but almost all parts of it already exist. The trees have to have the same origin and resolution. Then you could build a hash map of the first tree node keys and check the second against it (similar to the point cloud insertion function). You will have to expand occupied leaf nodes that are not at max depth to account for the tree compression.

Cheers,
Armin

Quentin Dupont

unread,
May 30, 2016, 10:52:22 PM5/30/16
to OctoMap developers and users discussion
Hi Aaron, 

Have you ever managed to implement your intersection tool? I would be keen on using this kind of tool. 

Thanks in advance,
Quentin

Hemang Chawla

unread,
Jul 5, 2017, 5:09:23 AM7/5/17
to OctoMap developers and users discussion
Hey Aaron,

Were you able to implement this intersection of octrees? It would be very nice if you could please share the details.

Thank,
Hemang

Federico Ferri

unread,
Jul 5, 2017, 6:57:56 AM7/5/17
to oct...@googlegroups.com
While a solution working entirely with octomap still does not exist, you can do:
 - use the octomap to pointcloud tool I wrote [1] to extract centers of occupied voxels at maximum depth.
 - use a pcl intersection tool (such as my [2]) to compute intersection.
 - put the result back into an octree, and optimize (i.e. when a node has 8 occupied children)

[2]: https://github.com/fferri/pcl-boolean-op
cheers,
Federico Ferri
--
You received this message because you are subscribed to the Google Groups "OctoMap developers and users discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to octomap+u...@googlegroups.com.
To post to this group, send email to oct...@googlegroups.com.
Visit this group at https://groups.google.com/group/octomap.
For more options, visit https://groups.google.com/d/optout.

Hemang Chawla

unread,
Jul 6, 2017, 8:53:45 AM7/6/17
to OctoMap developers and users discussion
Thanks a lot Fedrico! I will look into this.

Interesting boolean tool for pcl!
Could you please tell what does your "pcl_remove_dynamic_obstacles.cpp" does?

Hemang Chawla

unread,
Jul 6, 2017, 8:54:52 AM7/6/17
to OctoMap developers and users discussion
Thanks a lot Federico! I will look into this.

Interesting boolean tool for pcl!
Could you please tell what your "pcl_remove_dynamic_obstacles.
cpp" does?


On Wednesday, 5 July 2017 12:57:56 UTC+2, Federico Ferri wrote:

Eugene Rush

unread,
Feb 15, 2019, 8:18:51 PM2/15/19
to OctoMap developers and users discussion
Hi Federico,

Did you have any success with this method? I am embarking on a similar task (updating local map with map updates from other remote robots). I may potentially union or average the two maps. I would like to find the most computationally efficient, but more importantly data package efficient method, and am opening the question to anyone on this thread. I am concerned about data package size due to being in a constrained communication environment.

I understand that transmitting and receiving a point cloud message between two robots is more difficult than sending the serialized OctoMap messages. I am wondering if sending the serialized OctoMap message from the remote machine and then deserializing it on the local machine would be best to reduce data package size.

I believe these functionalities exist and can be leveraged in the octomap_msgs conversion.h file.

I appreciate any and all feedback!

Thanks,

Gene
Reply all
Reply to author
Forward
0 new messages