Mode Swtiching Localization and Mapping + db file Changer

Posted by robertsenps on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Mode-Swtiching-Localization-and-Mapping-db-file-Changer-tp8886.html

Hi Mathieu,

I have a problem regarding mode switching between localization and mapping. The goal that I want to achieve is to continue mapping, Here's my plan:
1. Run Rtabmap in localization mode by loading map.db
2. Make a copy of the db file (map_temp.db)
3. Switch the db file from map.db to map_temp.db by using rtabmap/load_database service
4. I launch a launch file to update the param by <rosparam> command to change my config from localization config to mapping config (because it is different), and call rtabmap/update_parameters.
5. Switch to the mapping mode using rtabmab/set_mode_maping service

--- I do some mapping ---

6. After that, I want to revert it back to mapping and save the temp.db to the original db file. (I did this because I want to have a backup incase if the new map is broken)
7. Call rtabmap/set_mode_localization service.
8. I launch another launch file to load localization params, and call rtabmap/update_parameters.
9. Make another copy of the map.db to map_temp2.db.
10. Switch db file to the map_temp2.db ( I did this to make sure the map_temp.db is being saved).
11. Overwrite map.db with the map_temp.db
12. Switch to map.db and continue localizing.

I had problems:
* at point 4 and 8. I have set the Grid/CellSize to 0.1 but there is an error on the terminal mentioning that Condition (cellSize > 0.0f) not met!. I don't know what is happening.
Error when update the parameters

* at point 10. The rtabmap/rtabmap dies.
Error when changing db files

*I tried to reload all the nodes after mapping is done and load a map_temp.db, but I noticed the map_temp.db is not updated (the new graph is not shown). I think the update_parameters is not working, so it won't save the map if some params are bad. When I tried to open the db using rtabmap-databaseViewer, the app just stopped working. I think the problem is on the string parameters thing. Do you have any idea how to rosparam set as a string?

rtabmap db viewer, stopped working

Do you know what is causing the problem? Is something weird with the steps? Is it the correct way to update the parameters and change between db files? I hope I can hear your feedback soon.

Thanks,
Regards,

Robert