<trclass="memdesc:ad7f085b6ae0fd3c7077c500c028fd5c3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Main RTAB-Map iteration: ingests one sensor frame and updates the map. <br/></td></tr>
<trclass="memdesc:a91cedf4574a557cadf6daded489e4dbe"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Convenience overload: builds a diagonal covariance from scalar variances. <br/></td></tr>
<trclass="memdesc:a711c479925db2c9f8201aacffe70281b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Initializes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> with parameters and a database. <br/></td></tr>
<trclass="memdesc:a25bfb157aa3be3bd3c8a1d4200329041"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Initializes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> from a configuration file and a database. <br/></td></tr>
<trclass="memdesc:a5e0b2eada8ae885e45df23165bb91d2f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Closes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> and releases the underlying <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a>. <br/></td></tr>
<trclass="memitem:ae3d40ed4ee48954e70d45e0779c24a49"id="r_ae3d40ed4ee48954e70d45e0779c24a49"><tdclass="memItemLeft"align="right"valign="top">std::list< int > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#ae3d40ed4ee48954e70d45e0779c24a49">getWM</a> () const</td></tr>
<trclass="memitem:a809673c3d0e6d8fb05ebb4a52218d438"id="r_a809673c3d0e6d8fb05ebb4a52218d438"><tdclass="memItemLeft"align="right"valign="top">std::set< int > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a809673c3d0e6d8fb05ebb4a52218d438">getSTM</a> () const</td></tr>
<trclass="memdesc:a80add8fadd488d0c7781c249abea0d5d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the per-iteration time budget (ms). <br/></td></tr>
<trclass="memdesc:a6915ee0137b949837addcb5d3ac1646c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the maximum number of signatures kept in WM (0 = unbounded). <br/></td></tr>
<trclass="memdesc:a9a9321531773f37cd5d7740495ede47f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the localization prior pose used to seed the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call (localization mode only). <br/></td></tr>
<trclass="memdesc:a4ab6de2be120bbda75577911d52346d4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Starts a new map session (next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> will create a fresh map id). <br/></td></tr>
<trclass="memdesc:af1fe8ed393237bc9ffa1ea93adf0ec9b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Assigns or clears a label on signature <code>id</code>. <br/></td></tr>
<trclass="memdesc:a037ddb5d737e0466d7610b88d8429bd6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Attaches user data to signature <code>id</code>, compressing it on the fly if needed. <br/></td></tr>
<trclass="memitem:a3c32f64acd943c676a9b11c7dbd3a5ae"id="r_a3c32f64acd943c676a9b11c7dbd3a5ae"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a3c32f64acd943c676a9b11c7dbd3a5ae">generateDOTGraph</a> (const std::string &path, int id=0, int margin=5)</td></tr>
<trclass="memdesc:a3c32f64acd943c676a9b11c7dbd3a5ae"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Writes a Graphviz DOT file of the pose graph. <br/></td></tr>
<trclass="memitem:aeffdfc811a178ba2e55205b746a6ea71"id="r_aeffdfc811a178ba2e55205b746a6ea71"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#aeffdfc811a178ba2e55205b746a6ea71">exportPoses</a> (const std::string &path, bool optimized, bool global, int format)</td></tr>
<trclass="memdesc:aeffdfc811a178ba2e55205b746a6ea71"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Exports the current pose graph to a text file. <br/></td></tr>
<trclass="memdesc:af12ae46226f33adf8c4cafbe1bcf544c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clears all in-memory state and resets the database. <br/></td></tr>
<trclass="memdesc:ad0c040e54bbca27dffc46346d96c57cb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Dumps the Bayes-filter prediction matrix to a file in the working directory. <br/></td></tr>
<trclass="memdesc:a38db1c80ae583e255dd6174ba6d41ffc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Dumps the <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> state (signatures, words, dictionary) to the working directory. <br/></td></tr>
<trclass="memdesc:a5a461ed88e83d2dbebee819ab6690e7a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Re-parses parameters and propagates them to owned sub-objects (<aclass="el"href="classrtabmap_1_1Memory.html">Memory</a>, <aclass="el"href="classrtabmap_1_1BayesFilter.html">BayesFilter</a>, <aclass="el"href="classrtabmap_1_1Optimizer.html">Optimizer</a>, ...). <br/></td></tr>
<trclass="memdesc:a25028c3e8d8018c03f47f06150d76eab"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the working directory used for dumps, logs and temporary files. <br/></td></tr>
<trclass="memdesc:ab04bd616db9107a705faf5b3395a73d3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Removes the loop-closure link added at the last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> iteration. <br/></td></tr>
<trclass="memdesc:aee23115b4bd02bce5d1721418a0f7599"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deletes the most recent (non-intermediate) location from the map. <br/></td></tr>
<trclass="memdesc:a7a841702b925777620714fce7b41fd69"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Replaces the current optimized poses and constraints with externally provided ones. <br/></td></tr>
<trclass="memdesc:a7133d8efa98410eaec68e0199ff98a0c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a copy of signature <code>id</code> with optional payloads attached. <br/></td></tr>
<trclass="memdesc:ae617c65a0ba6f95a321b8c0c3a18b0e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Deprecated: use <aclass="el"href="classrtabmap_1_1Rtabmap.html#a456fa0c95770f052d78f6d9f745fa1e3">getGraph()</a> instead with <code>withImages=true</code>, <code>withScan=true</code>, <code>withUserData=true</code> and <code>withGrid=true</code>. <br/></td></tr>
<trclass="memdesc:a456fa0c95770f052d78f6d9f745fa1e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Extracts a full snapshot of the current pose graph. <br/></td></tr>
<trclass="memdesc:a1a6498f60f52f65ffbed2d89d7c20648"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns optimized poses within a metric radius of <code>pose</code>. <br/></td></tr>
<trclass="memdesc:a9bd263bbcdbc6f41119f8532131db974"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns optimized poses within a metric radius of node <code>nodeId</code>. <br/></td></tr>
<trclass="memitem:a600d86ab2a67fa08d6a1e726380948ea"id="r_a600d86ab2a67fa08d6a1e726380948ea"><tdclass="memItemLeft"align="right"valign="top">int </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a600d86ab2a67fa08d6a1e726380948ea">detectMoreLoopClosures</a> (float clusterRadiusMax=0.5f, float clusterAngle=M_PI/6.0f, int iterations=1, bool intraSession=true, bool interSession=true, const <aclass="el"href="classrtabmap_1_1ProgressState.html">ProgressState</a> *state=0, float clusterRadiusMin=0.0f, int toFromMapId=-1)</td></tr>
<trclass="memdesc:a600d86ab2a67fa08d6a1e726380948ea"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Post-processing: searches for additional loop closures over the existing graph. <br/></td></tr>
<trclass="memitem:ab1044f290653749990018ca5722f00c7"id="r_ab1044f290653749990018ca5722f00c7"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#ab1044f290653749990018ca5722f00c7">globalBundleAdjustment</a> (int optimizerType=1, bool rematchFeatures=true, int iterations=0, float pixelVariance=0.0f)</td></tr>
<trclass="memdesc:ab1044f290653749990018ca5722f00c7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Runs a global bundle adjustment over the optimized graph. <br/></td></tr>
<trclass="memdesc:ac7de2278aa53a315a63bec05c1f0a15f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Filters spurious obstacles from every node's local grid using a reference 2D map. <br/></td></tr>
<trclass="memdesc:a6650c241bd6a89f66718ce7a227dfe10"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Re-runs registration on every link of the current graph and updates the ones that converge. <br/></td></tr>
<trclass="memdesc:aef03c0d6ee1ef5646ba11be5dbe9faa5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds an external link to the map. <br/></td></tr>
<trclass="memdesc:aeea47830776fe57c456ae6a673069ddc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Converts an odometry covariance into an information matrix, clipping by <aclass="el"href="classrtabmap_1_1Memory.html#ae37d02a779acb85797de25da36066829">Memory::getOdomMaxInf()</a> when <aclass="el"href="classrtabmap_1_1Parameters.html#a2f0e34d58229d94e6368223be2dd4fc6">Parameters::kRGBDLoopCovLimited()</a> is enabled. <br/></td></tr>
<trclass="memitem:a0d2caf505525f635bda914e73aa59232"id="r_a0d2caf505525f635bda914e73aa59232"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a0d2caf505525f635bda914e73aa59232">addNodesToRepublish</a> (const std::vector< int >&ids)</td></tr>
<trclass="memdesc:a0d2caf505525f635bda914e73aa59232"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Marks node ids whose data should be re-emitted on the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a>. <br/></td></tr>
<trclass="memdesc:a4d351e3f5ef809460afbb5a7702a500d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Loads the visual word dictionary as ids only, without descriptors. <br/></td></tr>
<trclass="memdesc:a589cd696bffe53a5e00898631e7d9103"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Clears the current path and sets its terminal status. <br/></td></tr>
<trclass="memdesc:ab797f7f5bb73a507ba4d4672cd5476df"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Plans a path from the current location to node <code>targetNode</code>. <br/></td></tr>
<trclass="memdesc:a14d5c84b61386e95071e90aba406ff49"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Plans a path in the current optimized map toward a metric goal pose. <br/></td></tr>
<trclass="memitem:a45addb0848702b39c67c2394dd62f739"id="r_a45addb0848702b39c67c2394dd62f739"><tdclass="memItemLeft"align="right"valign="top">std::vector< int > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a45addb0848702b39c67c2394dd62f739">getPathNextNodes</a> () const</td></tr>
<trclass="memitem:a8400ccecd090cb438d16178930fe0872"id="r_a8400ccecd090cb438d16178930fe0872"><tdclass="memItemLeft"align="right"valign="top">std::map< int, <aclass="el"href="classrtabmap_1_1Transform.html">Transform</a>> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classrtabmap_1_1Rtabmap.html#a8400ccecd090cb438d16178930fe0872">getForwardWMPoses</a> (int fromId, int maxNearestNeighbors, float radius, int maxDiffID) const</td></tr>
<trclass="memdesc:a8400ccecd090cb438d16178930fe0872"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns optimized poses of WM nodes located in front of <code>fromId</code>. <br/></td></tr>
<trclass="memdesc:ad314edf995555480a2db1aceb7fd2ee7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Segments a set of optimized poses into paths connected by neighbor links. <br/></td></tr>
<trclass="memdesc:aad648f09bb04b193907528987ccda413"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Applies the standard RTAB-Map likelihood adjustment. <br/></td></tr>
<divclass="textblock"><p>Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure). </p>
<p><aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> orchestrates the full SLAM iteration. Each new sensor observation passed to <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> goes through the steps described below.</p>
<p>Done via <aclass="el"href="classrtabmap_1_1Memory.html#a3c029b2788f3b599480d5150120a6bee">Memory::update()</a>: a new <aclass="el"href="classrtabmap_1_1Signature.html">Signature</a> is added to STM, the oldest STM entry is promoted to WM if STM is full, and rehearsal compares the new signature to the previous STM signature.</p>
<p>When the robot barely moved since the previous frame (odometry displacement below <aclass="el"href="classrtabmap_1_1Parameters.html#a2337801b29bb94ce58ae386c6fbfb1ea">Parameters::kRGBDLinearUpdate()</a> and <aclass="el"href="classrtabmap_1_1Parameters.html#a9a7fc32cc99f77446f1918113aa8b5bb">Parameters::kRGBDAngularUpdate()</a>), the iteration is flagged as a "small displacement":</p><ul>
<li>If a loop closure or localization was already accepted on a recent iteration, appearance-based global loop-closure detection and proximity detection by space are both skipped to avoid wasting work while the robot is stationary at an already-known location (only retrieval runs).</li>
<li>Otherwise (no recent loop closure / localization), both still run normally so a first-time loop closure can still be detected from a standstill.</li>
</ul>
<p>In either case, at the end of the iteration, if no loop closure, proximity detection or landmark observation latched onto the new node, it is deleted from <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> so the map does not grow while the robot is idle.</p>
<p>Rehearsal still runs first, so visually similar consecutive idle frames may also be merged into the previous STM signature (its weight is incremented and the new signature is discarded) when the similarity exceeds <aclass="el"href="classrtabmap_1_1Parameters.html#a634f4790c9c84772935bf406265bc692">Parameters::kMemRehearsalSimilarity()</a>.</p>
<p>Scored via <aclass="el"href="classrtabmap_1_1Memory.html#a984ca01a87434b11a66dc1d96e2fff17">Memory::computeLikelihood()</a> and the recursive <aclass="el"href="classrtabmap_1_1BayesFilter.html">BayesFilter</a> (prior + observation update).</p>
<p>The highest posterior is compared against the loop-closure threshold (<aclass="el"href="classrtabmap_1_1Parameters.html#a423d0878fce30f6ad8a0da41b27f6505">Parameters::kRtabmapLoopThr()</a>); if accepted, the loop-closure link is added and the pose graph is re-optimized by <aclass="el"href="classrtabmap_1_1Optimizer.html">Optimizer</a>.</p>
<p>In <b>RGB-D mode</b>, two extra checks must pass before the link is committed:</p><ul>
<li>a valid geometric transform must be computed between the two candidate nodes by the registration pipeline (visual + optional ICP, see <aclass="el"href="classrtabmap_1_1Memory.html#a4ae0287262c04905baab2d6f94448486">Memory::computeTransform()</a>);</li>
<li>the resulting transform must not be rejected by the graph-optimization consistency check (see <aclass="el"href="classrtabmap_1_1Parameters.html#a48e9bda458af10a4649c88b92ba7a6fd">Parameters::kRGBDOptimizeMaxError()</a>).</li>
</ul>
<p>The optimization used by the consistency check depends on the operating mode:</p><ul>
<li>In <b>mapping mode</b>, the local map is re-optimized around the current signature including the new link, then <aclass="el"href="namespacertabmap_1_1graph.html#a4691b760dfafe6d93de514c96fa55e0e">graph::computeMaxGraphErrors()</a> measures the worst per-link residual / its standard deviation. If the ratio exceeds <aclass="el"href="classrtabmap_1_1Parameters.html#a48e9bda458af10a4649c88b92ba7a6fd">Parameters::kRGBDOptimizeMaxError()</a>, the loop closure(s) added this iteration are removed from <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a>.</li>
<li>In <b>localization mode</b>, optimization is run on a sub-graph composed of the odometry cache (<aclass="el"href="classrtabmap_1_1Parameters.html#ab27d52631ccdf0055b55fee66f811cd7">Parameters::kRGBDMaxOdomCacheSize()</a>), the newly added localization link and pose priors fixing the map nodes (with the variance set from <aclass="el"href="classrtabmap_1_1Parameters.html#aa8bd1ce286f5afde20a406b573286adb">Parameters::kRGBDLocalizationPriorError()</a>). The same error-ratio check is applied; on failure the localization is rejected for this iteration but the persisted map and its links are left untouched.</li>
</ul>
<p>In both modes, if the same link is rejected twice in a row, a graph repair may also be attempted (within <aclass="el"href="classrtabmap_1_1Parameters.html#aa2135c05c99fdb3b5f257f1162779e31">Parameters::kRGBDOptimizeMaxErrorRepairRadius()</a>) to drop the offending link instead of the new candidate.</p>
<p>If either RGB-D check fails, the candidate is discarded and no link is added.</p>
<p>Once a loop-closure hypothesis is selected, neighbors of the matched node are brought back from LTM into WM via <aclass="el"href="classrtabmap_1_1Memory.html#aa244b8581684b85e35d2056cf972e377">Memory::reactivateSignatures()</a>, so the next iteration can compare against them too. Up to <aclass="el"href="classrtabmap_1_1Parameters.html#ae42b8a843c6830eff62087a9e0df72b1">Parameters::kRtabmapMaxRetrieved()</a> nodes are pulled per iteration; nodes around the current path or local pose may also be retrieved (capped by <aclass="el"href="classrtabmap_1_1Parameters.html#a0ba27238802e7bbd1a7c0327bbc11d99">Parameters::kRGBDMaxLocalRetrieved()</a>).</p>
<p>Retrieval (and the related node immunization) is only active when memory management is enabled, i.e. when <aclass="el"href="classrtabmap_1_1Parameters.html#a8ee7e153cfb26574c7d1c7b427593f8a">Parameters::kRtabmapTimeThr()</a> or <aclass="el"href="classrtabmap_1_1Parameters.html#a66882ccd6f0a49f2c23db8718d12a59c">Parameters::kRtabmapMemoryThr()</a> is non-zero.</p>
<p>Visual and scan-based local matches to nearby nodes, used in addition to the appearance-based loop closure.</p>
<p>Candidate proximity links go through the same two RGB-D gates as loop closures above: a valid geometric transform must be computed by the registration pipeline, and the transform must not be rejected by the graph-optimization consistency check.</p>
<dlclass="section user"><dt>6. Transfer (WM to LTM)</dt><dd></dd></dl>
<p>At the end of the iteration, if the iteration exceeded the configured time budget (<aclass="el"href="classrtabmap_1_1Parameters.html#a8ee7e153cfb26574c7d1c7b427593f8a">Parameters::kRtabmapTimeThr()</a>) or WM exceeded its size budget (<aclass="el"href="classrtabmap_1_1Parameters.html#a66882ccd6f0a49f2c23db8718d12a59c">Parameters::kRtabmapMemoryThr()</a>), <aclass="el"href="classrtabmap_1_1Memory.html#a51e89ccab2261912b09a5b7178fdd46c">Memory::forget()</a> moves the oldest low-frequency signatures from WM to LTM (immunized nodes – retrieved neighbors, the last localization node, etc. – are kept in WM).</p>
<p>Transfer is skipped when both thresholds are 0 (memory management disabled).</p>
<p>Selected by <aclass="el"href="classrtabmap_1_1Parameters.html#acdc74cd2b096ba28d9c1e00040b69d42">Parameters::kMemIncrementalMemory()</a> (see <aclass="el"href="classrtabmap_1_1Memory.html#a420ddb38a3ffefafc84d22b0dd3b3814">Memory::isIncremental()</a>):</p><ul>
<li><b>Mapping</b>: STM and WM grow; loop closures update the optimized graph.</li>
<li><b>Localization</b>: STM/WM are frozen; the current node is matched against the persisted map and only <aclass="el"href="classrtabmap_1_1Rtabmap.html#a2d2efac02d4a6d1d7bbc505d94fd634b">getLastLocalizationPose()</a> is updated.</li>
<p><aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> also exposes basic graph-based path planning in RGB-D mode (<aclass="el"href="classrtabmap_1_1Rtabmap.html#ab797f7f5bb73a507ba4d4672cd5476df">computePath()</a>, <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5fe89ac87283a92258d27f42eb7b13f1">getPath()</a>, <aclass="el"href="classrtabmap_1_1Rtabmap.html#afe4aa4f9a67ba85b60c7dfda86d0131b">getPathStatus()</a>), used by the GUI to navigate between mapped locations.</p>
<p>When memory management is enabled (see step 4 Retrieval and step 6 Transfer), the retrieval step also pulls nodes along the currently planned path back from LTM into WM (capped by <aclass="el"href="classrtabmap_1_1Parameters.html#a0ba27238802e7bbd1a7c0327bbc11d99">Parameters::kRGBDMaxLocalRetrieved()</a>) so the robot is able to re-localize against upcoming waypoints as it follows the path, even when those nodes had been transferred out of WM earlier.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Memory.html"title="Three-tiered memory management (STM, WM, LTM) for RTAB-Map.">Memory</a></dd>
<dd>
<aclass="el"href="classrtabmap_1_1BayesFilter.html"title="Recursive Bayesian filter for loop-closure hypothesis estimation in RTAB-Map.">BayesFilter</a></dd>
<dd>
<aclass="el"href="classrtabmap_1_1Optimizer.html"title="Abstract base for pose-graph and bundle-adjustment optimizers.">Optimizer</a></dd>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00193">193</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<tr><thcolspan="2">Enumerator</th></tr><tr><tdclass="fieldname"><aid="afa134603fb0835b84f269e48e7ab568caea5e55cc106979d91f695c064a78926b"name="afa134603fb0835b84f269e48e7ab568caea5e55cc106979d91f695c064a78926b"></a>kVhNone </td><tdclass="fielddoc"><p>No verification: the highest hypothesis above threshold is accepted. </p>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00197">197</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Main RTAB-Map iteration: ingests one sensor frame and updates the map. </p>
<p>Adds <code>data</code> to <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a>, runs the Bayes filter on the current likelihood, selects a loop-closure hypothesis if any, performs proximity detection, re-optimizes the graph as needed, and refreshes <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5d18002c7eb7cee234471686413d201c">getStatistics()</a> and <aclass="el"href="classrtabmap_1_1Rtabmap.html#a2d2efac02d4a6d1d7bbc505d94fd634b">getLastLocalizationPose()</a>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">data</td><td>Sensor data for this frame (images, scan, user data, ...). </td></tr>
<tr><tdclass="paramname">odomPose</td><td><aclass="el"href="classrtabmap_1_1Odometry.html"title="Abstract base class for visual, lidar and visual-inertial odometry backends.">Odometry</a> pose; must be non-null in RGB-D SLAM mode. Pass a null <aclass="el"href="classrtabmap_1_1Transform.html">Transform</a> to fall back to appearance-only mode. </td></tr>
<p>Initializes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> with parameters and a database. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">parameters</td><td><aclass="el"href="classrtabmap_1_1Parameters.html">Parameters</a> overriding default parameters and database parameters (see <code>loadDatabaseParameters</code>). </td></tr>
<tr><tdclass="paramname">databasePath</td><td>Database input/output path. If empty, an in-memory database is used. If set and the file does not exist, it is created empty; if it exists, nodes and the visual word vocabulary are loaded into working memory. </td></tr>
<tr><tdclass="paramname">loadDatabaseParameters</td><td>If true and an existing database is opened, the parameters stored inside the database are loaded and applied to this <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> instance (then overridden by <code>parameters</code>). </td></tr>
<p>Initializes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> from a configuration file and a database. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">configFile</td><td>Configuration file (*.ini) overriding default parameters and database parameters (see <code>loadDatabaseParameters</code>). </td></tr>
<tr><tdclass="paramname">databasePath</td><td>Database input/output path; same semantics as the other <aclass="el"href="classrtabmap_1_1Rtabmap.html#a711c479925db2c9f8201aacffe70281b">init()</a>. </td></tr>
<tr><tdclass="paramname">loadDatabaseParameters</td><td>If true and an existing database is opened, the parameters stored inside the database are loaded and applied first, then overridden by values from <code>configFile</code>. </td></tr>
<p>Closes <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a> and releases the underlying <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">databaseSaved</td><td>If true, the in-memory state is flushed to the database; if false, in-memory changes are discarded. </td></tr>
<tr><tdclass="paramname">ouputDatabasePath</td><td>If non-empty, the database is copied to this path on close. If a database on disk was initially created/loaded on a different path, it will be updated with the latest changes and renamed to the output path. </td></tr>
<dlclass="section return"><dt>Returns</dt><dd>Working directory used for dumps, log files and temporary outputs. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00297">297</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>True if RGB-D SLAM mode is enabled (<aclass="el"href="classrtabmap_1_1Parameters.html#a660983e23247cd39034f2ea07cfcd54b">Parameters::kRGBDEnabled()</a>). </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00299">299</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Id of the loop-closure hypothesis accepted at the last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> iteration, or 0 if none. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00301">301</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Posterior probability of the accepted loop-closure hypothesis, or 0 if none. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00303">303</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Id of the highest-posterior hypothesis at the last iteration (whether or not it was accepted). </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00305">305</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Posterior of the highest-posterior hypothesis at the last iteration. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00307">307</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<tdclass="memname">std::list< int > rtabmap::Rtabmap::getWM </td>
<td>(</td>
<tdclass="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><divclass="memdoc">
<dlclass="section return"><dt>Returns</dt><dd>Working memory ids ordered as in <aclass="el"href="classrtabmap_1_1Memory.html#ab6c0794ad1aac6e9084c0240e709cdc6">Memory::getWorkingMem()</a>. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Wall-clock duration of the last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call, in seconds. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00323">323</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>True if signature ids are auto-generated (vs. taken from <aclass="el"href="classrtabmap_1_1SensorData.html#a84fbcb16e51018d96065d3ce240650c6">SensorData::id()</a>). </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="classrtabmap_1_1Statistics.html"title="Collects and manages runtime statistics for RTAB-Map.">Statistics</a> produced by the last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> iteration. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Optimized poses of the current local map (last graph optimization result). </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00331">331</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Constraints (links) of the current local map. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00333">333</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> mapping odometry frame to the optimized map frame.</dd></dl>
<p>This is the correction applied to incoming odometry poses so they align with the latest graph optimization output. Updated whenever a loop closure or proximity detection re-optimizes the graph.</p>
<p>In ROS terms, this corresponds to the standard <code>/map</code> -><code>/odom</code> TF transform published by SLAM systems: composing it with the live odometry pose (<code>/odom</code> -><code>/base_link</code>) yields the robot pose in the map frame. </p>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00349">349</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Owned <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> (may be null before <aclass="el"href="classrtabmap_1_1Rtabmap.html#a711c479925db2c9f8201aacffe70281b">init()</a>). </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00351">351</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Radius (meters) under which the current path goal is considered reached. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00353">353</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Local radius (meters) used by proximity detection and path planning queries. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00355">355</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Last localized pose in the map frame.</dd></dl>
<p>In <b>localization mode</b>, this is the corrected odometry pose of the last processed frame. In <b>mapping mode</b>, this is the last pose returned by <aclass="el"href="classrtabmap_1_1Rtabmap.html#aebe0bf9364ff8952d041f57c6a1c1d57">getLocalOptimizedPoses()</a>. </p>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00363">363</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Maximum allowed processing time per <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call, in milliseconds. </dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#a8ee7e153cfb26574c7d1c7b427593f8a"title="Key of parameter Rtabmap/TimeThr : "Maximum time allowed for map update (ms) (0 means infinity)....">Parameters::kRtabmapTimeThr()</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00369">369</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<p>Drives how aggressively WM is transferred to LTM to keep iterations under the threshold. 0 disables the time bound.</p>
<dlclass="section note"><dt>Note</dt><dd>This setting and <aclass="el"href="classrtabmap_1_1Rtabmap.html#a6915ee0137b949837addcb5d3ac1646c">setMemoryThreshold()</a> are the only two switches that enable RTAB-Map's memory management (WM-to-LTM transfer, retrieval and node immunization). When both are 0, memory management is disabled and all signatures stay in working memory.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#a8ee7e153cfb26574c7d1c7b427593f8a"title="Key of parameter Rtabmap/TimeThr : "Maximum time allowed for map update (ms) (0 means infinity)....">Parameters::kRtabmapTimeThr()</a></dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Maximum allowed WM size (number of signatures). </dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#a66882ccd6f0a49f2c23db8718d12a59c"title="Key of parameter Rtabmap/MemoryThr : uFormat("Maximum nodes in the Working Memory (0 means infinity)....">Parameters::kRtabmapMemoryThr()</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00388">388</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<p>Sets the maximum number of signatures kept in WM (0 = unbounded). </p>
<dlclass="section note"><dt>Note</dt><dd>This setting and <aclass="el"href="classrtabmap_1_1Rtabmap.html#a80add8fadd488d0c7781c249abea0d5d">setTimeThreshold()</a> are the only two switches that enable RTAB-Map's memory management (WM-to-LTM transfer, retrieval and node immunization). When both are 0, memory management is disabled and all signatures stay in working memory.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#a66882ccd6f0a49f2c23db8718d12a59c"title="Key of parameter Rtabmap/MemoryThr : uFormat("Maximum nodes in the Working Memory (0 means infinity)....">Parameters::kRtabmapMemoryThr()</a></dd></dl>
<p>Sets the localization prior pose used to seed the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call (localization mode only). </p>
<p>Tells RTAB-Map where the robot is currently located in the map frame, so that the very next call to <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> can align incoming odometry with the persisted map without waiting for a loop closure. Typical use cases: restoring localization after a session restart, applying an external pose estimate (e.g. from a <aclass="el"href="classrtabmap_1_1GPS.html"title="WGS84 GPS fix attached to a sensor sample or graph node.">GPS</a> or a known starting point), or recovering from "kidnapped robot" situations.</p>
<p>This call only stages state; it does <b>not</b> itself produce a non-identity <aclass="el"href="classrtabmap_1_1Rtabmap.html#a7b71f70a20f1ef42a65fa9571e254711">getMapCorrection()</a>. The alignment between the odometry frame and the map frame is performed on the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call, which consumes <code>initialPose</code> together with the incoming odometry pose. Two branches are taken depending on <aclass="el"href="classrtabmap_1_1Parameters.html#ae0e66e60cda07b9b87b9f5aed3097f18">Parameters::kRGBDOptimizeFromGraphEnd()</a>:</p><ul>
<li><b>false (default)</b>: <aclass="el"href="classrtabmap_1_1Rtabmap.html#a7b71f70a20f1ef42a65fa9571e254711">getMapCorrection()</a> is set so that the live odometry pose is shifted to land on <code>initialPose</code> in the map frame (the optimized map is left untouched).</li>
<li><b>true</b>: every optimized node pose is rigidly transformed so that the map itself moves to align with <code>initialPose</code> (the map correction stays close to identity).</li>
</ul>
<p>The transform applied is restricted by SLAM dimensionality: 3-DoF (x, y, yaw) for 2D SLAM, 4-DoF (x, y, z, yaw) when gravity is available (<aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> orientation or <aclass="el"href="classrtabmap_1_1Memory.html#ab29b6d90e79694d7fdfb56574476141f">Memory::isOdomGravityUsed()</a>) and <aclass="el"href="classrtabmap_1_1Parameters.html#ae30f9e3d2e17c3543801cdd9fa51ffcc">Parameters::kOptimizerGravitySigma()</a> is non-zero, full 6-DoF otherwise.</p>
<p>Side effects on the staged state:</p><ul>
<li><aclass="el"href="classrtabmap_1_1Rtabmap.html#a2d2efac02d4a6d1d7bbc505d94fd634b">getLastLocalizationPose()</a> is replaced by <code>initialPose</code>; the localization covariance, the last localization node id and the odometry cache used for loop-closure rejection are all cleared.</li>
<li><aclass="el"href="classrtabmap_1_1Rtabmap.html#a7b71f70a20f1ef42a65fa9571e254711">getMapCorrection()</a> is reset to identity and any backup is cleared.</li>
<li>If the current map has not been optimized yet (no entries in <aclass="el"href="classrtabmap_1_1Rtabmap.html#aebe0bf9364ff8952d041f57c6a1c1d57">getLocalOptimizedPoses()</a>) and a last working signature exists, the map is optimized around that signature so the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> has something to localize against.</li>
</ul>
<p>After the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> consumes the prior, the nearest optimized node to <code>initialPose</code> is recorded as the last localization node.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">initialPose</td><td>Robot pose in the map frame.</td></tr>
</table>
</dd>
</dl>
<dlclass="section note"><dt>Note</dt><dd>No-op (with warning) in mapping mode.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#acdc74cd2b096ba28d9c1e00040b69d42"title="Key of parameter Mem/IncrementalMemory : "SLAM mode, otherwise it is Localization mode....">Parameters::kMemIncrementalMemory()</a></dd>
<dd>
<aclass="el"href="classrtabmap_1_1Parameters.html#ae0e66e60cda07b9b87b9f5aed3097f18"title="Key of parameter RGBD/OptimizeFromGraphEnd : "Optimize graph from the newest node....">Parameters::kRGBDOptimizeFromGraphEnd()</a></dd></dl>
<p>Starts a new map session (next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> will create a fresh map id). </p>
<p>In <b>mapping mode</b>, this increments the map id, clears the local optimized graph and resets the Bayes filter. In <b>localization mode</b>, it resets the map correction, the localization node and the odometry cache; if <aclass="el"href="classrtabmap_1_1Parameters.html#afd7b349d5f354c290ef2e37e917182ee">Parameters::kRGBDStartAtOrigin()</a> is enabled, the last localization pose is reset to identity.</p>
<dlclass="section return"><dt>Returns</dt><dd>The new map id (mapping mode), or -1 (localization mode). </dd></dl>
<p>Attaches user data to signature <code>id</code>, compressing it on the fly if needed. </p>
<p>The format is detected automatically: a single-row <code>CV_8UC1</code> matrix is treated as already-compressed data and stored as-is; anything else is considered raw and compressed before being stored.</p>
<dlclass="section note"><dt>Note</dt><dd>If you pass one-dimensional unsigned 8-bit raw data, transpose it so it has multiple rows (not multiple columns), otherwise it will be misdetected as already compressed.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">id</td><td>Target signature id (must be in WM/STM or LTM). </td></tr>
<tr><tdclass="paramname">data</td><td>Raw or pre-compressed user data. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if the data was attached. </dd></dl>
<p>Exports the current pose graph to a text file. </p>
<p>Forwards to <aclass="el"href="namespacertabmap_1_1graph.html#af5622dec3112ea0b5154056bde132d46">graph::exportPoses()</a> after collecting either the optimized or the raw odometry poses (and the matching constraints when needed).</p>
<tr><tdclass="paramname">optimized</td><td>If true, export optimized poses; otherwise raw odometry poses. </td></tr>
<tr><tdclass="paramname">global</td><td>If true, include nodes from LTM as well; otherwise only WM/STM. </td></tr>
<tr><tdclass="paramname">format</td><td>Output format code; see <aclass="el"href="namespacertabmap_1_1graph.html#af5622dec3112ea0b5154056bde132d46">graph::exportPoses()</a> for the full list of supported values (raw, RGBD-SLAM/TUM, KITTI, TORO, g2o, ...).</td></tr>
</table>
</dd>
</dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="namespacertabmap_1_1graph.html#af5622dec3112ea0b5154056bde132d46"title="Writes poses (and optional constraints) to disk.">graph::exportPoses()</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00526">526</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<p>Sets the working directory used for dumps, logs and temporary files. </p>
<p>Can also be configured through <aclass="el"href="classrtabmap_1_1Parameters.html#a42233cb8e32e704f7dd79d0208fa9d07">Parameters::kRtabmapWorkingDirectory()</a> in the parameter map passed to <aclass="el"href="classrtabmap_1_1Rtabmap.html#a711c479925db2c9f8201aacffe70281b">init()</a> or <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5a461ed88e83d2dbebee819ab6690e7a">parseParameters()</a>.</p>
<p>Removes the loop-closure link added at the last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> iteration. </p>
<p>Looks at the last non-intermediate signature in STM and erases any <aclass="el"href="classrtabmap_1_1Link.html#a925bb7ca93eb95a3a873b0a9e8d5e91eae963042a31afec63e8c0683696ac6791">Link::kGlobalClosure</a>, <aclass="el"href="classrtabmap_1_1Link.html#a925bb7ca93eb95a3a873b0a9e8d5e91ea9195217dc75001841fce507de43fb0db">Link::kLocalSpaceClosure</a>, <aclass="el"href="classrtabmap_1_1Link.html#a925bb7ca93eb95a3a873b0a9e8d5e91eae0b352e9cbb32d357ce59f09159c09fb">Link::kLocalTimeClosure</a> or <aclass="el"href="classrtabmap_1_1Link.html#a925bb7ca93eb95a3a873b0a9e8d5e91ea878009c73fbfa2736f438b748afbc1f6">Link::kUserClosure</a> attached to it. The current optimized map is updated accordingly. </p>
<p>Deletes the most recent (non-intermediate) location from the map. </p>
<p>Used by tools to undo the very last <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> iteration. In mapping mode, the optimized graph is recomputed without the deleted node.</p>
<dlclass="section note"><dt>Note</dt><dd>Locations whose neighbors include intermediate nodes are not supported. </dd></dl>
<p>Replaces the current optimized poses and constraints with externally provided ones. </p>
<p>Useful when graph optimization is performed outside of <aclass="el"href="classrtabmap_1_1Rtabmap.html"title="Top-level RTAB-Map SLAM pipeline (mapping, localization and loop closure).">Rtabmap</a>.</p>
<dlclass="section warning"><dt>Warning</dt><dd>No consistency check is performed against the current <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> state: <code>poses</code> and <code>constraints</code> overwrite the internal containers verbatim. The caller is responsible for ensuring that every id in <code>poses</code> (and every endpoint of every link in <code>constraints</code>) belongs to a signature currently in STM or WM (see <aclass="el"href="classrtabmap_1_1Memory.html#a19fe91598153249250ac4870db535e8e">Memory::isInSTM()</a> / <aclass="el"href="classrtabmap_1_1Memory.html#a5058d8b44e4f76f1fedb76645087a1ac">Memory::isInWM()</a>). Passing poses for ids that are no longer loaded will leave dangling entries that may confuse subsequent <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> calls. </dd></dl>
<p>Returns a copy of signature <code>id</code> with optional payloads attached. </p>
<p>Loads from WM/STM if present, otherwise from LTM. Selectively populates the returned <aclass="el"href="classrtabmap_1_1Signature.html">Signature</a> with images, scan, user data, occupancy grid, visual words and global descriptors. </p>
<p>Extracts a full snapshot of the current pose graph. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">poses</td><td>Output: pose for every selected node. </td></tr>
<tr><tdclass="paramname">constraints</td><td>Output: links between selected nodes. </td></tr>
<tr><tdclass="paramname">optimized</td><td>If true, return optimized poses; otherwise raw odometry poses. </td></tr>
<tr><tdclass="paramname">global</td><td>If true, include nodes from LTM as well; otherwise only WM/STM. </td></tr>
<tr><tdclass="paramname">signatures</td><td>Optional output: a copy of each node's <aclass="el"href="classrtabmap_1_1Signature.html">Signature</a> (with the payloads requested by the <code>with*</code> flags). </td></tr>
<tr><tdclass="paramname">withImages</td><td>Attach compressed RGB/depth images to <code>signatures</code>. </td></tr>
<p>Returns optimized poses within a metric radius of <code>pose</code>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">pose</td><td>Query pose in the map frame. </td></tr>
<tr><tdclass="paramname">radius</td><td>Search radius in meters (0 falls back to <aclass="el"href="classrtabmap_1_1Parameters.html#adaa87cec765f9674a12382392a60a4fe">Parameters::kRGBDLocalRadius()</a>). </td></tr>
<tr><tdclass="paramname">k</td><td>If non-zero, also cap the result to the <code>k</code> nearest neighbors. </td></tr>
<tr><tdclass="paramname">distsSqr</td><td>Optional output: per-id squared distance to <code>pose</code>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Nodes (and possibly landmarks) within the radius, mapped to their pose. Landmarks have a negative id. </dd></dl>
<p>Returns optimized poses within a metric radius of node <code>nodeId</code>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">nodeId</td><td>Query node id. Pass 0 to query around the latest node. A negative id requests neighbors of the corresponding landmark. </td></tr>
<tr><tdclass="paramname">radius</td><td>Search radius in meters (0 falls back to <aclass="el"href="classrtabmap_1_1Parameters.html#adaa87cec765f9674a12382392a60a4fe">Parameters::kRGBDLocalRadius()</a>). </td></tr>
<tr><tdclass="paramname">k</td><td>If non-zero, cap the result to the <code>k</code> nearest neighbors. </td></tr>
<tr><tdclass="paramname">distsSqr</td><td>Optional output: per-id squared distance to <code>nodeId</code>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Nodes (and possibly landmarks) within the radius. </dd></dl>
<p>Post-processing: searches for additional loop closures over the existing graph. </p>
<p>Clusters nearby optimized poses and runs registration between candidates that are not yet linked. New links are added to <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> and the graph is re-optimized.</p>
<dlclass="section note"><dt>Note</dt><dd>The registration approach used here is the one configured in <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> via <aclass="el"href="classrtabmap_1_1Parameters.html#abb01f566041dff1ca1ff47b4a6716b48">Parameters::kRegStrategy()</a> (0=Vis, 1=Icp, 2=VisIcp), so the quality and sensor requirements of this pass mirror the live loop-closure pipeline.</dd>
<dd>
Candidate cluster pairs whose ids differ by less than <aclass="el"href="classrtabmap_1_1Parameters.html#a46dc1a24b02bb00014262f7f4d818a49">Parameters::kMemSTMSize()</a>, or that are already reachable from each other within that many graph hops, are filtered out. This prevents trivial "loop closures" between temporally or topologically adjacent nodes.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">clusterRadiusMax</td><td>Maximum metric distance (m) between two candidate nodes. </td></tr>
<tr><tdclass="paramname">clusterAngle</td><td>Maximum angular distance (rad) between two candidate nodes. </td></tr>
<tr><tdclass="paramname">iterations</td><td>Number of refinement passes. </td></tr>
<tr><tdclass="paramname">intraSession</td><td>Include loop closures within the same map session. </td></tr>
<tr><tdclass="paramname">interSession</td><td>Include loop closures between different map sessions. </td></tr>
<tr><tdclass="paramname">state</td><td>Optional progress sink; cancellation requests are honored. </td></tr>
<tr><tdclass="paramname">clusterRadiusMin</td><td>Minimum metric distance (m); pairs closer than this are considered already linked through neighbor links. </td></tr>
<tr><tdclass="paramname">toFromMapId</td><td>If >=0, restrict candidate pairs to nodes belonging to this map id. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of loop closures added, or -1 on error (e.g. not in RGB-D mode, no optimizer iterations). </dd></dl>
<p>Runs a global bundle adjustment over the optimized graph. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">optimizerType</td><td>Backend optimizer (e.g. 1=g2o); availability depends on what RTAB-Map was built with. </td></tr>
<tr><tdclass="paramname">rematchFeatures</td><td>If true, re-match visual features between connected nodes before BA (otherwise reuse existing word-id correspondences). </td></tr>
<tr><tdclass="paramname">iterations</td><td>Solver iterations (0 falls back to <aclass="el"href="classrtabmap_1_1Parameters.html#a8be61aae74f02931c8c224d98629dfc1">Parameters::kOptimizerIterations()</a>). </td></tr>
<tr><tdclass="paramname">pixelVariance</td><td>Pixel reprojection variance used by the cost (0 falls back to <aclass="el"href="classrtabmap_1_1Parameters.html#af8ad0ad86c152e736820805aad2203c7">Parameters::kOptimizerPixelVariance()</a>). </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if BA was run and improved poses were stored. </dd></dl>
<p>Filters spurious obstacles from every node's local grid using a reference 2D map. </p>
<p>Thin wrapper around <aclass="el"href="classrtabmap_1_1Memory.html#a6e63312ada575016b583a4252dc0a70c">Memory::cleanupLocalGrids()</a>; see that method for the exact filtering rule and the meaning of <code>cropRadius</code> and <code>filterScans</code>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Number of (node, grid or scan) modifications, or -1 on error. </dd></dl>
<p>Re-runs registration on every link of the current graph and updates the ones that converge. </p>
<p>Useful after parameter changes to refresh stored transforms.</p>
<dlclass="section note"><dt>Note</dt><dd>The registration approach is the one configured in <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> via <aclass="el"href="classrtabmap_1_1Parameters.html#abb01f566041dff1ca1ff47b4a6716b48">Parameters::kRegStrategy()</a> (0=Vis, 1=Icp, 2=VisIcp). For each link, the link's existing relative transform (the constraint produced by the current optimized local graph) is passed as the initial guess to <aclass="el"href="classrtabmap_1_1Memory.html#a4ae0287262c04905baab2d6f94448486">Memory::computeTransform()</a>, so links already close to convergence are refined locally rather than re-estimated from scratch.</dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Number of links refined, or -1 if not in RGB-D mode. </dd></dl>
<tdclass="paramtype">const std::vector< int >& </td>
<tdclass="paramname"><em>ids</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><divclass="memdoc">
<p>Marks node ids whose data should be re-emitted on the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a>. </p>
<p>The requested signatures are attached to the <aclass="el"href="classrtabmap_1_1Statistics.html">Statistics</a> object produced by the next <aclass="el"href="classrtabmap_1_1Rtabmap.html#ad7f085b6ae0fd3c7077c500c028fd5c3">process()</a> call (via the same mechanism as the regular "last signature
data"), so consumers reading <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5d18002c7eb7cee234471686413d201c">getStatistics()</a> pick them up alongside the normal output. Up to <aclass="el"href="classrtabmap_1_1Parameters.html#aebca6ea8c99890a56702c65a972483dc">Parameters::kRtabmapMaxRepublished()</a> ids are emitted per iteration; any leftover ids stay queued for subsequent iterations until they are republished or fall out of the current graph.</p>
<p>Pass an empty vector to clear the request set. Requires <aclass="el"href="classrtabmap_1_1Parameters.html#aebca6ea8c99890a56702c65a972483dc">Parameters::kRtabmapMaxRepublished()</a>> 0 and <aclass="el"href="classrtabmap_1_1Parameters.html#a1476c605d078b36f19b41617159fcc05">Parameters::kRtabmapPublishLastSignature()</a> = true. </p>
<p>Loads the visual word dictionary as ids only, without descriptors. </p>
<p>With a dummy dictionary, <aclass="el"href="classrtabmap_1_1Rtabmap.html#a711c479925db2c9f8201aacffe70281b">init()</a> populates <aclass="el"href="classrtabmap_1_1VWDictionary.html">VWDictionary</a> with placeholder <aclass="el"href="classrtabmap_1_1VisualWord.html">VisualWord</a> objects carrying an empty descriptor, and the dictionary update (FLANN index construction) is skipped. This makes opening a large database much faster and lighter in RAM when the word descriptors are not needed, e.g. to inspect or post-process an existing map rather than to localize in it.</p>
<p>The dummy dictionary is silently disabled if the database has no words, or if the dictionary has to be rebuilt from the nodes because it was not saved properly.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">enabled</td><td>True to load ids only, false to load the full dictionary (default).</td></tr>
</table>
</dd>
</dl>
<dlclass="section note"><dt>Note</dt><dd>Must be called before <aclass="el"href="classrtabmap_1_1Rtabmap.html#a711c479925db2c9f8201aacffe70281b">init()</a>; an error is logged and the call ignored once the memory exists. </dd></dl>
<dlclass="section warning"><dt>Warning</dt><dd>Incompatible with mapping: adding new nodes asserts in <code>Memory::createSignature()</code>. Loop closure detection also cannot match new observations against a descriptor-less dictionary.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Memory.html#a655f123daec9e4e50e322db9f3bbd6db"title="Enables a dummy visual word dictionary (no descriptors kept, word ids only).">Memory::setDummyDictionary()</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00776">776</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<p>Plans a path from the current location to node <code>targetNode</code>. </p>
<p>RGB-D mode only (requires <aclass="el"href="classrtabmap_1_1Parameters.html#a660983e23247cd39034f2ea07cfcd54b">Parameters::kRGBDEnabled()</a> = true).</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">targetNode</td><td>Destination node id (positive) or landmark id (negative). </td></tr>
<tr><tdclass="paramname">global</td><td>If true, also search nodes in LTM; otherwise only the current optimized map. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if a path was computed; the result is available via <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5fe89ac87283a92258d27f42eb7b13f1">getPath()</a>.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#a660983e23247cd39034f2ea07cfcd54b"title="Key of parameter RGBD/Enabled : "Activate metric SLAM. If set to false, classic RTAB-Map loop closure...">Parameters::kRGBDEnabled()</a></dd></dl>
<p>Plans a path in the current optimized map toward a metric goal pose. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">targetPose</td><td>Goal pose in the map frame. </td></tr>
<tr><tdclass="paramname">tolerance</td><td>Goal-acceptance tolerance (meters). A negative value falls back to <aclass="el"href="classrtabmap_1_1Parameters.html#adaa87cec765f9674a12382392a60a4fe">Parameters::kRGBDLocalRadius()</a>; 0 means infinite tolerance. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if a path was computed. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>The currently planned path as a sequence of (node id, pose) waypoints. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00805">805</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Index of the current waypoint in <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5fe89ac87283a92258d27f42eb7b13f1">getPath()</a>. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00813">813</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Index of the current intermediate goal in <aclass="el"href="classrtabmap_1_1Rtabmap.html#a5fe89ac87283a92258d27f42eb7b13f1">getPath()</a>. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00815">815</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> from the final waypoint pose to the requested goal pose. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="Rtabmap_8h_source.html#l00817">817</a> of file <aclass="el"href="Rtabmap_8h_source.html">Rtabmap.h</a>.</p>
<p>Returns optimized poses of WM nodes located in front of <code>fromId</code>. </p>
<p>Candidates are first gathered around <code>fromId</code>, then STM nodes are excluded, the survivors are cropped to a forward-facing box of width <code>radius</code> (1 m behind, <code>radius</code> ahead, +/-<code>radius</code> laterally), and a KdTree radius search keeps the <code>maxNearestNeighbors</code> closest poses in that box.</p>
<dlclass="section note"><dt>Note</dt><dd>Mapping vs. localization mode differs only in how the initial candidate set is built:<ul>
<li>In <b>mapping mode</b> (incremental), candidates are produced by a graph-radius walk from <code>fromId:</code> nodes reachable within <code>maxDiffID</code> graph hops AND within <code>radius</code> meters in the optimized poses.</li>
<li>In <b>localization mode</b>, the graph-hop restriction is ignored: every optimized pose within <code>radius</code> meters of <code>fromId</code> is considered. The forward-box crop and KdTree radius search that follow are identical in both modes.</li>
</ul>
</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">fromId</td><td>Reference node (must be in <aclass="el"href="classrtabmap_1_1Memory.html">Memory</a> and <aclass="el"href="classrtabmap_1_1Rtabmap.html#aebe0bf9364ff8952d041f57c6a1c1d57">getLocalOptimizedPoses()</a>). </td></tr>
<tr><tdclass="paramname">maxNearestNeighbors</td><td>Cap on the number of nodes returned. </td></tr>
<tr><tdclass="paramname">radius</td><td>Maximum metric distance from <code>fromId</code> (meters). </td></tr>
<tr><tdclass="paramname">maxDiffID</td><td>Maximum graph depth from <code>fromId</code> in mapping mode (0 = unlimited). Ignored in localization mode. </td></tr>
<p>Segments a set of optimized poses into paths connected by neighbor links. </p>
<p>Designed to be called on the result of a radius search around <code>target</code> (a set of <code>poses</code> already constrained to be metrically close to the goal). Within that radius, the method partitions the <code>poses</code> into one or more "paths" where each path is a connected component reachable from its starting node using <b>only neighbor (sequential) links</b>– loop-closure links, landmark links and intermediate nodes are not used to traverse between members. Paths are produced one at a time, each starting from the still-unclaimed pose nearest to <code>target</code>; a candidate is added to the current path only if it has at least one neighbor link to a node already in the path.</p>
<p>Used internally by proximity detection by space (see <aclass="el"href="classrtabmap_1_1Parameters.html#a0bf742f8f518f6c63d1bb78a0f009515">Parameters::kRGBDProximityBySpace()</a>) in two independent stages, each iterating over the segmented paths:</p><ul>
<li><b>One-to-one</b> (visual registration): runs registration between the current node and at most one node per neighbor-connected path, avoiding redundant attempts against nearby members of the same local trajectory.</li>
<li><b>One-to-many</b> (scan matching, enabled when <aclass="el"href="classrtabmap_1_1Parameters.html#a1a6c82e3762a844dab0cc9db220adb8c">Parameters::kRGBDProximityPathMaxNeighbors()</a>> 0): on each path, neighboring nodes are assembled around the nearest pose on the path (up to the configured count, walked forward and backward) and their laser scans are merged for an ICP registration against the current scan. The neighbor-link-only structure of each path is what makes this assembly geometrically consistent.</li>
</ul>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">poses</td><td>Candidate nodes with their optimized poses (typically pre-filtered to a radius around <code>target</code>). </td></tr>
<tr><tdclass="paramname">target</td><td>Reference pose used to order paths: each path's starting node is the still-unclaimed pose closest to <code>target</code>. </td></tr>
<tr><tdclass="paramname">maxGraphDepth</td><td>Maximum graph depth traversed from the starting node when gathering candidates for a path (0 = unlimited). </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Map from the starting node id of each path to its (node id -> pose) chain. </dd></dl>
<p>Applies the standard RTAB-Map likelihood adjustment. </p>
<p>Normalizes raw likelihoods using mean and standard deviation across non-null values. Real-place entries with <code>value</code><= <code>mean</code> + <code>stdDev</code> are clamped to <code>1.0</code>; only entries above that threshold are scaled. The virtual place (the first key in <code>likelihood</code>, representing the "new place" hypothesis) is then set so that its likelihood reflects how peaked the real distribution is.</p>
<p>The exact formulas are selected by <aclass="el"href="classrtabmap_1_1Parameters.html#aef900d9efe01dcbfbe5348b131d9ff46">Parameters::kRtabmapVirtualPlaceLikelihoodRatio()</a> (default 0, Angeli PhD formulation):</p>
<li>Virtual place: <code>mean</code> / stdDev + 1 (when <code>stdDev</code> is non-trivial and a maximum exists; otherwise 2). The virtual place "wins" when the real-place distribution is flat (small <code>stdDev</code> relative to <code>mean</code>).</li>
</ul>
</li>
<li><b>Ratio != 0</b> (z-score formulation):<ul>
<li>Real place above threshold: <code></code>(value - mean) / stdDev (i.e. the z-score).</li>
<li>Virtual place: <code>stdDev</code> / (max - mean) + 1 (when <code>max</code>><code>mean</code>; otherwise 2). The virtual place "wins" when no real candidate stands out far above the mean.</li>
</ul>
</li>
</ul>
<p>In both formulations a low virtual-place likelihood favors a real-place loop closure on the next Bayes update; a high one favors the "new place" hypothesis.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1Parameters.html#aef900d9efe01dcbfbe5348b131d9ff46"title="Key of parameter Rtabmap/VirtualPlaceLikelihoodRatio : "Likelihood ratio for virtual place (for no lo...">Parameters::kRtabmapVirtualPlaceLikelihoodRatio()</a></dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<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>