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

how to visualize 3d Map in RViz using Octomap ?

asked 2017-09-16 14:07:17 -0500

Eyshika gravatar image

updated 2017-09-24 11:47:53 -0500

hello I am learning octomap to create 3d maps . I cloned this link into my system and used these steps:

  1. rosbag play<my point="" cloud="" file="">
  2. cloned link
  3. Edited launch file to change remap <cloud_in> to <>

    <launch> <node pkg="octomap_server" type="octomap_server_node" name="octomap_server">

        <!-- fixed map frame (set to 'map' if SLAM or localization running!) -->
        <param name="frame_id" type="string" value="odom_combined" />
        <!-- maximum range to integrate (speedup!) -->
        <param name="sensor_model/max_range" value="5.0" />
        <!-- data source to integrate (PointCloud2) -->
        <remap from="cloud_in" to="/sensor_msgs/PointCloud2" />


  4. catkin_make

  5. roslaunch octomap_server octomap_mapping.launch It ran successfully but no output.

Now, i want to see my map created using point cloud data into Rviz. How can i do that ?

SOlutions tried:

Installed rviz-plugin

rostopic echo /sensor_msgs/PoinCloud2
WARNING: topic [/sensor_msgs/PoinCloud2] does not appear to be published yet

after launching file I checked topics list

rostopic list available


in my launch file I remapped cloud_in to /octomap_point_cloud_centers then also it was not working then I tried /sensor_msgs/PointCloud2

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-09-19 09:07:25 -0500

l4ncelot gravatar image


you need to install the octomap plugin for RViz. Here is the link.

edit flag offensive delete link more


I tried to clone this rviz code into my folder but it didnt work do I need to launch both separately ? or should i add this code in same directory ?

Eyshika gravatar image Eyshika  ( 2017-09-19 09:28:47 -0500 )edit

You don't need to do it manually. Just install the package using sudo apt-get install ros-kinetic-octomap-rviz-plugins (for kinetic).

l4ncelot gravatar image l4ncelot  ( 2017-09-20 01:05:27 -0500 )edit

Do I need to install octomap-server too for launching octomap_mapping or the steps I need are correct I mean cloning octomap_server ?

Eyshika gravatar image Eyshika  ( 2017-09-20 07:57:49 -0500 )edit

I think you don't need to install it. It's just another ROS package so build it with catkin_make command although I'm not sure about that. But if you're not planning to edit their code it's easier to just install it with sudo apt-get install ros-kinetic-octomap ros-kinetic-octomap-mapping.

l4ncelot gravatar image l4ncelot  ( 2017-09-20 08:31:31 -0500 )edit

Hi ! I installed octomap-mapping and also octomap-rviz-plugin, but still after launching octomap_mapping file it doesn't show any output. what is the reason behind this ? How can i see map ?

Eyshika gravatar image Eyshika  ( 2017-09-23 16:08:46 -0500 )edit

Can you edit your question and give us your .launch file? Also check your topic using rostopic echo if there's some data or not.

l4ncelot gravatar image l4ncelot  ( 2017-09-24 05:11:56 -0500 )edit

I have updated my question with launch file and rostopic echo

Eyshika gravatar image Eyshika  ( 2017-09-24 11:44:31 -0500 )edit

Have you checked if your pointcloud is published to /sensor_msgs/PointCloud2 topic? Also try to increase the range of your sensor, maybe there's no obstacle within 5m.

l4ncelot gravatar image l4ncelot  ( 2017-09-25 01:37:28 -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: 2017-09-16 14:07:17 -0500

Seen: 6,149 times

Last updated: Sep 24 '17