0
$\begingroup$

Rosanswers logo

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, and the point cloud that is assembled in rtabmap? (or are the differences only due to mis-configuration like using misfit Grid/VoxelSize in rtabmap)

Thanks


Originally posted by Avner on ROS Answers with karma: 96 on 2019-02-11

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by matlabbe with karma: 6409 on 2019-02-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Avner on 2019-02-12:
I followed your comments and have some more questions. Please see section EDIT1 above.

Comment by Avner on 2019-02-12:
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)

Comment by Avner on 2019-02-12:
I prefer to work with rtabmap standalone directly against rtabmap.db (instead of using pointcloud_to_pcd) (continue next comment)

Comment by Avner on 2019-02-12:
I filed a question regarding effective tuning of rtabmap meshing using a portion of the point cloud here

$\endgroup$

Your Answer

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