0
$\begingroup$

Rosanswers logo

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.


Originally posted by achille on ROS Answers with karma: 464 on 2019-02-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

  1. 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

  1. 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

  2. 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

  3. 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


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

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by achille on 2019-02-28:
This works but given more thought it's not what I'm looking for. I updated my question with more details

Comment by matlabbe on 2019-03-03:
updated the answer with more examples

Comment by achille on 2019-03-12:
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.

Comment by matlabbe on 2019-03-15:
you can set _publish_tf:=false to disable map->odom to be published.

Comment by achille on 2019-03-19:
That doesn't get rid of the warnings. The rtabmap localization node is still running and looking for messages on the camera topics.

Comment by matlabbe on 2019-03-22:
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).

Comment by achille on 2019-03-25:
Solved the warnings by setting the output argument to 'log' when running in simulation. Thanks!

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.