ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How can I create an octree from a point cloud without raytracing?

asked 2021-01-04 06:18:01 -0500

JohnStechschulte gravatar image

updated 2021-01-04 10:05:39 -0500

I have a point cloud generated from the registration of several RGB-D observations. I'd like to create an octree of just occupancy data from it (specifically, an octomap::OcTree object), to pass to MoveIt for collision avoidance. I want to skip doing any raytracing, and just put occupied voxels where the points occur--besides being faster, there's no single viewpoint to cast rays from, since the cloud comprises several observations. Is there a function for this in the Octomap API?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2021-08-20 03:54:47 -0500

askquestion gravatar image

Hello did you find your answer? I just have same question as yours And I wonder if you figured out??

edit flag offensive delete link more

answered 2021-01-04 10:02:13 -0500

Airuno2L gravatar image

Does the insertPointCloud function do what you need?

edit flag offensive delete link more


I don't think so. The documentation implies that it does raytrace.

JohnStechschulte gravatar image JohnStechschulte  ( 2021-01-04 10:04:52 -0500 )edit

answered 2021-01-04 13:57:06 -0500

updated 2021-01-04 13:59:23 -0500

Havn't used the octomap api before, but PCL has an octree implementation. Take a look at the general api and occupancy api.

edit flag offensive delete link more


Yup, I'm familiar with PCL. Since MoveIt takes an octomap::OcTree as input, what I'd really like is the PCL setOccupiedVoxelsAtPointsFromCloud function on an octomap::OcTree object. I might have to settle for building a PCL octree and then iterating over its leaves and inserting them with updateNode.

JohnStechschulte gravatar image JohnStechschulte  ( 2021-01-04 14:20:39 -0500 )edit
Akhil Kurup gravatar image Akhil Kurup  ( 2021-01-04 14:23:36 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-01-04 06:18:01 -0500

Seen: 431 times

Last updated: Jan 04 '21