Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/simulating-input-of-a-kinect-camera-tp66p77.html
Hi Michael,
The standalone version comes with the GUI for visualization, node data are cached for point cloud generation, which takes a large part of memory. On a ROS robot setup, the GUI would be on another computer (using
rtabmapviz or
rviz), running only the
rtabmap node on the robot (similar to this
configuration). So with the GUI, you may want to increase the "3D cloud decimation" parameter for the map in "General Settings -> 3D Rendering" panel to save some memory from cloud generation. If you don't need to see the map built online, you can set parameter "Publish signature data" (Avanced RTAB-Map Settings) to false and call "Edit->Download all clouds" at the end of experiment to see the final map result.
So after limiting memory usage from the GUI, there some parameters in the core the limit the memory used. The parameters "Keep rehearsed locations" and "Using database in the memory..." can be set to false to save RAM on the core side (see panel "Avanced RTAB-Map Settings->Memory->Database"). You may want to decrease RTAB-Map loop closure detection rate (default 1 Hz): For example, at 0.5 Hz, there will be half nodes in the map than at 1 Hz.
RTAB-Map's memory management is dependent of "T_time" parameter (warning: the default value is 0, desactivated). When this threshold is used, it is assumed that real-time limit would be reached before memory limit (RAM), so "T_time" was set to 700 ms in examples on a robot, and RAM (over 3 GB on our robots) was never reached. However, if the maximum memory is reached before the real-time time threshold, the memory threshold can be used to limit the size of the Working Memory, so indirectly fixes the maximum RAM used:
* GUI: Preferences->Advanced->RTAB-Map settings->"Maximum signatures allowed in Working Memory (0 means inf)"
* ROS:
<param name="Rtabmap/MemoryThr" type="string" value="100"/>
However, activating the memory management of RTAB-Map influences the size of the active local map. See the
related paper to understand this effect.
On a robot, you may have nodes like
map_assembler or
grid_map_assembler that convert the output of
rtabmap to standard ROS messages like
sensor_msgs/PointCloud2 or
nav_msgs/OccupancyGrid, there is no mechanism yet to limit the size of the cache used by these nodes.
Regards,
Mathieu