<p>RTAB-Map (Real-Time Appearance-Based Mapping) is a RGB-D, stereo and lidar graph-based SLAM library built around an incremental appearance-based loop closure detector, with memory management that keeps the online constraints satisfiable on large-scale, long-term maps.</p>
<p>These pages document the public C++ API of the <code>rtabmap_core</code> and <code>rtabmap_utilite</code> libraries. For installation, tutorials and the ROS packages, see the <ahref="https://introlab.github.io/rtabmap/">project website</a> and the <ahref="https://github.com/introlab/rtabmap/wiki">wiki</a>.</p>
<h1><aclass="anchor"id="autotoc_md0"></a>
Start here</h1>
<p><aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a> is the entry point: it owns the map and runs one full SLAM iteration per call to <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3"title="Main RTAB-Map iteration: ingests one sensor frame and updates the map.">rtabmap::Rtabmap::process()</a>. A minimal loop feeds it a <aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">rtabmap::SensorData</a> and the odometry pose that goes with it:</p>
<divclass="line"><spanclass="keywordflow">if</span>(<aclass="code hl_namespace"href="namespacertabmap.html">rtabmap</a>.process(data, odomPose)) <spanclass="comment">// true when a new node was added</span></div>
<divclass="ttc"id="aclassrtabmap_1_1Odometry_html"><divclass="ttname"><ahref="classrtabmap_1_1Odometry.html">rtabmap::Odometry</a></div><divclass="ttdoc">Abstract base class for visual, lidar and visual-inertial odometry backends.</div><divclass="ttdef"><b>Definition</b><ahref="Odometry_8h_source.html#l00056">Odometry.h:57</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Odometry_html_a0c2d39ed9b76c2c411a9e62e16e3bce1"><divclass="ttname"><ahref="classrtabmap_1_1Odometry.html#a0c2d39ed9b76c2c411a9e62e16e3bce1">rtabmap::Odometry::process</a></div><divclass="ttdeci">Transform process(SensorData &data, OdometryInfo *info=0)</div><divclass="ttdoc">Processes a sensor frame and updates the integrated pose.</div></div>
<divclass="ttc"id="aclassrtabmap_1_1Odometry_html_ac8992df0b92a86c10fe8e8da2b5f3627"><divclass="ttname"><ahref="classrtabmap_1_1Odometry.html#ac8992df0b92a86c10fe8e8da2b5f3627">rtabmap::Odometry::create</a></div><divclass="ttdeci">static Odometry * create(const ParametersMap &parameters=ParametersMap())</div><divclass="ttdoc">Creates an odometry instance from Parameters::kOdomStrategy() in parameters.</div></div>
<divclass="ttc"id="aclassrtabmap_1_1Rtabmap_html"><divclass="ttname"><ahref="classrtabmap_1_1Rtabmap.html">rtabmap::Rtabmap</a></div><divclass="ttdoc">Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).</div><divclass="ttdef"><b>Definition</b><ahref="Rtabmap_8h_source.html#l00193">Rtabmap.h:194</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1SensorData_html"><divclass="ttname"><ahref="classrtabmap_1_1SensorData.html">rtabmap::SensorData</a></div><divclass="ttdoc">Container class for all sensor data captured at a specific time.</div><divclass="ttdef"><b>Definition</b><ahref="SensorData_8h_source.html#l00096">SensorData.h:97</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1SensorData_html_a566e5600bc0369f2f88ff0c597cefcfb"><divclass="ttname"><ahref="classrtabmap_1_1SensorData.html#a566e5600bc0369f2f88ff0c597cefcfb">rtabmap::SensorData::stamp</a></div><divclass="ttdeci">double stamp() const</div><divclass="ttdoc">Returns the timestamp.</div><divclass="ttdef"><b>Definition</b><ahref="SensorData_8h_source.html#l00538">SensorData.h:538</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Statistics_html"><divclass="ttname"><ahref="classrtabmap_1_1Statistics.html">rtabmap::Statistics</a></div><divclass="ttdoc">Collects and manages runtime statistics for RTAB-Map.</div><divclass="ttdef"><b>Definition</b><ahref="Statistics_8h_source.html#l00107">Statistics.h:108</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Statistics_html_a775992631cd8d976a94ea6c1560dad0d"><divclass="ttname"><ahref="classrtabmap_1_1Statistics.html#a775992631cd8d976a94ea6c1560dad0d">rtabmap::Statistics::mapCorrection</a></div><divclass="ttdeci">const Transform & mapCorrection() const</div><divclass="ttdoc">Returns the map correction transform.</div><divclass="ttdef"><b>Definition</b><ahref="Statistics_8h_source.html#l00657">Statistics.h:657</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Transform_html"><divclass="ttname"><ahref="classrtabmap_1_1Transform.html">rtabmap::Transform</a></div><divclass="ttdoc">Represents a 3D rigid body transformation (rotation + translation).</div><divclass="ttdef"><b>Definition</b><ahref="Transform_8h_source.html#l00052">Transform.h:53</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Transform_html_a0d6a1985391a45de4fe208e58c51b9d2"><divclass="ttname"><ahref="classrtabmap_1_1Transform.html#a0d6a1985391a45de4fe208e58c51b9d2">rtabmap::Transform::isNull</a></div><divclass="ttdeci">bool isNull() const</div><divclass="ttdoc">Checks whether the transform is null (all zeros).</div></div>
</div><!-- fragment --><p>Throttling is the caller's job here: <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3"title="Main RTAB-Map iteration: ingests one sensor frame and updates the map.">rtabmap::Rtabmap::process()</a> maps every frame it is given. <aclass="el"href="classrtabmap_1_1RtabmapThread.html"title="Runs a Rtabmap instance in its own thread, driven by events.">rtabmap::RtabmapThread</a> does this same stamp comparison internally, from <aclass="el"href="classrtabmap_1_1Parameters.html#ab4330bb97358203a6e229a7e7d3b3160">Rtabmap/DetectionRate</a>, so the threaded pipeline only needs the parameter to be set.</p>
<p>Odometry drifts and the graph gets re-optimized, so the odometry pose is not a map pose. <aclass="el"href="classrtabmap_1_1Statistics.html#a775992631cd8d976a94ea6c1560dad0d"title="Returns the map correction transform.">rtabmap::Statistics::mapCorrection()</a> is what reconciles the two, and since it only changes on a map update it can be applied to every incoming frame – which is how the pose stays available at full rate while the map is built at 1 Hz. This is the transform published as <code>/map</code>→<code>/odom</code> by the ROS wrapper, and what the <code>MapBuilder</code> of each example composes with the live odometry pose to place the clouds. It is also readable outside the statistics, as <aclass="el"href="classrtabmap_1_1Rtabmap.html#a7b71f70a20f1ef42a65fa9571e254711">rtabmap::Rtabmap::getMapCorrection()</a>.</p>
<p>Complete programs live under <ahref="https://github.com/introlab/rtabmap/tree/master/examples"><code>examples/</code></a> in the source tree:</p>
<tableclass="markdownTable">
<trclass="markdownTableHead">
<thclass="markdownTableHeadNone">Example </th><thclass="markdownTableHeadNone">What it shows </th></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><ahref="https://github.com/introlab/rtabmap/blob/master/examples/BOWMapping/main.cpp">BOWMapping</a></td><tdclass="markdownTableBodyNone">The smallest useful loop: images from disk into <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a>, appearance-only loop closure detection (no odometry, no GUI) </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><ahref="https://github.com/introlab/rtabmap/blob/master/examples/NoEventsExample/main.cpp">NoEventsExample</a></td><tdclass="markdownTableBodyNone">Driving the pipeline by direct calls – camera, <aclass="el"href="classrtabmap_1_1Odometry.html"title="Abstract base class for visual, lidar and visual-inertial odometry backends.">rtabmap::Odometry</a> and <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a> in one explicit loop, without the event system </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><ahref="https://github.com/introlab/rtabmap/blob/master/examples/RGBDMapping/main.cpp">RGBDMapping</a></td><tdclass="markdownTableBodyNone">The threaded event-based pipeline (<aclass="el"href="classrtabmap_1_1SensorCaptureThread.html"title="Thread-based sensor data capture and event posting for RTAB-Map.">rtabmap::SensorCaptureThread</a>→<aclass="el"href="classrtabmap_1_1OdometryThread.html"title="Runs an Odometry front-end in its own thread, driven by events.">rtabmap::OdometryThread</a>→<aclass="el"href="classrtabmap_1_1RtabmapThread.html"title="Runs a Rtabmap instance in its own thread, driven by events.">rtabmap::RtabmapThread</a>) with any supported RGB-D or stereo camera </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><ahref="https://github.com/introlab/rtabmap/blob/master/examples/LidarMapping/main.cpp">LidarMapping</a></td><tdclass="markdownTableBodyNone">The same threaded pipeline driven by a 3D lidar (<aclass="el"href="classrtabmap_1_1LidarVLP16.html">rtabmap::LidarVLP16</a>) instead of a camera </td></tr>
</table>
<p>What each iteration does, and which parameters influence it, is documented on <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a> itself – memory update, loop-closure hypothesis, hypothesis selection, retrieval, proximity detection and transfer to long-term memory.</p>
<h1><aclass="anchor"id="autotoc_md1"></a>
Occupancy grid</h1>
<p>With <aclass="el"href="classrtabmap_1_1Parameters.html#ad46e3bb3b9e42c989763832a1f7b0f3e">RGBD/CreateOccupancyGrid</a> enabled, every node carries a local occupancy grid computed from its depth images or laser scan (<aclass="el"href="classrtabmap_1_1LocalGridMaker.html"title="Builds per-node local occupancy grids from laser scans or depth clouds.">rtabmap::LocalGridMaker</a>). Assembling those into a global grid is left to the caller, so that the result always follows the optimized poses:</p>
<divclass="ttc"id="aclassrtabmap_1_1LocalGridCache_html"><divclass="ttname"><ahref="classrtabmap_1_1LocalGridCache.html">rtabmap::LocalGridCache</a></div><divclass="ttdoc">Cache of LocalGrid entries keyed by map node id.</div><divclass="ttdef"><b>Definition</b><ahref="LocalGrid_8h_source.html#l00097">LocalGrid.h:98</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1LocalGridCache_html_a2e83e9c0c11051b5da84bf04b603a99b"><divclass="ttname"><ahref="classrtabmap_1_1LocalGridCache.html#a2e83e9c0c11051b5da84bf04b603a99b">rtabmap::LocalGridCache::add</a></div><divclass="ttdeci">void add(int nodeId, const cv::Mat &ground, const cv::Mat &obstacles, const cv::Mat &empty, float cellSize, const cv::Point3f &viewPoint=cv::Point3f(0, 0, 0))</div><divclass="ttdoc">Inserts or replaces the grid for nodeId (from separate cell mats).</div></div>
<divclass="ttc"id="aclassrtabmap_1_1SensorData_html_a51f21b98088ceec4c5d108d0fbe03200"><divclass="ttname"><ahref="classrtabmap_1_1SensorData.html#a51f21b98088ceec4c5d108d0fbe03200">rtabmap::SensorData::gridViewPoint</a></div><divclass="ttdeci">const cv::Point3f & gridViewPoint() const</div><divclass="ttdoc">Returns the occupancy grid viewpoint.</div><divclass="ttdef"><b>Definition</b><ahref="SensorData_8h_source.html#l00827">SensorData.h:827</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1SensorData_html_a984ce55b6b75152a63441bd07288dc6c"><divclass="ttname"><ahref="classrtabmap_1_1SensorData.html#a984ce55b6b75152a63441bd07288dc6c">rtabmap::SensorData::gridCellSize</a></div><divclass="ttdeci">float gridCellSize() const</div><divclass="ttdoc">Returns the occupancy grid cell size.</div><divclass="ttdef"><b>Definition</b><ahref="SensorData_8h_source.html#l00821">SensorData.h:821</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Signature_html"><divclass="ttname"><ahref="classrtabmap_1_1Signature.html">rtabmap::Signature</a></div><divclass="ttdoc">Represents a node in RTAB-Map's pose graph.</div><divclass="ttdef"><b>Definition</b><ahref="Signature_8h_source.html#l00083">Signature.h:84</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Signature_html_a24c257c2ff3fe156910ac82c41de8738"><divclass="ttname"><ahref="classrtabmap_1_1Signature.html#a24c257c2ff3fe156910ac82c41de8738">rtabmap::Signature::sensorData</a></div><divclass="ttdeci">SensorData & sensorData()</div><divclass="ttdoc">Returns mutable access to the sensor data.</div><divclass="ttdef"><b>Definition</b><ahref="Signature_8h_source.html#l00597">Signature.h:597</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Signature_html_a31c6e7b7e720eca20fb5935e0ee1d9f9"><divclass="ttname"><ahref="classrtabmap_1_1Signature.html#a31c6e7b7e720eca20fb5935e0ee1d9f9">rtabmap::Signature::id</a></div><divclass="ttdeci">int id() const</div><divclass="ttdoc">Returns the signature ID.</div><divclass="ttdef"><b>Definition</b><ahref="Signature_8h_source.html#l00168">Signature.h:168</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Statistics_html_a582cb4d6d0b3034062d508a6cac77081"><divclass="ttname"><ahref="classrtabmap_1_1Statistics.html#a582cb4d6d0b3034062d508a6cac77081">rtabmap::Statistics::getLastSignatureData</a></div><divclass="ttdeci">const Signature & getLastSignatureData() const</div><divclass="ttdoc">Returns the last signature data.</div><divclass="ttdef"><b>Definition</b><ahref="Statistics_8h_source.html#l00630">Statistics.h:630</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Statistics_html_acb80fff8690d88228ebda369e0e06289"><divclass="ttname"><ahref="classrtabmap_1_1Statistics.html#acb80fff8690d88228ebda369e0e06289">rtabmap::Statistics::poses</a></div><divclass="ttdeci">const std::map< int, Transform >& poses() const</div><divclass="ttdoc">Returns the pose graph.</div><divclass="ttdef"><b>Definition</b><ahref="Statistics_8h_source.html#l00642">Statistics.h:642</a></div></div>
</div><!-- fragment --><p>For the node that was just added, the cells are already there uncompressed, and <aclass="el"href="classrtabmap_1_1SensorData.html#a2e0be45871fa8dbce1c3cf727953358f"title="Uncompresses compressed data into provided output buffers (const version)">rtabmap::SensorData::uncompressDataConst()</a> returns them as they are – it only decompresses what comes back empty, which is what makes the same code work for a node retrieved from the database. The occupancy grid is kept on the published copy even with <aclass="el"href="classrtabmap_1_1Parameters.html#a1476c605d078b36f19b41617159fcc05">Rtabmap/PublishLastSignature</a> disabled (only images, scans and user data are dropped), precisely so that the global grid can still be assembled; statistics themselves must be published (<aclass="el"href="classrtabmap_1_1Parameters.html#ac946ad95d43dbfaaf3c38e0570cda48c">Rtabmap/PublishStats</a>, on by default). <aclass="el"href="classrtabmap_1_1OccupancyGrid.html">rtabmap::OccupancyGrid</a> is one of the <aclass="el"href="classrtabmap_1_1GlobalMap.html"title="Abstract base for assembling per-node LocalGrid data into a global map.">rtabmap::GlobalMap</a> back-ends: <aclass="el"href="classrtabmap_1_1OctoMap.html">rtabmap::OctoMap</a>, <aclass="el"href="classrtabmap_1_1CloudMap.html">rtabmap::CloudMap</a> and <aclass="el"href="classrtabmap_1_1GridMap.html">rtabmap::GridMap</a> consume the same cache the same way. Each example's <code>MapBuilder</code> does exactly this, then hands the result to the viewer.</p>
<p>For a 3D map, <aclass="el"href="classrtabmap_1_1CloudMap.html">rtabmap::CloudMap</a> assembles the very same cells into PCL clouds instead of a 2D grid. It shares the cache, so both can be kept up to date from one set of local grids:</p>
<divclass="line"><aclass="code hl_class"href="classrtabmap_1_1CloudMap.html">rtabmap::CloudMap</a> cloudMap(&localGrids, parameters); <spanclass="comment">// same cache as above</span></div>
<divclass="line"></div>
<divclass="line"><spanclass="comment">// ... right after the localGrids.add() of the block above:</span></div>
</div><!-- fragment --><p>The clouds are in the map frame and voxelized at <aclass="el"href="classrtabmap_1_1Parameters.html#a9ba0c8ad336348dd5a031bf858efb2d1">Grid/CellSize</a>. Points keep the colour of the local grid when it has one, otherwise ground is green and obstacles red. Note that this assembles the <em>cells</em>, not the raw sensor clouds: with <aclass="el"href="classrtabmap_1_1Parameters.html#a9cc690fcb9e611d424ad844ae825ccfd">Grid/3D</a> disabled they are flattened onto the xy plane, so it must stay enabled for a 3D result.</p>
<p>For a full-resolution cloud, assemble the nodes themselves rather than their cells. Ask <aclass="el"href="classrtabmap_1_1Rtabmap.html#a456fa0c95770f052d78f6d9f745fa1e3"title="Extracts a full snapshot of the current pose graph.">rtabmap::Rtabmap::getGraph()</a> for the optimized poses along with the node data, then rebuild a cloud per node and transform it to its pose:</p>
<divclass="line"><aclass="code hl_class"href="classrtabmap_1_1SensorData.html">rtabmap::SensorData</a> data = nodes.at(iter->first).sensorData();</div>
<divclass="line">assembled = <aclass="code hl_function"href="group__VoxelFiltering.html#gad8d88a06174857cf53b1dc2cf2310d89">rtabmap::util3d::voxelize</a>(assembled, 0.01f); <spanclass="comment">// one last pass over the overlaps</span></div>
<divclass="ttc"id="aclassrtabmap_1_1SensorData_html_aa356c9d5e9e7ea55ccdbe99c215bcb52"><divclass="ttname"><ahref="classrtabmap_1_1SensorData.html#aa356c9d5e9e7ea55ccdbe99c215bcb52">rtabmap::SensorData::uncompressData</a></div><divclass="ttdeci">void uncompressData()</div><divclass="ttdoc">Uncompresses all compressed data in-place.</div></div>
<divclass="ttc"id="agroup__VoxelFiltering_html_gad8d88a06174857cf53b1dc2cf2310d89"><divclass="ttname"><ahref="group__VoxelFiltering.html#gad8d88a06174857cf53b1dc2cf2310d89">rtabmap::util3d::voxelize</a></div><divclass="ttdeci">pcl::PointCloud< pcl::PointXYZ >::Ptr RTABMAP_CORE_EXPORT voxelize(const pcl::PointCloud< pcl::PointXYZ >::Ptr &cloud, const pcl::IndicesPtr &indices, float voxelSize)</div><divclass="ttdoc">Performs voxel grid downsampling on a point cloud of type pcl::PointXYZ on provided indices.</div></div>
<divclass="ttc"id="anamespacertabmap_1_1util3d_html_a29ece82e01f041cab271fe9322cf9745"><divclass="ttname"><ahref="namespacertabmap_1_1util3d.html#a29ece82e01f041cab271fe9322cf9745">rtabmap::util3d::cloudRGBFromSensorData</a></div><divclass="ttdeci">pcl::PointCloud< pcl::PointXYZRGB >::Ptr RTABMAP_CORE_EXPORT cloudRGBFromSensorData(const SensorData &sensorData, int decimation=1, float maxDepth=0.0f, float minDepth=0.0f, std::vector< int > *validIndices=0, const ParametersMap &stereoParameters=ParametersMap(), const std::vector< float >&roiRatios=std::vector< float >(), unsigned char confidenceThr=0)</div><divclass="ttdoc">Generates a point cloud of type pcl::PointXYZRGB from sensor data.</div></div>
</div><!-- fragment --><dlclass="section note"><dt>Note</dt><dd>Do this once the session is over, not on every iteration. It decompresses and re-projects every node, so the cost grows with the whole map, and the poses are only worth exporting once the graph has been optimized – the same cloud assembled mid-session would carry the drift that later loop closures correct. This is what <aclass="el"href="tools.html#tool_export">rtabmap-export</a> does, with more filtering options.</dd></dl>
<h1><aclass="anchor"id="autotoc_md2"></a>
Memory management</h1>
<p>RTAB-Map keeps the map in three tiers (<aclass="el"href="classrtabmap_1_1Memory.html"title="Three-tiered memory management (STM, WM, LTM) for RTAB-Map.">rtabmap::Memory</a>): a <b>short-term memory</b> of the last <aclass="el"href="classrtabmap_1_1Parameters.html#a46dc1a24b02bb00014262f7f4d818a49">Mem/STMSize</a> nodes, where neighbours are too similar to be loop closure candidates; a <b>working memory</b> holding everything loop closure detection compares against; and a <b>long-term memory</b>, the part of the map that stays in the database and is not searched.</p>
<p>By default nothing leaves the working memory, so the iteration time grows with the map. Memory management caps it, and is enabled by setting a budget – either one, or both:</p>
<divclass="ttc"id="aclassrtabmap_1_1Parameters_html_a66882ccd6f0a49f2c23db8718d12a59c"><divclass="ttname"><ahref="classrtabmap_1_1Parameters.html#a66882ccd6f0a49f2c23db8718d12a59c">rtabmap::Parameters::kRtabmapMemoryThr</a></div><divclass="ttdeci">static std::string kRtabmapMemoryThr()</div><divclass="ttdoc">Key of parameter Rtabmap/MemoryThr : uFormat("Maximum nodes in the Working Memory (0 means infinity)....</div><divclass="ttdef"><b>Definition</b><ahref="Parameters_8h_source.html#l00193">Parameters.h:193</a></div></div>
<divclass="ttc"id="aclassrtabmap_1_1Parameters_html_a8ee7e153cfb26574c7d1c7b427593f8a"><divclass="ttname"><ahref="classrtabmap_1_1Parameters.html#a8ee7e153cfb26574c7d1c7b427593f8a">rtabmap::Parameters::kRtabmapTimeThr</a></div><divclass="ttdeci">static std::string kRtabmapTimeThr()</div><divclass="ttdoc">Key of parameter Rtabmap/TimeThr : "Maximum time allowed for map update (ms) (0 means infinity)....</div><divclass="ttdef"><b>Definition</b><ahref="Parameters_8h_source.html#l00192">Parameters.h:192</a></div></div>
<divclass="ttc"id="anamespacertabmap_html_a4d38c2e87cb7a46dc4299f7bd4d95a01"><divclass="ttname"><ahref="namespacertabmap.html#a4d38c2e87cb7a46dc4299f7bd4d95a01">rtabmap::ParametersPair</a></div><divclass="ttdeci">std::pair< std::string, std::string > ParametersPair</div><divclass="ttdoc">A single parameter key/value pair, the entry type of ParametersMap.</div><divclass="ttdef"><b>Definition</b><ahref="Parameters_8h_source.html#l00046">Parameters.h:46</a></div></div>
<divclass="ttc"id="anamespacertabmap_html_ad08b6f1796a27dd7316c99c385e2cc55"><divclass="ttname"><ahref="namespacertabmap.html#ad08b6f1796a27dd7316c99c385e2cc55">rtabmap::ParametersMap</a></div><divclass="ttdeci">std::map< std::string, std::string > ParametersMap</div><divclass="ttdoc">Parameter keys mapped to their values, as used by every configurable class (see Parameters).</div><divclass="ttdef"><b>Definition</b><ahref="Parameters_8h_source.html#l00044">Parameters.h:44</a></div></div>
</div><!-- fragment --><p>When an iteration goes over budget, the nodes of lowest weight are moved to the long-term memory at the end of it – age only breaks ties between equal weights, so it is not simply the oldest that go. Weight is how often a place has been seen: while a node is still in the short-term memory, a new node similar enough to it (<aclass="el"href="classrtabmap_1_1Parameters.html#a634f4790c9c84772935bf406265bc692">Mem/RehearsalSimilarity</a>) is merged into it and raises its weight – the rehearsal mechanism. Places the robot dwells on or revisits therefore stay in the working memory, while views seen once leave first. They are not lost: when a loop closure is found, their neighbours are brought back into the working memory for the next iterations, up to <aclass="el"href="classrtabmap_1_1Parameters.html#ae42b8a843c6830eff62087a9e0df72b1">Rtabmap/MaxRetrieved</a> nodes (plus <aclass="el"href="classrtabmap_1_1Parameters.html#a0ba27238802e7bbd1a7c0327bbc11d99">RGBD/MaxLocalRetrieved</a> around the current pose and along a planned path). This is what makes long-term mapping practical: the robot keeps a bounded, relevant working set and pulls the rest back as it recognizes where it is. Retrieval and node immunization only run when memory management is on.</p>
<p>Which nodes go first is controlled by three parameters: <aclass="el"href="classrtabmap_1_1Parameters.html#a4459441e2574e19b15fedb9cb0bc3fd9">Mem/RecentWmRatio</a> protects the most recent part of the working memory, <aclass="el"href="classrtabmap_1_1Parameters.html#a7197e89c24af786042c4f3854c14627f">RGBD/LocalImmunizationRatio</a> protects the nodes around the current pose, and <aclass="el"href="classrtabmap_1_1Parameters.html#aea65d81db6cbca6869d7ee1b8e1003a7">Mem/TransferSortingByWeightId</a> selects the ordering. The step-by-step behaviour is documented on <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a> (steps 4 and 6), and the <code>Memory/Working_memory_size</code> and <code>Memory/Signatures_retrieved</code> entries of <aclass="el"href="classrtabmap_1_1Statistics.html"title="Collects and manages runtime statistics for RTAB-Map.">rtabmap::Statistics</a> report what happens at runtime.</p>
<h1><aclass="anchor"id="autotoc_md3"></a>
Configuration</h1>
<p>Every parameter is a string key/value pair in a <aclass="el"href="namespacertabmap.html#ad08b6f1796a27dd7316c99c385e2cc55"title="Parameter keys mapped to their values, as used by every configurable class (see Parameters).">rtabmap::ParametersMap</a>, declared with its default and description in <code><aclass="el"href="Parameters_8h_source.html">Parameters.h</a></code> (for example <code>Parameters::kMemSTMSize()</code>, <code>Parameters::kRGBDLinearUpdate()</code>). The same keys are used by the applications, the ROS wrappers and the <code>--Param value</code> command-line arguments of the tools, so a setting found here applies everywhere.</p>
<p>The <aclass="el"href="parameters.html">Parameter reference</a> lists all of them, grouped, with their type, default value and description.</p>
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">rtabmap::Rtabmap</a></td><tdclass="markdownTableBodyNone">The entry point: one SLAM iteration per call, owning everything below </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Memory.html"title="Three-tiered memory management (STM, WM, LTM) for RTAB-Map.">rtabmap::Memory</a></td><tdclass="markdownTableBodyNone">Three-tiered memory (STM / WM / LTM) holding the map and deciding what stays online </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Signature.html"title="Represents a node in RTAB-Map's pose graph.">rtabmap::Signature</a></td><tdclass="markdownTableBodyNone">One node: sensor data, visual words, pose and links </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Link.html"title="Directed constraint between two nodes in RTAB-Map's pose graph.">rtabmap::Link</a></td><tdclass="markdownTableBodyNone">One edge: neighbour, loop closure, landmark or prior constraint </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1DBDriver.html"title="Abstract database driver for RTAB-Map maps (signatures, links, words, statistics).">rtabmap::DBDriver</a></td><tdclass="markdownTableBodyNone">Persistence of the map to the database (see <aclass="el"href="classrtabmap_1_1DBDriverSqlite3.html"title="SQLite3 implementation of DBDriver for RTAB-Map map databases.">rtabmap::DBDriverSqlite3</a>) </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Statistics.html"title="Collects and manages runtime statistics for RTAB-Map.">rtabmap::Statistics</a></td><tdclass="markdownTableBodyNone">Everything the pipeline reports about an iteration </td></tr>
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">rtabmap::SensorData</a></td><tdclass="markdownTableBodyNone">An observation: images, depth, laser scan, IMU, GPS, landmarks </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1CameraModel.html"title="Represents a pinhole camera model containing intrinsic and extrinsic parameters, used for projection,...">rtabmap::CameraModel</a>, <aclass="el"href="classrtabmap_1_1StereoCameraModel.html"title="A class representing a calibrated stereo camera system.">rtabmap::StereoCameraModel</a></td><tdclass="markdownTableBodyNone">Intrinsics, extrinsics and rectification </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1LaserScan.html"title="Represents 2D or 3D laser scan data with support for multiple point data formats.">rtabmap::LaserScan</a></td><tdclass="markdownTableBodyNone">Point cloud / laser scan container and its formats </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">rtabmap::Transform</a></td><tdclass="markdownTableBodyNone">The 3D rigid transform used everywhere in the API </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1SensorCapture.html"title="Abstract base class for sensor data capture (cameras, lidars, etc.)">rtabmap::SensorCapture</a>, <aclass="el"href="classrtabmap_1_1SensorCaptureThread.html"title="Thread-based sensor data capture and event posting for RTAB-Map.">rtabmap::SensorCaptureThread</a></td><tdclass="markdownTableBodyNone">Drivers and the thread that pumps them </td></tr>
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Odometry.html"title="Abstract base class for visual, lidar and visual-inertial odometry backends.">rtabmap::Odometry</a></td><tdclass="markdownTableBodyNone">Visual / lidar odometry front-ends </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Registration.html"title="Abstract base for registering two observations (visual, ICP, or both).">rtabmap::Registration</a>, <aclass="el"href="classrtabmap_1_1RegistrationVis.html"title="Visual registration between two signatures using features and geometry.">rtabmap::RegistrationVis</a>, <aclass="el"href="classrtabmap_1_1RegistrationIcp.html">rtabmap::RegistrationIcp</a></td><tdclass="markdownTableBodyNone">Relative transform between two nodes </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Optimizer.html"title="Abstract base for pose-graph and bundle-adjustment optimizers.">rtabmap::Optimizer</a></td><tdclass="markdownTableBodyNone">Graph optimization back-ends (g2o, GTSAM, Ceres, TORO) </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1Feature2D.html"title="Abstract 2D feature detector and descriptor extractor for visual SLAM.">rtabmap::Feature2D</a>, <aclass="el"href="classrtabmap_1_1VWDictionary.html"title="Manages a dictionary of visual words for visual place recognition and loop closure detection.">rtabmap::VWDictionary</a></td><tdclass="markdownTableBodyNone">Keypoint detectors/descriptors and the bag-of-words dictionary </td></tr>
<trclass="markdownTableRowOdd">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1BayesFilter.html"title="Recursive Bayesian filter for loop-closure hypothesis estimation in RTAB-Map.">rtabmap::BayesFilter</a></td><tdclass="markdownTableBodyNone">Loop-closure hypothesis estimation </td></tr>
<trclass="markdownTableRowEven">
<tdclass="markdownTableBodyNone"><aclass="el"href="classrtabmap_1_1LocalGridMaker.html"title="Builds per-node local occupancy grids from laser scans or depth clouds.">rtabmap::LocalGridMaker</a>, <aclass="el"href="classrtabmap_1_1GlobalMap.html"title="Abstract base for assembling per-node LocalGrid data into a global map.">rtabmap::GlobalMap</a></td><tdclass="markdownTableBodyNone">Occupancy grid generation and assembly </td></tr>
</table>
<p>Free functions for point cloud, image and geometry processing are grouped in <code><aclass="el"href="util2d_8h_source.html">util2d.h</a></code>, <code><aclass="el"href="util3d_8h_source.html">util3d.h</a></code>, <code><aclass="el"href="util3d__filtering_8h_source.html">util3d_filtering.h</a></code>, <code><aclass="el"href="util3d__registration_8h_source.html">util3d_registration.h</a></code>, <code><aclass="el"href="util3d__surface_8h_source.html">util3d_surface.h</a></code>, <code><aclass="el"href="util3d__transforms_8h_source.html">util3d_transforms.h</a></code> and <code><aclass="el"href="util3d__mapping_8h_source.html">util3d_mapping.h</a></code>. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<ul>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.9.8 </li>