<ahref="#pub-methods">Public Member Functions</a>|
<ahref="#pro-methods">Protected Member Functions</a>|
<ahref="classrtabmap_1_1SensorCapture-members.html">List of all members</a></div>
<divclass="headertitle"><divclass="title">rtabmap::SensorCapture Class Reference<spanclass="mlabels"><spanclass="mlabel">abstract</span></span></div></div>
</div><!--header-->
<divclass="contents">
<p>Abstract base class for sensor data capture (cameras, lidars, etc.)
<trclass="memdesc:aca06c645212a7501a246ea593406bcaf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Captures sensor data with frame rate control. <br/></td></tr>
<trclass="memdesc:a7830e571e45752f9d8f30fa806f6aa64"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the sensor's serial number or unique identifier. <br/></td></tr>
<trclass="memdesc:aee217767808a9df9c63a27b284461c89"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if the sensor provides odometry poses. <br/></td></tr>
<trclass="memdesc:a2f940d75366088bfae0164e1803ffe9a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the sensor's pose estimate at a specific timestamp. <br/></td></tr>
<trclass="memdesc:a99829249c51fd08c32310b788b00b663"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the local transform from base frame to sensor frame. <br/></td></tr>
<trclass="memdesc:a0ea4e217047c234bcfcb9866e36ea7c0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the local transform from base frame to sensor frame. <br/></td></tr>
<divclass="textblock"><p>Abstract base class for sensor data capture (cameras, lidars, etc.) </p>
<p><aclass="el"href="classrtabmap_1_1SensorCapture.html"title="Abstract base class for sensor data capture (cameras, lidars, etc.)">SensorCapture</a> provides a unified interface for capturing sensor data from various sensor types including cameras (RGB-D, stereo, mono) and lidars. It handles frame rate control, local transform management, and provides a common API for sensor initialization and data capture.</p>
<p>The class implements the Template Method pattern:</p><ul>
<li><code><aclass="el"href="classrtabmap_1_1SensorCapture.html#aca06c645212a7501a246ea593406bcaf"title="Captures sensor data with frame rate control.">takeData()</a></code> handles frame rate control and timing, then calls the pure virtual <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#a85e8691b5201a5383d1463ed980f7958"title="Pure virtual method to capture sensor data.">captureData()</a></code> method implemented by derived classes</li>
<li>Derived classes must implement <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#a85e8691b5201a5383d1463ed980f7958"title="Pure virtual method to capture sensor data.">captureData()</a></code> to perform the actual sensor capture</li>
</ul>
<p>Key features:</p><ul>
<li><b>Frame rate control</b>: Automatic throttling to maintain target frame rate</li>
<li><b>Local transform</b>: <aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> from robot base frame to sensor frame</li>
<li><b>Capture timing</b>: Tracks capture time and provides it via <aclass="el"href="classrtabmap_1_1SensorCaptureInfo.html"title="Metadata structure for sensor data capture and processing.">SensorCaptureInfo</a></li>
<li><b>Sequence IDs</b>: Automatic sequence number generation for captured data</li>
</ul>
<p>Derived classes include:</p><ul>
<li><b><aclass="el"href="classrtabmap_1_1Camera.html">Camera</a></b>: Base class for all camera types (RGB-D, stereo, mono, file readers, etc.)</li>
<li><b><aclass="el"href="classrtabmap_1_1Lidar.html">Lidar</a></b>: Base class for lidar sensors</li>
</ul>
<dlclass="section note"><dt>Note</dt><dd>This is an abstract class. Use concrete implementations like CameraRGBD, CameraStereo, <aclass="el"href="classrtabmap_1_1LidarVLP16.html">LidarVLP16</a>, etc., or create custom derived classes.</dd></dl>
<aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a></dd>
<dd>
<aclass="el"href="classrtabmap_1_1SensorCaptureInfo.html"title="Metadata structure for sensor data capture and processing.">SensorCaptureInfo</a></dd>
<dd>
<aclass="el"href="classrtabmap_1_1SensorCaptureThread.html"title="Thread-based sensor data capture and event posting for RTAB-Map.">SensorCaptureThread</a></dd></dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00078">78</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Creates a <aclass="el"href="classrtabmap_1_1SensorCapture.html"title="Abstract base class for sensor data capture (cameras, lidars, etc.)">SensorCapture</a> instance with the specified frame rate and local transform. This constructor is protected because <aclass="el"href="classrtabmap_1_1SensorCapture.html"title="Abstract base class for sensor data capture (cameras, lidars, etc.)">SensorCapture</a> is an abstract base class and should not be instantiated directly.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">frameRate</td><td>Target frame rate in Hz (0 = unlimited, capture as fast as possible) </td></tr>
<tr><tdclass="paramname">localTransform</td><td><aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> from base frame to sensor frame (default: identity) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Captures sensor data with frame rate control. </p>
<p>This method handles frame rate throttling and timing, then calls the pure virtual <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#a85e8691b5201a5383d1463ed980f7958"title="Pure virtual method to capture sensor data.">captureData()</a></code> method to perform the actual capture.</p>
<p>The method:</p><ul>
<li>Enforces the target frame rate by sleeping if necessary</li>
<li>Measures capture time and stores it in <aclass="el"href="classrtabmap_1_1SensorCaptureInfo.html"title="Metadata structure for sensor data capture and processing.">SensorCaptureInfo</a></li>
<li>Assigns sequence IDs to captured data</li>
<li>Warns if the target frame rate cannot be reached</li>
</ul>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">info</td><td>Optional pointer to <aclass="el"href="classrtabmap_1_1SensorCaptureInfo.html"title="Metadata structure for sensor data capture and processing.">SensorCaptureInfo</a> to fill with capture metadata (ID, timestamp, capture time). If null, no info is filled. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a> containing the captured sensor data</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>If frame rate is 0, data is captured as fast as possible without throttling. </dd>
<dd>
The returned <aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a> should have rectified images if calibration was loaded.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1SensorCapture.html#a85e8691b5201a5383d1463ed980f7958"title="Pure virtual method to capture sensor data.">captureData()</a></dd></dl>
<p>Pure virtual method that must be implemented by derived classes to initialize the sensor hardware or data source. This typically involves:</p><ul>
<li>Opening device connections or file streams</li>
<li>Loading camera calibration parameters</li>
<li>Configuring sensor settings</li>
</ul>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">calibrationFolder</td><td>Directory path where calibration files are located (default: current directory ".") </td></tr>
<tr><tdclass="paramname">cameraName</td><td>Base name of the camera for loading calibration files (default: empty string) </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if initialization was successful, false otherwise</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>Must be called before calling <aclass="el"href="classrtabmap_1_1SensorCapture.html#aca06c645212a7501a246ea593406bcaf"title="Captures sensor data with frame rate control.">takeData()</a> or <aclass="el"href="classrtabmap_1_1SensorCapture.html#a85e8691b5201a5383d1463ed980f7958"title="Pure virtual method to capture sensor data.">captureData()</a></dd></dl>
<p>Returns the sensor's serial number or unique identifier. </p>
<p>Pure virtual method that must be implemented by derived classes to return a unique identifier for the sensor (e.g., device serial number, file path, or other identifier).</p>
<dlclass="section return"><dt>Returns</dt><dd>String identifier for the sensor </dd></dl>
<p>Checks if the sensor provides odometry poses. </p>
<p>Some sensors (e.g., visual-inertial cameras) can provide pose estimates directly. This method indicates whether the sensor supports pose queries.</p>
<dlclass="section return"><dt>Returns</dt><dd>True if the sensor provides odometry poses, false otherwise</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>Default implementation returns false. Derived classes should override if they support pose estimation.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1SensorCapture.html#a2f940d75366088bfae0164e1803ffe9a"title="Gets the sensor's pose estimate at a specific timestamp.">getPose()</a></dd></dl>
<p>Reimplemented in <aclass="el"href="classrtabmap_1_1CameraImages.html#aea0811d6305eec32fda10f46344c825f">rtabmap::CameraImages</a>, <aclass="el"href="classrtabmap_1_1CameraMyntEye.html#abc869cbd8b1106374a1f8734715d965d">rtabmap::CameraMyntEye</a>, <aclass="el"href="classrtabmap_1_1CameraRealSense.html#a1ce069a366db4c98fe757acca7bf5b79">rtabmap::CameraRealSense</a>, <aclass="el"href="classrtabmap_1_1CameraRealSense2.html#a3b5aa7434457e09cbc6f01b985440183">rtabmap::CameraRealSense2</a>, <aclass="el"href="classrtabmap_1_1CameraSeerSense.html#aa3bfa6e619c5845d4994809281c9a4b5">rtabmap::CameraSeerSense</a>, <aclass="el"href="classrtabmap_1_1CameraStereoZed.html#ac57ca4d52b5a0a3c3911ffa4a139564c">rtabmap::CameraStereoZed</a>, and <aclass="el"href="classrtabmap_1_1DBReader.html#a24351b1eb5776a83548a1d972e489dba">rtabmap::DBReader</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00152">152</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<p>Gets the sensor's pose estimate at a specific timestamp. </p>
<p>Queries the sensor for its pose estimate at the given timestamp. This is typically used for sensors that provide visual-inertial odometry or other pose estimation capabilities.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir"></td><tdclass="paramname">stamp</td><td>Timestamp in seconds for which to query the pose </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">pose</td><td>Output transform representing the sensor pose </td></tr>
<tr><tdclass="paramdir"></td><tdclass="paramname">maxWaitTime</td><td>Maximum time in seconds to wait for pose data (default: 0.06) </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if pose was successfully retrieved, false otherwise</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>Default implementation returns false. Derived classes should override if they support pose estimation.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1SensorCapture.html#aee217767808a9df9c63a27b284461c89"title="Checks if the sensor provides odometry poses.">odomProvided()</a></dd></dl>
<p>Reimplemented in <aclass="el"href="classrtabmap_1_1CameraSeerSense.html#a831666d29d4eabc1a00e9eb5c8b47c27">rtabmap::CameraSeerSense</a>, <aclass="el"href="classrtabmap_1_1CameraStereoZed.html#a1fceb3208a256d1023739a60f5931def">rtabmap::CameraStereoZed</a>, <aclass="el"href="classrtabmap_1_1CameraRealSense2.html#a31fc38dca7aa6dc61c68150d5409204e">rtabmap::CameraRealSense2</a>, and <aclass="el"href="classrtabmap_1_1DBReader.html#abd2b32ae00a05810465f63d63c44d5ed">rtabmap::DBReader</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00172">172</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Frame rate in Hz (0 = unlimited, capture as fast as possible) </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00180">180</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<p>Returns the local transform from base frame to sensor frame. </p>
<dlclass="section return"><dt>Returns</dt><dd>Const reference to the local transform </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00186">186</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<p>Controls how often <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#aca06c645212a7501a246ea593406bcaf"title="Captures sensor data with frame rate control.">takeData()</a></code> will capture data. The method will throttle captures to maintain the target rate.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">frameRate</td><td>Target frame rate in Hz (0 = unlimited, capture as fast as possible)</td></tr>
</table>
</dd>
</dl>
<dlclass="section note"><dt>Note</dt><dd>Setting frame rate to 0 disables throttling and captures as fast as possible. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00200">200</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<p>Sets the local transform from base frame to sensor frame. </p>
<p>The local transform represents the pose of the sensor relative to the robot's base frame. This is used to transform sensor data into the robot's coordinate system.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">localTransform</td><td><aclass="el"href="classrtabmap_1_1Transform.html"title="Represents a 3D rigid body transformation (rotation + translation).">Transform</a> from base frame to sensor frame </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00210">210</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
<p>Pure virtual method to capture sensor data. </p>
<p>This method must be implemented by derived classes to perform the actual sensor data capture. It is called by <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#aca06c645212a7501a246ea593406bcaf"title="Captures sensor data with frame rate control.">takeData()</a></code> after frame rate throttling.</p>
<p>The returned <aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a> should:</p><ul>
<li>Have rectified images if calibration was loaded during <code><aclass="el"href="classrtabmap_1_1SensorCapture.html#a1c0cd843969fab53f157cbe0fd333b8a"title="Initializes the sensor.">init()</a></code></li>
<li>Include proper timestamps</li>
<li>Contain valid sensor data (images, depth, laser scans, etc.)</li>
</ul>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">info</td><td>Optional pointer to <aclass="el"href="classrtabmap_1_1SensorCaptureInfo.html"title="Metadata structure for sensor data capture and processing.">SensorCaptureInfo</a> to fill with capture metadata. The base class will fill ID, timestamp, and capture time, but derived classes can add additional information. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a> containing the captured sensor data</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>If capture fails, return an empty <aclass="el"href="classrtabmap_1_1SensorData.html"title="Container class for all sensor data captured at a specific time.">SensorData</a> (id=0, stamp=0.0). </dd>
<dd>
RGB and depth images should be already rectified if calibration was loaded.</dd></dl>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="classrtabmap_1_1SensorCapture.html#aca06c645212a7501a246ea593406bcaf"title="Captures sensor data with frame rate control.">takeData()</a></dd></dl>
<p>Implemented in <aclass="el"href="classrtabmap_1_1LidarVLP16.html#a60d8190947d474e0557695c1032c40b8">rtabmap::LidarVLP16</a>.</p>
<p>Returns and increments the internal sequence counter. This is used to assign unique sequence numbers to captured data.</p>
<dlclass="section return"><dt>Returns</dt><dd>Next sequence ID (starts at 1, increments with each call) </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="SensorCapture_8h_source.html#l00264">264</a> of file <aclass="el"href="SensorCapture_8h_source.html">SensorCapture.h</a>.</p>
</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>