<ahref="#pub-methods">Public Member Functions</a>|
<ahref="classrtabmap_1_1ImuMotionPredictor-members.html">List of all members</a></div>
<divclass="headertitle"><divclass="title">rtabmap::ImuMotionPredictor Class Reference</div></div>
</div><!--header-->
<divclass="contents">
<p>Predicts the pose of the base frame from the last odometry pose and the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>.
<trclass="memdesc:abb4349e5902040e5440f425e0bc39c47"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds an odometry pose, from which the next poses are predicted. <br/></td></tr>
<trclass="memdesc:a2b8b4cd814ae31ef46899f41992bb1a4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Forgets the poses and the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> samples. <br/></td></tr>
<trclass="memdesc:ac9bd37d201be18aaecfbfdbdbaec6ff0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Predicts the pose of the base frame in the odometry frame. <br/></td></tr>
<trclass="memdesc:a2c30a766cc8f251b78ed490cb2a275eb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Whether there is a pose to predict from (none yet, or the last one was null). <br/></td></tr>
<trclass="memdesc:a4ddd3b124501b8446869a38b1ab1ff95"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Stamp of the last pose added, 0 if there is none. <br/></td></tr>
<trclass="memdesc:a18e326faaa67a3602eaf3b4df7a906ff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Velocity (m/s) of the base in the odometry frame at the last pose. <br/></td></tr>
<divclass="textblock"><p>Predicts the pose of the base frame from the last odometry pose and the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>. </p>
<p>Between two odometry updates, the pose is propagated with the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>: the orientation is the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>'s own, re-expressed in the odometry frame, and the position is integrated from the velocity at the last odometry update and the gravity-compensated acceleration. That velocity is re-estimated at every odometry update, from the displacement since an odometry pose a short window back (see velocityWindow) corrected by the acceleration measured in between, so the position never drifts for long: only the motion since the last update is predicted.</p>
<p>This is what lidar deskewing needs: the pose at every point's time, during a sweep that started after the last pose odometry estimated.</p>
<p>The <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> samples are given as they are measured (see <aclass="el"href="classrtabmap_1_1ImuMotionPredictor.html#a3359e2caff4d42fbcd4137b39aa2ae04"title="Adds an IMU measurement.">addImu()</a>): the orientation of the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> in its world frame and its specific force, from which gravity is removed here. That world frame must be gravity aligned with +z up, as in ROS (REP-103, e.g. ENU); its yaw doesn't matter. An orientation given in a frame with z down (NED) must be converted first, otherwise gravity is added instead of removed. The lever arm between the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> and the base origin is ignored: its centripetal and tangential accelerations are small over the fraction of a second this predicts.</p>
<p>Not thread-safe: a caller sharing it between threads must lock around every call. </p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00065">65</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>The <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> acceleration is used only with a velocity window (> 0): over a single frame, the velocity is too noisy to be carried forward with it. Without it (window of 0, or no acceleration in the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> samples), the position follows the last velocity (constant velocity model).</p>
<tr><tdclass="paramname">maxPoseInterval</td><td>odometry poses older (s) than this are not used to estimate the velocity, which is null without one </td></tr>
<tr><tdclass="paramname">velocityWindow</td><td>the velocity is estimated from the displacement since the newest pose at least this old (s), corrected by the acceleration measured since, so that it is the velocity at the last pose, not an average. Over a single frame interval, the noise of the odometry poses would be of the order of the velocity itself. 0: the displacement since the previous pose, without acceleration. </td></tr>
<tr><tdclass="paramname">gravity</td><td>magnitude (m/s^2) of the gravity removed from the specific force given to <aclass="el"href="classrtabmap_1_1ImuMotionPredictor.html#a3359e2caff4d42fbcd4137b39aa2ae04"title="Adds an IMU measurement.">addImu()</a>, standard gravity by default</td></tr>
</table>
</dd>
</dl>
<p>These are fixed for the life of the predictor (there is no setter): changing them while it estimates would mix poses and samples taken under different settings. </p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00094">94</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00095">95</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00096">96</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<p>Adds an <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> measurement. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">stamp</td><td>time of the measurement (s) </td></tr>
<tr><tdclass="paramname">imu</td><td>orientation of the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> in its world frame (gravity aligned, +z up), linear acceleration as measured (the specific force, which includes the reaction to gravity) and the transform from the base frame to the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>. Without orientation, the measurement is ignored; without linear acceleration (all zeros, or a covariance of -1), only its orientation is used. </td></tr>
<p>Adds an odometry pose, from which the next poses are predicted. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">stamp</td><td>time of the pose (s) </td></tr>
<tr><tdclass="paramname">pose</td><td>pose of the base frame in the odometry frame; a null pose (odometry lost) resets the prediction until the next valid pose </td></tr>
<p>Predicts the pose of the base frame in the odometry frame. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">stamp</td><td>time (s) of the prediction, normally after the last pose </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>the predicted pose, null if there is no <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> sample yet. Without a pose (none yet, or the last one was null), the orientation alone is predicted, in the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a>'s world frame and at the origin: still the relative rotation between two stamps, which is what deskewing needs most. </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>