Added simple conversion factor calculation

This commit is contained in:
thenetworkgrinch
2024-01-18 17:54:43 -06:00
parent dcc6bd8471
commit dd2f187861
108 changed files with 192 additions and 116 deletions

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Thu Jan 18 15:35:15 CST 2024 -->
<!-- Generated by javadoc (17) on Thu Jan 18 17:54:02 CST 2024 -->
<title>SwerveMath</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -129,32 +129,43 @@ loadScripts(document, 'script');</script>
<div class="block">Calculates the maximum acceleration allowed in a direction without tipping the robot.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateDegreesPerSteeringRotation(double,double)" class="member-name-link">calculateDegreesPerSteeringRotation</a><wbr>(double&nbsp;angleGearRatio,
double&nbsp;pulsePerRotation)</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateDegreesPerSteeringRotation(double)" class="member-name-link">calculateDegreesPerSteeringRotation</a><wbr>(double&nbsp;angleGearRatio)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the degrees per steering rotation for the integrated encoder.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAcceleration(double)" class="member-name-link">calculateMaxAcceleration</a><wbr>(double&nbsp;cof)</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateDegreesPerSteeringRotation(double,double)" class="member-name-link">calculateDegreesPerSteeringRotation</a><wbr>(double&nbsp;angleGearRatio,
double&nbsp;pulsePerRotation)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the practical maximum acceleration of the robot using the wheel coefficient of friction.</div>
<div class="block">Calculate the degrees per steering rotation for the integrated encoder.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAcceleration(double,double,double,double,double)" class="member-name-link">calculateMaxAcceleration</a><wbr>(double&nbsp;stallTorqueNm,
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAcceleration(double)" class="member-name-link">calculateMaxAcceleration</a><wbr>(double&nbsp;cof)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the practical maximum acceleration of the robot using the wheel coefficient of friction.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAcceleration(double,double,double,double,double)" class="member-name-link">calculateMaxAcceleration</a><wbr>(double&nbsp;stallTorqueNm,
double&nbsp;gearRatio,
double&nbsp;moduleCount,
double&nbsp;wheelDiameter,
double&nbsp;robotMass)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the maximum theoretical acceleration without friction.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAngularVelocity(double,double,double)" class="member-name-link">calculateMaxAngularVelocity</a><wbr>(double&nbsp;maxSpeed,
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMaxAngularVelocity(double,double,double)" class="member-name-link">calculateMaxAngularVelocity</a><wbr>(double&nbsp;maxSpeed,
double&nbsp;furthestModuleX,
double&nbsp;furthestModuleY)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the maximum angular velocity.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMetersPerRotation(double,double)" class="member-name-link">calculateMetersPerRotation</a><wbr>(double&nbsp;wheelDiameter,
double&nbsp;driveGearRatio)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Calculate the meters per rotation for the integrated encoder.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#calculateMetersPerRotation(double,double,double)" class="member-name-link">calculateMetersPerRotation</a><wbr>(double&nbsp;wheelDiameter,
double&nbsp;driveGearRatio,
@@ -253,6 +264,22 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="calculateMetersPerRotation(double,double)">
<h3>calculateMetersPerRotation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">calculateMetersPerRotation</span><wbr><span class="parameters">(double&nbsp;wheelDiameter,
double&nbsp;driveGearRatio)</span></div>
<div class="block">Calculate the meters per rotation for the integrated encoder. Calculation: (PI * WHEEL DIAMETER IN METERS) / (GEAR
RATIO)</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>wheelDiameter</code> - Wheel diameter in meters.</dd>
<dd><code>driveGearRatio</code> - The gear ratio of the drive motor.</dd>
<dt>Returns:</dt>
<dd>Meters per rotation for the drive motor.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="normalizeAngle(double)">
<h3>normalizeAngle</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">normalizeAngle</span><wbr><span class="parameters">(double&nbsp;angle)</span></div>
@@ -317,6 +344,20 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="calculateDegreesPerSteeringRotation(double)">
<h3>calculateDegreesPerSteeringRotation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">calculateDegreesPerSteeringRotation</span><wbr><span class="parameters">(double&nbsp;angleGearRatio)</span></div>
<div class="block">Calculate the degrees per steering rotation for the integrated encoder. Encoder conversion values. Drive converts
motor rotations to linear wheel distance and steering converts motor rotations to module azimuth.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>angleGearRatio</code> - The gear ratio of the steering motor.</dd>
<dt>Returns:</dt>
<dd>Degrees per steering rotation for the angle motor.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="calculateMaxAngularVelocity(double,double,double)">
<h3>calculateMaxAngularVelocity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">calculateMaxAngularVelocity</span><wbr><span class="parameters">(double&nbsp;maxSpeed,