0
$\begingroup$

Rosanswers logo

Hi Everybody

The launch file in octomap_server just listens to a incoming PointCloud2 data and incrementally builds an octomap.

Well, I want to test it, for that I have made a node that transform laser scans to pointcloud2 and then it publishes the topic cl. hokuyo_listener_cu.cpp and a tf broadcaster tf_broadcaster.cpp, respectively.

I launch rviz and I add PointCloud2 with topic cl and it can visualize the map of the laser scan.

well; I now want to use octomap in ros to visualize the voxels from the laser coordinates. I got the source code over a SVN. I have use rosdep and rosmake to install octomap_mapping and octomap_visualization.

Then, I remap the line in the launch file remap from="cloud_in" to="cl" />

Then, I launch, roslaunch octomap_server octomap_mapping.launch

Then I open Rviz and I add a MarkerArray with topic /occupied_cells_vis_array. But I can not see anything in Rviz.

I run rxgraph and I can see that the octomap_server node can listen to the /cl topic and can broadcast /occupied_cells_vis array.

Why rviz can not visualize anything when I use octomap server?

In advance thank you


Originally posted by acp on ROS Answers with karma: 556 on 2011-12-12

Post score: 1


Original comments

Comment by mazikeen on 2018-12-17:
Hello, Is this issue sorted? I am not being able to take a look at your .cpp files. Can you please repost them?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The visualization topic needs to be "occupied_cells_vis" without the "_array" at the end. This is a problem with rviz, it automatically adds _array to MarkerArray topics. If that is the problem, the topic should turn red as error in RViz.

Another problem could be the frame_id. octomap_server needs a fixed (map) frame id and a tf transform of the input PointCloud2 into this frame. It uses a tf message filter to wait for this transform. Check the parameter "frame_id" in the octomap_mapping launch file and make sure that RViz is also set to this fixed frame.

Finally, to debug further, start rxconsole and set the log levels of octomap_server to "Debug". It should tell you what it's doing there.


Originally posted by AHornung with karma: 5904 on 2011-12-13

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by acp on 2011-12-18:
Hi AHornung, well I want to fuse 2D laser scans with 3D depth vision under octomap-ros and visualize the process dynamically either rviz or octavis, cheers :)

Comment by AHornung on 2011-12-16:
For building a 2D map octomap is not the right tool, you should look at gmapping instead: http://www.ros.org/wiki/gmapping

Comment by acp on 2011-12-13:
Well, I just broadcast a tf transform from the /laser frame to the /base_footprint and rviz can visualize the laser voxels. But, the questions here are: 1.-Where the /base_footprint frame is situated with respect to the /laser frame? 2.-How can dynamically build a 2D map of the environment using octomap-ros

Comment by AHornung on 2011-12-13:
But note that it's a little pointless to integrate scans in the local laser frame. You need some sort of scan registration (SLAM, scan matching) running or at least odometry.

Comment by AHornung on 2011-12-13:
octomap_server is not publishing because it does not integrate scans. It is waiting for a transform to the fixed frame which you set to "base_footprint". See the last 2 paragraphs of my reply. You could set that param to "laser" if you have no tf publishing running.

Comment by acp on 2011-12-13:
Hi Ahornung, In advance thank you for your help, I really appreciate it. I tried the tool "rostopic echo /cl" and I can see there is data publish on the topic "/cl", however when I try "echo /occupied_cells_vis_array", I can not see any data publish on that topic. In the other hand, "rosmsg show visualization_msgs/MarkerArray" shows the details of the message. The launch file shows "param name="frame_id" type="string" value="/base_footprint" />", whereas in rviz I have "Fixed frame = /laser" and "Target frame= /bl". There are no more frames to choose. How can I be sure that rviz is set to the same frame? The visualization topic in "rviz is /occupied_cells_vis_array" and does not turning red. I think that the problem is that the \octomap_server node is not publishing any data to rviz even though the topic /occupied_cells_vis_array exists with message visualization_msgs/MarkerArray. Does all of this tell you some insight about where the problem could be? In advance thank you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.