Rosanswers logo


I am building a map with a Kinect 360 and a turtlebot using RTABMAP on Ubuntu 14.04 and ROS Indigo.

Everything works fine, I can see the registered 3D point cloud on RTABMAPVIZ or with RVIZ. Now I want to save the 3D Point cloud to .pcd or .ply . I know there is the option in RTABMAPVIZ with File->Export 3D Cloud descripted here, but is there any option to do this without using RTABMAPVIZ? Is there any service I can call from the command line or from another node? Or to do this in RVIZ?

Any help would be appreciated!

Originally posted by schrottulk on ROS Answers with karma: 63 on 2016-12-21

Post score: 0


1 Answer 1


Rosanswers logo


It depends on which resolution you need the point cloud. By default, the /rtabmap/cloud_map topic (which is a PointCloud2) is voxelized at 5 cm. You can use pointcloud_to_pcd to export the point cloud to PCD:

$ rosrun pcl_ros pointcloud_to_pcd input:=/rtabmap/cloud_map

If rtabmap is not running (e.g., paused), call this to republish the map after being subscribed to /cloud_map:

$ rosservice call /rtabmap/publish_map 1 1 0

See rtabmap_ros/rtabmap wiki to see parameters related to /cloud_map. Unlike rtabmapviz, options are more limited:

~cloud_decimation (int, default: 4)
~cloud_max_depth (double, default: 4.0)
~cloud_voxel_size (double, default: 0.05)


In rtabmap version >= 0.11.11, if you have set subscribe_scan to true, you should explicitly set Grid/FromDepth to true to assemble 3D Kinect clouds for /rtabmap/cloud_map:

<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap">
   <param name="Grid/FromDepth" type="string" value="true"/>


Originally posted by matlabbe with karma: 6409 on 2016-12-22

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by schrottulk on 2016-12-26:
Thanks a lot!

Comment by schrottulk on 2017-01-12:
Hi matlabbe, sorry for bothering you again! But with cloud_map I only get the 2D projection of the registered 3D Map to the ground. Is it possible to save the registered 3D Point Cloud from the /rtabmap/mapData Topic to .pcd / .ply directly from the command line without using RTABMAPVIZ ?

Comment by matlabbe on 2017-01-12:
updated the answer...

Comment by schrottulk on 2017-01-14:
That works perfect! Many Thanks!


Your Answer

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