TimeThr

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

TimeThr

cjsurjadi
Hi,

I'm trying out the LTM/WM strategy to improve online performance of RTAB-Map. I mapped the same small office area with the Rtabmap/TimeThr:0 and Rtabmap/TimeThr:700 to compare. However, I found out that the mapping timing is slower for when the Rtabmap/TimeThr:700. I can see that the local graph size is lower for the database with time threshold so I suppose the long-term memory strategy is working. Is this behaviour expected?

The database when the time threshold is set as 700 and 0 can be accessed in threshold database and no threshold database.
Reply | Threaded
Open this post in threaded view
|

Re: TimeThr

matlabbe
Administrator
Hi,

For that map size, normally you would get similar results (memory management would not even trigger). Here the timing summary (left= not threshold, right=threshold):


For some reason the map update at the beginning took longer on the "with threshold" run, triggering the memory management that is adding afterwards some overhead (reactivation time).

Looking at the memory update details:


The occupancy grid creation is slower on the second run than on the first run (normally they should be similar with or without memory management). Is there something else running on the computer during the second run? Grid/RayTracing with Grid/3D are also enabled at the same time, which is the worst case scenario for long local occupancy grid creation. The memory management approach was benchmarked against loop closure detection computation time increasing over time, while assuming low local computation grid time. You may try again with Grid/3D to false unless you really need an OctoMap.

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

Re: TimeThr

cjsurjadi
Hi Mathieu,

Thanks for the clarification! I tried mapping out a larger area and found the LTM/WM working to improve the online SLAM performance. I found from this forum that RGBD/OptimizeFromGraphEnd should be set to true while using LTM/WM for SLAM, but in localization mode RTAB-Map is able to handle online large maps without memory management. I tried out creating a map with memory management. However, when I try to run RTAB-Map in localization mode with this map  without the memory management by setting Rtabmap/TimeThr='0' and RGBD/OptimizeFromGraphEnd='false', the database switches it back to the setting I was using while mapping, which is to use TimeThr=700 and OptimizeFromGraphEnd='true'. Is there a way for me to use the new localization parameters while using the database that used memory management?
Furthermore, is there a way for me to save the statistics of the localization mode (e.g.: processing mode and MapToBase_lin_std in the database or somewhere else so I can do post-analysis on the localization performance?

Thank you so much for your help!
Reply | Threaded
Open this post in threaded view
|

Re: TimeThr

matlabbe
Administrator

You can use Mem/LocalizationDataSaved to save statistics during localization inside the database.

Normally, if you add parameters in your launch file, they will override the ones in the database.

Note that if you disable memory management and want all nodes in localization mode, you should add Mem/InitWMWithAllNodes to true. In summary:
Mem/IncrementalMemory=false
Rtabmap/TimeThr=0
RGBD/OptimizeFromGraphEnd=false
Mem/InitWMWithAllNodes=true

If in rtabmap_viz it is still showing time threshold to 700 ms, can you share the terminal log when launching the launch file?
Reply | Threaded
Open this post in threaded view
|

Re: TimeThr

cjsurjadi
The snippet of my launch file to launch the localization node is as the following:
Node(
            condition=IfCondition(localization),
            package='rtabmap_slam', executable='rtabmap', output='screen',
            parameters=[config,
                        {'database_path':map_db_path,
                        'Mem/IncrementalMemory':'False',
                        'Mem/InitWMWithAllNodes':'True',
                        'Mem/LocalizationDataSaved':'True',
                        'RGBD/OptimizeFromGraphEnd':'False',
                        'RGBD/SavedLocalizationIgnored':'True',
                        'Rtabmap/TimeThr':'0'}],
            remappings=remappings),
The messages I see in the terminal is:
[rtabmap-5] [INFO] [1706492242.466291423] [rtabmap]: Update RTAB-Map parameter "Rtabmap/TimeThr"="700" from database
...
[rtabmap-5] [INFO] [1706493270.514693455] [rtabmap]: rtabmap (760): Rate=1.00s, Limit=0.700s, Conversion=0.0035s, RTAB-Map=0.2667s, Maps update=0.0027s pub=0.0129s (local map=525, WM=546)
When I checked RTAB-Map Viz Statistics, I see this:
Reply | Threaded
Open this post in threaded view
|

Re: TimeThr

matlabbe
Administrator
There was a bug, should be fixed by https://github.com/introlab/rtabmap_ros/issues/1117
Reply | Threaded
Open this post in threaded view
|

Re: TimeThr

cjsurjadi
Hi Mathieu,

I've tested the new version of RTAB-Map and I can launch the database in localization mode with parameter 'Rtabmap/TimeThr'= '0'. Thanks for the bug fix!