ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# can not save map with octomap_server / octomap_saver from rgbdslam ROS Fuerte

Hi,

I have seen on this ROS Answer topic that someone already had trouble saving maps from rgbd slam using octomap. I have exactly the same problem, I click on "Graph" -> Send Model (ctrl+M) inside the rgbdslam window, the model and the map seem to be sent correctly (30 out of 30 nodes, for example), but when I run "rosrun octomap_server octomap_saver mymap.bt" there is only 1 node saved to the map file (so empty map in octovis).

Let me explain my setup : rgbdslam from the wiki svn, adapted with many efforts to be used in fuerte and built with rosmake. I can capture a scene (by pressing space), but no map can be saved with octomap_saver as said above.

I have also set up the octomap_mapping.launch file accordingly (fixed frame "openni_camera" and "cloud_in" remapped to "/rgbdslam/batch_clouds").

I am also using the experimental branch of octomap. Here are the steps that I did to build it in ROS Fuerte:

Error : /home/micmac/fuerte_workspace/octomap_mapping-experimental/octovis/src/octovis/TrajectoryDrawer.cpp:63:5: erreur: ‘GLUquadricObj’ was not declared in this scope

> Edited /home/micmac/fuerte_workspace/octomap_mapping-experimental/octovis/src/octovis/TrajectoryDrawer.h to add #include <GL/glu>



Error: /home/micmac/fuerte_workspace/octomap_mapping-experimental/octomap_ros/src/conversions.cpp:45:114: erreur: explicit instantiation shall not use ‘inline’ specifier [-fpermissive] Error: /home/micmac/fuerte_workspace/octomap_mapping-experimental/octomap_ros/src/conversions.cpp:46:125: erreur: explicit instantiation shall not use ‘inline’ specifier [-fpermissive]

> Edited /home/micmac/fuerte_workspace/octomap_mapping-experimental/octomap_ros/src/conversions.cpp to remove 'inline' specifier on both lines 45 and 46


Then rosmake octomap_mapping-experimental : Built 39 packages with 0 failures

So both RGBDSLAM and octomap_mapping-experimental seem to run fine, but I can't save any map using "rosrun octomap_server octomap_saver mymap.bt"

I have also tried to publish a static transform from /rgbdslam/batch_clouds to octomap_server by adding this line to octomap_mapping.launch:

<node pkg="tf" type="static_transform_publisher" respawn="false" name="octomap_tf_conversion" args="0 0 0 0 0 0 /rgbdslam/batch_clouds /octomap_server 10" output="screen"/>

I must also precise that I am using the Asus Xtion Pro live cam, so the topics may be a little different here and there (camera_rgb_optical_frame instead of openni_rgb_optical_frame), but I also tried all the required changed without success.

Would you please have any advice to give me on how to save a map from rgbdslam with octomap_mapping ? I've been spending monthes on this without success so far...

edit retag close merge delete

Do you really need the experimental branch of octomap_mapping? I think it's pretty outdated and not maintained by anyone...

( 2012-10-02 03:06:59 -0600 )edit

Well I sticked to what is said in the wiki. Furthermore, I have read somewhere (can not remember url sorry) that the experimental branch includes some transforms or other required stuff in order for the communication between rgbdslam and octomap server to work.

( 2012-10-02 21:35:55 -0600 )edit

Could you update from the repository and see whether it works now?

( 2012-10-25 02:46:25 -0600 )edit

Sort by » oldest newest most voted

**2nd Edit: The latest release of my rgbdslam package includes the ability to compute the octomap internally. You can save it directly from the gui or via ros service call. See the wiki or the readme file for instructions.

Edit: I found a bug in rgbdslam, where the tf frames of the old openni_camera driver are hardwired in the code. Because of this, octomap_server will not find a transformation between /map and the point cloud frame when using openni_launch. I'll try to release a fix soon.

This sounds like your settings for the interplay between rgbdslam and octomap_server are incorrect. The fixed frame should not be openni_camera, but whatever you set as parameter "fixed_frame_name" for rgbdslam.

rxgraph lets you easily see, whether the rgbdslam and octomap-server node are communicating on the same topic.

The pointclouds streamed to the octomap server need much bandwidth and much processing by the octomap server. Make sure your computer is capable of keeping up or adapt rgbdslam's parameter "send_clouds_rate".

Using the Xtion Pro is fine, you only need to adapt the input topics of rgbdslam, which seems to work as you see the cloud correctly in rgbdslam's gui.

The transform publisher you use makes no sense. The frame id set in /rgbdslam/batch_clouds is the fixed_frame_name as mentioned above. Make sure you set that same frame name for the octomap_server (see rgbdslam/launch/octomap_server.launch for an example).

more

I have also corrected that in the code itself, but it didn't help. I have not tried yet with your new repository though... I will try it as soon as I can, thanks for updating the code :)

( 2012-12-19 23:42:04 -0600 )edit

I have set the fixed frame name in octomap_server launch file to /map, because it is the fixed frame used in rgbdslam (I could see it in the settings using the gui).

And I also changed the "send_cloud_rate" parameter in rgbdslam.launch to 3 (as in the example) but it didn't work either (1 node written only, as earlier). So I even tried to lower it to 1, but same thing. My cpu is a core i7 930, I have 6Gb ram, and no other cpu or ram consuming processes. I guess it's ok ?

Furthermore I saw that there are two different launch files for the octomap_server: one is present in the experimental branch launch directory and is named octomap_mapping.launch, and the other is the one that you quoted "rgbdslam/launch/octomap_server.launch". I saw that there are two additional parameters in that one:

<param name="filter_ground" value="false" /><!-- who knows where the floor is? -->
<param name="base_frame_id" value="/camera_rgb_optical_frame" /> <!--needs to be set, even if not used-->


I tried to roslaunch the octomap_server using this launch file (I copied it in the launch directory of the experimental branch), and checked that the fixed frame as well as the cloud_in parameters were set correctly ("/map" and "/rgbdslam/batch_clouds").

I am launching rgbdslam first, capture a scene (then stop with space), then I launch the octomap_server, and send the model and map using the gui (I can see the sending speed being more slow when changing the send cloud rate parameter).

But no success either (1 node only written to the .bt map file using "rosrun octomap_server octomap_saver mymap.bt")

So it seems that I did set the parameters correctly this time (frame names, and send rate) but it still doesn't work.

Any other advice would be much appreciated. I must also say that I am working under ubuntu 12.04 with fuerte, so in the same time I am doing a separate install of ubuntu 11.10 with ros electric, because they are the ones used in the wiki.

Hopping it will work better with those. Thanks again for your answer.

more

I also see in the octomap_server wiki (ros.org/wiki/octomap_server) : " Downprojected 2D occupancy map from the 3D map. Be sure to remap this topic if you have another 2D map server running. New / changed in octomap_mapping". Do I have to do a remap in the launch file ?

( 2012-10-03 03:31:25 -0600 )edit

No, rgbdslam is no 2d map server. Your cpu and ram are definitely not the problem. To me everything you describe seems correct. 1 Node in the bt means, the octomap_server received nothing. Do you have set rgbdslam's "store_pointclouds" parameter set to true?

( 2012-10-03 04:27:58 -0600 )edit

If the above parameter doesn't help, check the output of rgbdslam using rostopic echo /rgbdslam/batch_clouds. This should output tremendous amounts of data. You can also use "bw" instead of "echo" to just look at the bandwidth. One cloud is about 10MB, so with send_cloud_rate=5 it should be 50MB/s.

( 2012-10-03 04:29:18 -0600 )edit

I have set "store_pointclouds" to true, but it didn't help. When I run the rostopic echo command, I see the list of points being sent separated by commas. With the bw command, I see that the average bw starts with full speed (related to the send_cloud_rate parameter), but immediately drops slowly.

( 2012-10-03 21:54:42 -0600 )edit

I have tried with the ros-fuerte-octomap* packages as well as the experimental branch of octomap, with the same result. I have also checked that no disturbing packages are left in the \$ROS_PACKAGE_PATH pathes, and closed then reopened all terminals between changing from branches.

( 2012-10-03 22:00:33 -0600 )edit

Is there a way to see or use the map inside rviz or ROS for navigation instead of saving it ? maybe I could do otherwise if the only problem is saving the map to a file ? Here is the result from rxgraph : http://i.imgur.com/ccq9M.jpg

( 2012-10-03 22:02:32 -0600 )edit

When I run "rostopic list" I can see a /projected_map topic, but no /map topic. I run this command when everything is launched (rgbdslam, octomap_server, openni_launch).

( 2012-10-04 00:19:04 -0600 )edit

Ok, let's first find out how many clouds are sent. Before you send out the model from rgbdslam execute "rostopic echo /rgbdslam/batch_clouds > /tmp/sentclouds". Then check how many clouds are inside e.g. by "grep header /tmp/sentclouds|wc". This should be the amount of frames you recorded.

( 2012-10-04 01:19:42 -0600 )edit