Added lock to ensure safety of odometry update

This commit is contained in:
thenetworkgrinch
2023-08-29 21:56:52 -05:00
parent 14f66bb679
commit 10a4b528a4
115 changed files with 574 additions and 341 deletions

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Tue Aug 29 21:02:56 CDT 2023 -->
<!-- Generated by javadoc (17) on Tue Aug 29 21:56:11 CDT 2023 -->
<title>SparkMaxEncoderSwerve</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -101,7 +101,7 @@ loadScripts(document, 'script');</script>
</div>
<div class="inherited-list">
<h3 id="fields-inherited-from-class-swervelib.encoders.SwerveAbsoluteEncoder">Fields inherited from class&nbsp;swervelib.encoders.<a href="SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a></h3>
<code><a href="SwerveAbsoluteEncoder.html#readingError">readingError</a></code></div>
<code><a href="SwerveAbsoluteEncoder.html#maximumRetries">maximumRetries</a>, <a href="SwerveAbsoluteEncoder.html#readingError">readingError</a></code></div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
@@ -141,19 +141,24 @@ loadScripts(document, 'script');</script>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Configure the absolute encoder to read from [0, 360) per second.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#factoryDefault()" class="member-name-link">factoryDefault</a>()</code></div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>private void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#configureSparkMax(java.util.function.Supplier)" class="member-name-link">configureSparkMax</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a>&lt;com.revrobotics.REVLibError&gt;&nbsp;config)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Run the configuration until it succeeds or times out.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#factoryDefault()" class="member-name-link">factoryDefault</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Reset the encoder to factory defaults.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="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></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAbsoluteEncoder()" class="member-name-link">getAbsoluteEncoder</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="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></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAbsoluteEncoder()" class="member-name-link">getAbsoluteEncoder</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the instantiated absolute encoder Object.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAbsolutePosition()" class="member-name-link">getAbsolutePosition</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAbsolutePosition()" class="member-name-link">getAbsolutePosition</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the absolute position of the encoder.</div>
</div>
</div>
@@ -210,6 +215,17 @@ loadScripts(document, 'script');</script>
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="configureSparkMax(java.util.function.Supplier)">
<h3>configureSparkMax</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">configureSparkMax</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a>&lt;com.revrobotics.REVLibError&gt;&nbsp;config)</span></div>
<div class="block">Run the configuration until it succeeds or times out.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>config</code> - Lambda supplier returning the error state.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="factoryDefault()">
<h3>factoryDefault</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">factoryDefault</span>()</div>