ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Storing PointCloud2 type msgs in an octomap

asked 2014-03-07 04:52:56 -0600

rosAS gravatar image

Hello everyone,

I am receiving a pointCloud2 type messages by subscribing to a topic, in my code. Now I need to build an octomap from this. I am currently using Groovy and Octomap libraries for ROS Groovy.

I have gone through the documentation of octomap, but couldn't retrieve much from that. The function octomap::insertPointCloud() is somewhat close to my requirement.


Is there a way to create an octomap using this API for the callback being received ? And can I eventually write an octomap-file to the disk using some function ?


I have gone through few threads like this also but not able to get a concrete idea. http:// answers.ros.org/question/89906/how-to-generate-an-octomap-from-a-point-cloud-with-hydro/

I'd be grateful if someone can point me to an example code for the same or the order we need to follow to achieve this ?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-10 23:03:49 -0600

AHornung gravatar image

If you want a node that does the mapping for you, have a look at octomap_server. It takes point clouds with tf and builds an octomap for you that you can request e.g. with the octomap_saver node. You can also use the API in your own code.

If you want to keep it simple and just use the OctoMap API in your code then you're right, insertPointCloud() is the correct function. You only need to convert the point clouds into the OctoMap native type by using conversions.h in the package octomap_ros.

With all this, just keep in mind that you're not actually storing the PointCloud2 in octomap, but integrate the information into the occupancy map. The actual point cloud data is discarded afterwards.

edit flag offensive delete link more

Comments

Thanks your response @AHornung, now I am using the octomap_server: I copied the "octomap_mapping.launch" file in my workspace and changed the "dataSource" How to proceed with this kind of arrangement so that I can listen to pointcloud2 ? ("rosrun octomap_server ...") ??

rosAS gravatar image rosAS  ( 2014-03-12 05:33:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-03-07 04:52:56 -0600

Seen: 1,831 times

Last updated: Mar 10 '14