Memory management in localization mode

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

Memory management in localization mode

akunin
Hi,
We want to use WM/STM in localization mode as our databases are very big.
Is there any difference for memory management (WM/STM/LTM) in localization vs mapping mode or it's exactly same?
What params to recommend to refine?
thanks
Reply | Threaded
Open this post in threaded view
|

Re: Memory management in localization mode

matlabbe
Administrator
If you enable memory management (e.g., by setting Rtabmap/TimeThr or Rtabmap/MemoryThr), rtabmap should behave the same in localization vs mapping modes. When using memory management, it is also better to set "RGBD/OptimizeFromGraphEnd" to true:

rtabmap --params | grep GraphE
Param: RGBD/OptimizeFromGraphEnd = "false"                 [Optimize graph from the newest node. If false, the graph is optimized from the oldest node of the current graph (this adds an overhead computation to detect to oldest node of the current graph, but it can be useful to preserve the map referential from the oldest node). Warning when set to false: when some nodes are transferred, the first referential of the local map may change, resulting in momentary changes in robot/map position (which are annoying in teleoperation).]
This makes map and odom frames the same (on relocalization, the map is moved instead of the pose updated). Refer to this paper to see all the implications there are on navigation when memory management is enabled.

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

Re: Memory management in localization mode

akunin
can we load all nodes for graph optimization but dont load full vocabulary to save memory?
we work with nav2 for navigation. is it possible load (to WM) all nodes that are close to the path provided by nav2 planner or load nodes within specific radius assuming graph optimization is done upon init ?
Reply | Threaded
Open this post in threaded view
|

Re: Memory management in localization mode

matlabbe
Administrator
Hi,

can we load all nodes for graph optimization but don't load full vocabulary to save memory?
I see what you would want but it is not possible right now. Indeed the graph is kinda small in RAM, while loading all the visual features / vocabulary can require significant memory. Having the option to load the global graph but load only vocabulary matching the WM state is an interesting idea (then update/resize the vocabulary when nodes are brought back in WM). In localization mode in particular, we could have a very low memory footprint. I created an issue about that.

we work with nav2 for navigation. is it possible load (to WM) all nodes that are close to the path provided by nav2 planner or load nodes within specific radius assuming graph optimization is done upon init ?
When rtabmap is restarted, it will load at least nodes to last known position of the robot. If the robot is starting somewhere else that is not in its working memory, it won't be able to correctly assemble the map around the current location without being localized first in a node in WM.

Note also that I don't have an example of memory management enabled with nav2 stack (as I had with nav for ros1). To make rtabmap correctly loads appropriate nodes to WM based on nav2 planning (while following a path like int this paper), we should use "goal" topic input of rtabmap to send goal indirectly to nav2. Some code have been ported to ros2, but I think I never tested with memory management enabled.
Reply | Threaded
Open this post in threaded view
|

Re: Memory management in localization mode

akunin
Mateu,
it's still not clear to me when you work with internal rtabmap navigation, do you know to load relevant nodes into WM based on proximity or still memory management loads nodes based on rehearsal similarity? I'm looking for a way to load nodes (in localization mode only) which are close to the current position and navigation path.
thanks