<divclass="inheritance"title="Inheritance Tree"><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">java.lang.Object</a>
<divclass="type-signature"><spanclass="modifiers">public class </span><spanclass="element-name type-name-label">IMUVelocity</span>
<spanclass="extends-implements">extends <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></span></div>
<divclass="block">The calculated velocity of the robot based on averaged IMU measurements.</div>
</div>
<divclass="col-first even-row-color"><code>private final <ahref="../math/IMULinearMovingAverageFilter.html"title="class in swervelib.math">IMULinearMovingAverageFilter</a></code></div>
<divclass="col-constructor-name even-row-color"><code><ahref="#%3Cinit%3E(swervelib.imu.SwerveIMU,double,int)"class="member-name-link">IMUVelocity</a><wbr>(<ahref="SwerveIMU.html"title="class in swervelib.imu">SwerveIMU</a> gyro,
double periodSeconds,
int averagingTaps)</code></div>
<divclass="col-last even-row-color">
<divclass="block">Constructor for the IMU Velocity.</div>
<divclass="block">Update the robot's rotational velocity based on the current gyro position.</div>
</div>
</div>
</div>
</div>
<divclass="inherited-list">
<h3id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"title="class or interface in java.lang"class="external-link">Object</a></h3>
<code><ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()"title="class or interface in java.lang"class="external-link">clone</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)"title="class or interface in java.lang"class="external-link">equals</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()"title="class or interface in java.lang"class="external-link">finalize</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()"title="class or interface in java.lang"class="external-link">getClass</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()"title="class or interface in java.lang"class="external-link">hashCode</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()"title="class or interface in java.lang"class="external-link">notify</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()"title="class or interface in java.lang"class="external-link">notifyAll</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()"title="class or interface in java.lang"class="external-link">toString</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)"title="class or interface in java.lang"class="external-link">wait</a>, <ahref="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)"title="class or interface in java.lang"class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<sectionclass="details">
<ulclass="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<sectionclass="field-details"id="field-detail">
<h2>Field Details</h2>
<ulclass="member-list">
<li>
<sectionclass="detail"id="gyro">
<h3>gyro</h3>
<divclass="member-signature"><spanclass="modifiers">private final</span> <spanclass="return-type"><ahref="SwerveIMU.html"title="class in swervelib.imu">SwerveIMU</a></span> <spanclass="element-name">gyro</span></div>
<divclass="block">Swerve IMU.</div>
</section>
</li>
<li>
<sectionclass="detail"id="velocityFilter">
<h3>velocityFilter</h3>
<divclass="member-signature"><spanclass="modifiers">private final</span> <spanclass="return-type"><ahref="../math/IMULinearMovingAverageFilter.html"title="class in swervelib.math">IMULinearMovingAverageFilter</a></span> <spanclass="element-name">velocityFilter</span></div>
<divclass="block">Linear filter used to calculate velocity, we use a custom filter class
<divclass="member-signature"><spanclass="modifiers">public</span> <spanclass="element-name">IMUVelocity</span><wbr><spanclass="parameters">(<ahref="SwerveIMU.html"title="class in swervelib.imu">SwerveIMU</a> gyro,
double periodSeconds,
int averagingTaps)</span></div>
<divclass="block">Constructor for the IMU Velocity.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>gyro</code> - The SwerveIMU gyro.</dd>
<dd><code>periodSeconds</code> - The rate to collect measurements from the gyro, in the form (1/number of samples per second),
make sure this does not exceed the update rate of your IMU.</dd>
<dd><code>averagingTaps</code> - The number of samples to used for the moving average linear filter. Higher values will not
allow the system to update to changes in velocity, lower values may create a less smooth signal. Expected taps
will probably be ~2-8, with the goal of having the lowest smooth value.</dd>
<divclass="member-signature"><spanclass="modifiers">public static</span> <spanclass="return-type"><ahref="IMUVelocity.html"title="class in swervelib.imu">IMUVelocity</a></span> <spanclass="element-name">createIMUVelocity</span><wbr><spanclass="parameters">(<ahref="SwerveIMU.html"title="class in swervelib.imu">SwerveIMU</a> gyro)</span></div>
<divclass="block">Static factory for IMU Velocity. Supported IMU rates will be as quick as possible
but will not exceed 100hz and will use 5 taps (supported IMUs are listed in swervelib's IMU folder).
Other gyroscopes will default to 50hz and 5 taps. For custom rates please use the IMUVelocity constructor.</div>
<dlclass="notes">
<dt>Parameters:</dt>
<dd><code>gyro</code> - The SwerveIMU gyro.</dd>
<dt>Returns:</dt>
<dd><ahref="IMUVelocity.html"title="class in swervelib.imu"><code>IMUVelocity</code></a> for the given gyro with adjusted period readings for velocity.</dd>