Robotics StackExchange | Archived questions

rtabmap_ros, navigation simulation on prerecorded map, pathplanning

Hi,

Im fairly new to ros and after a forced break of 2+ months kinda out of the loop.

Is it possible to use a prerecorded map from rtab_map to test a trajectory planned by ros navigation? I already set up the navstack on the robot, have a gazeebo and rviz model and recorded a .db map which I had transfered from the origin PC to my home PC.

My goal is to see a planned trajetory from the http://wiki.ros.org/navigation on the map in rviz or gazeebo.

Am I right, that at first I have to convert the map like written here https://answers.ros.org/question/217097/export-2d-map-from-rviz-andor-rtab-map/? Is this also possible with a .db file which was recorded on another PC?

Sincerly, Uwe

Asked by Uwe on 2020-05-18 09:06:42 UTC

Comments

Edit: Ich should have added, that the map was created using a ZEDm Camera and a stereo configuration.

Asked by Uwe on 2020-06-07 14:51:43 UTC

Answers

Try:

$ rosrun rtabmap_ros rtabmap --Mem/IncrementalMemory false _database_path:=map.db
$ rostopic echo /grid_map

The /grid_map topic will be the static occupancy grid that the navigation stack would subscribe on. The map can be recorded from a different PC but the db version should be older or same than the rtabmap version used on the target PC (an error will be shown if the rtabmap version is older than the db version, if so, just upgrade rtabmap to latest version).

Asked by matlabbe on 2020-05-21 08:54:03 UTC

Comments

Thank you for your fast reply! I get following error while trying this: error while loading shared libraries: librtabmap_core.so.0.19:cannot open shared object file: No such file or directory For testing I used the standart rtabmap database path ~/.ros and the rtabmap.db file.

Asked by Uwe on 2020-05-21 12:48:30 UTC

It looks like the linker cannot find librtabmap_core.so.0.19. How rtabmap was installed? From binaries or by source? If from source, make sure to update both rtabmap and rtabmap_ros.

Asked by matlabbe on 2020-05-22 11:03:00 UTC

I reinstalled rtabmap and rtabmap_ros from source. After entering:

rosrun rtabmap_ros rtabmap --Mem/IncrementMemory false /home/kinetic/StereoSLAM:=map

I get :

[ WARN] [1590512365.529461942]: /rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap subscribed to (approx sync):
   /odom,
   /rgb/image,
   /depth/image,
   /rgb/camera_info

I thougth this could be normal since I work with an prerecorded map, but

rostopic echo \grid_map

Returns nothing

Asked by Uwe on 2020-05-26 12:05:58 UTC

/home/kinetic/StereoSLAM:=map seems wrong to me. In my example, it is _database_path:=map.db

Asked by matlabbe on 2020-05-26 12:56:10 UTC

Sry, I thougth _database_path should be my Path to the map I created and map.db the name of the map itself. It gave me errors about the . operator as I tried it with .db . I now tried with _database_path:=map.db and it gives me the same Warning and no \grid_map. I also tried _database_path:=name_of_my_map.db and I get:

[ERROR] (time&date) VWDictionary.cpp:675::addWordRef() Not found word (Incremantally incresing number) (dict size=0)

Kinda off-topic, but I really appreciate your enormous engagement in all rtabmap related question threads across multiple platforms. Thank you! It really helps alot.

Asked by Uwe on 2020-05-27 05:58:43 UTC

map.db should be the absolute path of your database. By default, rtabmap saves the map in ~/.ros/rtabmap.db, so in that case _database_path:=~/.ros/rtabmap.db. Make sure the map file you are using exists and have a map inside. You can open the database with rtabmap-databaseViewer, open Window->Graph View and see if a grid map is shown under the blue trajectory.

... and you're welcome!

Asked by matlabbe on 2020-06-02 09:31:35 UTC

Thank you. I followed the appropriate syntax now, but still run into the same Error

[ERROR] (time&date) VWDictionary.cpp:675::addWordRef() Not found word (Incremantally incresing number) (dict size=0)

I checked the database with the database viewer and it looks ok as far as i can tell.

Asked by Uwe on 2020-06-05 02:09:26 UTC

I changed to the PC where I originally captured the map and now get the same Errors regarding not published topics. I captured the map in a stereo configuration and with a zedm camera and I couldn't find any Method of how to change the subscribed topics from in case I call it like:

rosrun rtabmap_ros rtabmap

Asked by Uwe on 2020-06-07 15:03:04 UTC

Take a look at the zed example here : http://wiki.ros.org/rtabmap_ros/Tutorials/HandHeldMapping

Asked by matlabbe on 2020-06-23 13:11:15 UTC