Ask Your Question


asked 2011-12-07 18:15:46 -0500

acp gravatar image

Hi everybody

I have a [XYZ] point-cloud coordinates from a laser in ROS, I can actually visualize the map over rviz. However, I would like to visualized it over octomap in vriz, is that possible? do you have a small function I can get inspired?

I was told that I can do it with octomap_server, however I have no clue how to do it, dont you have a general steps how it can be implemented or even better some code I can get :)

Any help will be really appreciate it


edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted

answered 2011-12-07 22:24:39 -0500

AHornung gravatar image

If you want to visualize an existing OctoMap file (.bt or .ot) just load it with "octomap_server". You can then visualize the occupied voxels in RViz by adding a MarkerArray display and selecting the topic "occupied_cells_vis". The default frame is "map". However, as Felix mentioned, visualizing the file in "octovis" looks nicer and is more efficient.

If you want to accumulate laser scans "live", have a look at the commented launch file of octomap_server. You need to remap the "cloud_in" topic to your scan topic.

For API access to insert pointclouds, look at the code in octomap_ros.

edit flag offensive delete link more


Well, in advance thank you for your replay. I have a "sensor_msgs::PointCloud cl". I have installed octomap_mapping over svn. I would like the following: 1.-How can I test octomap in ROS?. 2.- I dont have any map .bt or .ot., how can I generate this kind of maps in ROS 3.- I want to visualize the PointCloud cl almost in real time in rviz. Thank you.
acp gravatar imageacp ( 2011-12-08 01:01:20 -0500 )edit
Please update your original question with the more detailed info, it's hard to answer here and get what you actually want to achieve. 1: Just like octomap without ros, see 2: see answer of Felix 3: you don't need OctoMap to visualize pointclouds, just add a PointCloud2 display
AHornung gravatar imageAHornung ( 2011-12-08 22:02:24 -0500 )edit
Well, sorry for not making myself clear enough. I have a node that broadcast a transformation from my /laser to base_link. And, I have another node that listen the laser /scan topic and then I apply transformLaserScanToPointCloud("/bl", *scan, cl, tfListener_); At this moment I can visualize Poincloud/cl in rviz. what I really want is the following. 1.- I want to fused the [cl.points[i].x, cl.points[i].y, cl.points[i].z] using octomap-ROS to make and entire map of the environment. But I would like to visualize that process in vriz, I mean I would like to see the occupied voxels of the map while iam constructing the map. I hope this time is more clear and in advance thank you for any help.
acp gravatar imageacp ( 2011-12-09 00:01:46 -0500 )edit
So the answer is in Felix's and my answer: publish the pointcloud, use octomap_server (look at the launch file) on your pointcloud topic, and enable the MarkerArray display in RViz to see the map built with OctoMap.
AHornung gravatar imageAHornung ( 2011-12-09 07:56:23 -0500 )edit
In advance thank you, I will try that :)
acp gravatar imageacp ( 2011-12-09 17:09:33 -0500 )edit
Hi, The launch file in octomap_server just Listens to a incoming PointCloud2 data and incrementally builds an octomap. Well, I have publish a sensor_msgs::PointCloud2 cl; to test it. I have remap the line in the launch file <remap from="cloud_in" to="/cl" />.
acp gravatar imageacp ( 2011-12-11 22:38:44 -0500 )edit
Then I open Rviz and I add a MarkerArray with topic /occupied_cells_vis_array. But I can not see anything in Rviz, I am probably doing something wrong. In advance thank you
acp gravatar imageacp ( 2011-12-11 22:40:44 -0500 )edit

Hi acp,I am interested to do something similar to what you are trying to accomplish. Did you get this to work yet? -Scott

Scott gravatar imageScott ( 2012-04-04 17:55:50 -0500 )edit

answered 2011-12-07 20:55:10 -0500

look at the launchfile provided with octomap_server. You can set the pointcloud topic it should listen to and the TF frame that is the (fixed) world coordinate system. Use the "octomap_saver" to save the node to file, look at it with "octovis". There is no visualization of octomaps in rviz, but somehow you can send the occupied voxels as cube Markers. Don't know how though.

edit flag offensive delete link more


Hi Felix, thank you very much for your advice :)
acp gravatar imageacp ( 2011-12-09 17:09:07 -0500 )edit

answered 2017-10-13 16:07:06 -0500

hjamal gravatar image

For a static map: rosrun octomap_server octomap_server_node ""

edit flag offensive delete link more


Thank you for your suggestion,when I rosrun octomap_server octomap_server_node to publish, octree is empty)

qiuxiaochang gravatar imageqiuxiaochang ( 2018-09-29 10:34:31 -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



Asked: 2011-12-07 18:15:46 -0500

Seen: 2,832 times

Last updated: Dec 07 '11