Ask Your Question
0

rtabmap_ros in simulation

asked 2019-02-22 12:34:26 -0600

achille gravatar image

updated 2019-02-28 14:20:26 -0600

Is there a way to launch the database file and publish it to ROS when running in simulation, i.e. when the sensors are not connected? I would just use it for visualization and for generating the collision scene, not for localization. By simulation, I don't mean in a physics engine like Gazebo.

I just want the cloud_map topic to exist including the service to visualize the map in RViz. I don't want any data from the time of creating the map to be replayed, especially the tf frames. Ideally, rtabmap_ros rtabmap.launch is not launched.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-02-25 11:16:44 -0600

matlabbe gravatar image

updated 2019-03-03 12:31:33 -0600

Note sure I understand well the question, but there is what you can do with a database:

1) Play database like a rosbag (though it is recommended to use directly a rosbag if it is what you want to do):

$ rosrun rtabmap_ros data_player _database:=~/my_map.db --clock

2) Start rtabmap with the database as input, then subscribe to /rtabmap/cloud_map and call service /rtabmap/publish_map to get the map:

$ roslaunch rtabmap_ros rtabmap.launch database_path:=~/my_map.db
$ rostopic echo /rtabmap/cloud_map
$ rosservice call /rtabmap/publish_map 1 1 0

EDIT

3) Without rtabmap.launch:

$ roscore
$ export ROS_NAMESPACE=rtabmap && rosrun rtabmap_ros rtabmap _database_path:=~/my_map.db
$ rostopic echo /rtabmap/cloud_map
$ rosservice call /rtabmap/publish_map 1 1 0

4) For RVIZ with rtabmap_ros/MapCloud display, launch rtabmap node in rtabmap namespace, then in RVIZ's MapCloud plugin should be able to click on Download Map:

$ roscore
$ export ROS_NAMESPACE=rtabmap && rosrun rtabmap_ros rtabmap _database_path:=~/my_map.db
$ rviz

5) For rtabmapviz, we can do something similar:

$ roscore
$ export ROS_NAMESPACE=rtabmap && rosrun rtabmap_ros rtabmap _database_path:=~/my_map.db
$ export ROS_NAMESPACE=rtabmap && rosrun rtabmap_ros rtabmapviz
edit flag offensive delete link more

Comments

This works but given more thought it's not what I'm looking for. I updated my question with more details

achille gravatar imageachille ( 2019-02-28 13:45:47 -0600 )edit

updated the answer with more examples

matlabbe gravatar imagematlabbe ( 2019-03-03 12:33:14 -0600 )edit

The edited answer works for me with Rviz when the namespace is set to export ROS_NAMESPACE=rtabmap/rtabmap instead of just rtabmap. However I get the Did not receive data since 5 seconds! on the rtabmap node. Can mapping not just be disabled? I do have the ability to suppress warnings but I'm hoping there's an actual fix.

achille gravatar imageachille ( 2019-03-12 23:11:07 -0600 )edit

you can set _publish_tf:=false to disable map->odom to be published.

matlabbe gravatar imagematlabbe ( 2019-03-15 19:42:23 -0600 )edit

That doesn't get rid of the warnings. The rtabmap localization node is still running and looking for messages on the camera topics.

achille gravatar imageachille ( 2019-03-19 16:28:25 -0600 )edit

If there are warnings telling that camera topics are not received since 5 seconds, and you don't plan to feed topics to the node, you can ignore the warnings (rtabmap is waiting for topics and do nothing actually).

matlabbe gravatar imagematlabbe ( 2019-03-22 21:34:06 -0600 )edit

Solved the warnings by setting the output argument to 'log' when running in simulation. Thanks!

achille gravatar imageachille ( 2019-03-25 00:00:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-02-22 12:34:26 -0600

Seen: 58 times

Last updated: Mar 03