<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:a53a73e2ebf60ff671828732594adc7c4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gravity (m/s^2) removed from the specific force: the one given, or the estimate. <br/></td></tr>
<trclass="memdesc:aa84008cbd4087273e8db74d91d89ec10"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Whether the gravity is estimated from the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> (see the constructor) <br/></td></tr>
<trclass="memdesc:a91c329f153da4c479509e406f6eb5112"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Number of quiet <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> windows the gravity estimate is from (0: not estimated yet) <br/></td></tr>
<trclass="memdesc:abb4349e5902040e5440f425e0bc39c47"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Adds an odometry pose, from which the next poses are predicted. <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>The gravity removed can be estimated from the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> itself (see the constructor): an accelerometer can read a few percent off at rest (scale or bias), and that error, integrated as an acceleration, would bias the predicted velocity along gravity. The accelerometer is averaged over the windows where it is quiet: with a gyro and an accelerometer that barely change, the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> is not accelerating (at rest or at constant velocity), so it only measures gravity. The <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> must then be held still (or at constant velocity) for a moment, e.g., before moving: until then, standard gravity is used, and a steady acceleration without rotation would be taken for gravity. Only the error along gravity is corrected, which is all of it for an <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> that stays about level; one changing attitude would need its axes calibrated.</p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00077">77</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<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. <= 0: estimated from the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> when it is still (see the class description), with standard gravity until then.</td></tr>
<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#l00108">108</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#l00109">109</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<p>Gravity (m/s^2) removed from the specific force: the one given, or the estimate. </p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00111">111</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<p>Whether the gravity is estimated from the <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> (see the constructor) </p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00113">113</a> of file <aclass="el"href="ImuMotionPredictor_8h_source.html">ImuMotionPredictor.h</a>.</p>
<p>Number of quiet <aclass="el"href="classrtabmap_1_1IMU.html"title="Inertial measurement sample (ROS sensor_msgs/Imu-like fields).">IMU</a> windows the gravity estimate is from (0: not estimated yet) </p>
<pclass="definition">Definition at line <aclass="el"href="ImuMotionPredictor_8h_source.html#l00115">115</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>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. The gravity estimate is kept: it is the sensor's. </p>
<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>