Can different static dictionaries be applied on existing db file to evaluate them?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Can different static dictionaries be applied on existing db file to evaluate them?

GiladB
Hi Mathieu,

In order to map and localize well in very large warehouses, one of the options we wanted to persue is using static dictionaries. Currently, I'm looking for a way to evaluate a dictionary without having to wait the entire rosbag playback to complete.

Is there currently a way to apply a static dictionary at postprocessing (maybe on the .db file?) and get some statistics about how it worked? I would be intrested to know how many loop closures were accepted/rejected, how the occupancy grid looks like as well as other metrics.

If this option doesn't currently exist, do you have a recommendation about how to tackle it?

Thanks,
Gilad
Reply | Threaded
Open this post in threaded view
|

Re: Can different static dictionaries be applied on existing db file to evaluate them?

matlabbe
Administrator
Hi,

If you built a static dictionary following this, you may reprocess offline any databases with that dictionary with rtabmap-reprocess:
rtabmap-reprocess \
   --Kp/DictionaryPath ~/dictionary.db \
   --Kp/IncrementalDictionary false  \
   rtabmap.db output.db
Add "--Mem/UseOdomFeatures false" if you also want to re-extract features.

You can use rtabmap-info to show loop closures detected afterwards.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Can different static dictionaries be applied on existing db file to evaluate them?

GiladB
This post was updated on .
Thank you, Mathieu!
It helped me a lot and saved me the time of re-running the full rosbag for each dictionary.
Reply | Threaded
Open this post in threaded view
|

Re: Can different static dictionaries be applied on existing db file to evaluate them?

GiladB
In reply to this post by matlabbe
Follow up question:
Is it possible to recreate a full, dynamic, dictionary using a rtabmap-reprocess?


I tried this:
rtabmap-reprocess --Mem/UseOdomFeatures false --Kp/IncrementalDictionary true rtabmap-small-static-dictionary.db re-extract.db

And called the dump method (rtabmap.dumpData()) from the reprocess code just before doing rtabmap.close(true).

Looks like the dictionary saved after the above reprocess command is exactly the same as the one that created the input db file (in previous reprocess run).


My motivation:
Creating a full dynamic dictionary while mapping a very big warehouse using a relatively weak machine is not possible due to RAM limitations.
I thought about creating a .db file of the whole warehouse with some static dictionary and then taking the .db file to a stronger server with lots of RAM, create a full dynamic dictionary and later decide what subset of the dictionary works best for me and push it back to the robot.
Reply | Threaded
Open this post in threaded view
|

Re: Can different static dictionaries be applied on existing db file to evaluate them?

matlabbe
Administrator
Yes, it should be possible to do so. Here some examples:

1. Making rtabmap.db using a static dictionary
rtabmap-reprocess --Kp/IncrementalDictionary false --Kp/DictionaryPath dictionary_50K_words.db  rtabmap.db rtabmap_with_static_dict.db 

2. Making rtabmap_with_static_dict.db using an incremental dictionary instead:
rtabmap-reprocess --Kp/IncrementalDictionary true --Kp/DictionaryPath ""  rtabmap_with_static_dict.db rtabmap_inc_dict.db 

rtabmap_inc_dict.db should be same than original rtabmap.db (assumed created with incremental dictionary)