I want your advice regarding the storage of my database. I want to have a dedicated script for mapping for e.g: map.launch and every time i run it, I want the database to be saved without replacing the existing database. For example if for first session the database saved is rtabmap.db for other consecutive session i want the databases to be rtabmap1.db, rtabmap2.db and so on.
I learned about rosservice call /rtabmap/backup it saves database inside ~/.ros/rtabmap.db.back but i have to write in terminal everytime. I want to automate this process and need some advice from you.
on my launch file during mapping process and now i have databases name in rtabmap_17-03-2022_08h36m23.db, rtabmap_18-03-2022_08h41m23.db, rtabmap_18-03-2022_08h43m08.db and so on.
Now in another launch file say run.launch i want to load the database. I just want the latest database to be loaded. How do i set the database path so it always gets the latest db file ? without renaming the previously saved database. For example say rtabmap_18-03-2022_08h43m08.db in the database path.
I want to do so because to keep on using two different scripts for mapping and navigation without losing any database or worry of replacing it.
You are looking to find the most recent file in a directory. You may need a bash script or a python script to launch the launch file with the latest database path. You can find on google how getting the last modified file in a directory in bash or python.