ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to execute rtabmap_ros/map_assembler and generate a cloud map?

asked 2019-02-11 16:24:28 -0500

Avner gravatar image

updated 2019-02-12 13:01:07 -0500

I am running ros_rtabmap and seeing good point cloud in rviz /rtabmap/mapData (but not from /rtabmap/cloud_map)

According to here, I should be able to run an rtabmap_ros/map_assembler node to subscribe to /rtabmap/mapData and generate a cloud. but I'm having some problems to do that.

Here is what I did: I added a rtabmap_ros/map_assembler node to the launch file.

<node pkg="rtabmap_ros" type="map_assembler" name="map_assembler">
    <!-- <param name="Grid/FromDepth" type="string" value="false"/> -->
</node>

I can see that the process running

pas aux | grep assembler
avnerm    9233  0.9  2.1 1647040 171340 ?      Ssl  13:46   0:02 /opt/ros/melodic/lib/rtabmap_ros/map_assembler __name:=map_assembler __log:=/home/avnerm/.ros/log/d6b29696-2bd8-11e9-a83c-74d02b912ce1/map_assembler-13.log

and generates a topic

rostopic list | grep -i cloud_map 
/map_assembler/cloud_map
/rtabmap/cloud_map

However, nothing gets published

rostopic echo /map_assembler/cloud_map
...

According to here, map_assembler subscribes to rtabmap_ros/MapData

I see the following mapData related topics:

rostopic list | grep -i MapData
/mapData
/rtabmap/mapData

but not rtabmap_ros/MapData

I tried running map_assembler from the command line as stand alone. It uses these parameters:

/opt/ros/melodic/lib/rtabmap_ros/map_assembler
[ INFO] [1549921966.051079341]: /map_assembler(maps): map_filter_radius          = 0.000000
[ INFO] [1549921966.051775099]: /map_assembler(maps): map_filter_angle           = 30.000000
[ INFO] [1549921966.051807634]: /map_assembler(maps): map_cleanup                = true
[ INFO] [1549921966.051827208]: /map_assembler(maps): map_negative_poses_ignored = true
[ INFO] [1549921966.051838948]: /map_assembler(maps): map_negative_scan_ray_tracing = true
[ INFO] [1549921966.051855113]: /map_assembler(maps): cloud_output_voxelized     = true
[ INFO] [1549921966.051869112]: /map_assembler(maps): cloud_subtract_filtering   = false
[ INFO] [1549921966.051887146]: /map_assembler(maps): cloud_subtract_filtering_min_neighbors = 2
[ INFO] [1549921966.056246560]: /map_assembler(maps): octomap_tree_depth         = 16

My questions:

  • What should I do to make rtabmap_ros/map_assembler node publish results?
  • How can the cloud results be stored in file for post-processing? (I want to open the cloud map file later with e.g. standalone rtabmap so I can convert the cloud point to mesh)

Thanks,

Avner


EDIT1

I remapped mapData to /rtabmap/mapData, and run pcl_ros pointcloud_to_pcd and now rtabmap_ros/map_assembler node publishes results and the results are saved to files - good!

However, I see that with every message, a new .pcd file is created for the accumulated map, that increases in size. Is there an option to just save the final accumulated map and have a single .pcd file?

For your final question, if you are using rtabmap standalone to generate the mesh, you don't have to export the point cloud, just open the resulting database (default location is ~/.ros/rtabmap.db) in rtabmap standalone and do the export (like in step 7 of this tutorial):

At first, I was using rtabmap standalone with rtabmap.db to generate the mesh, but I it looks to me like the point cloud that is assembled in rviz (/rtabmap/mapData), is better.

This is why I wanted to work on the point cloud from /rtabmap/mapData instead of the point cloud that is assembled in rtrabmap (/rtabmap/cloud_map) that is stored in rtabmap.db

Could there be an inherent difference (i.e. using different algorithms) between the point cloud that is assembled in rviz ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-12 10:24:00 -0500

matlabbe gravatar image

updated 2019-02-12 15:08:21 -0500

map_assembler is not subscribing to right mapData, you have to remap the topic or create the node in rtabmap namespace:

<node pkg="rtabmap_ros" type="map_assembler" name="map_assembler">
    <remap from="mapData"to="/rtabmap/mapData"/>
</node>
OR
<group ns="rtabmap">
    <node pkg="rtabmap_ros" type="map_assembler" name="map_assembler"/>
</group>

You may change Grid/VoxelSize value (default 0.05 m) if you want a more dense cloud. To save a point cloud message, you can use pointcloud_to_pcd:

$ rosrun pcl_ros pointcloud_to_pcd input:=/map_assembler/cloud_map

For your final question, if you are using rtabmap standalone to generate the mesh, you don't have to export the point cloud, just open the resulting database (default location is ~/.ros/rtabmap.db) in rtabmap standalone and do the export (like in step 7 of this tutorial):

$ rtabmap ~/.ros/rtabmap.db

You will then have all the options to regenerate the point cloud at the density you want while creating the mesh.

cheers,
Mathieu

EDIT

For pointcloud_to_pcd, you would have to start it only when you want to save the cloud, then kill it after saving one.

The cloud generated in RVIZ with MapCloud plugin can be regenerated identically with the Export options in rtabmap standalone. You can check Regenerate clouds option in Export dialog: image description

If you set voxel size to 0, you will get the most dense cloud that you can get from the depth images contained in the database. You will find all corresponding parameters of MapCloud rviz plugin in this dialog.

edit flag offensive delete link more

Comments

I followed your comments and have some more questions. Please see section EDIT1 above.

Avner gravatar image Avner  ( 2019-02-12 12:59:46 -0500 )edit

Ok. I'm now starting pointcloud_to_pcd only at the last frame and getting one point cloud file. Since rtabmap standalone can generate identical cloud to the one that is generated in RVIZ with MapCloud plugin (continue next comment)

Avner gravatar image Avner  ( 2019-02-12 16:25:54 -0500 )edit

I prefer to work with rtabmap standalone directly against rtabmap.db (instead of using pointcloud_to_pcd) (continue next comment)

Avner gravatar image Avner  ( 2019-02-12 16:26:46 -0500 )edit

I filed a question regarding effective tuning of rtabmap meshing using a portion of the point cloud here

Avner gravatar image Avner  ( 2019-02-12 16:27:06 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-02-11 16:24:28 -0500

Seen: 1,210 times

Last updated: Feb 12 '19