Update add function

This commit is contained in:
thenetworkgrinch
2023-03-30 23:28:07 -05:00
parent 3a65fdfc24
commit b1689f3ec2
112 changed files with 291 additions and 247 deletions

View File

@@ -1,11 +1,11 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Wed Mar 29 07:32:19 CDT 2023 -->
<!-- Generated by javadoc (17) on Thu Mar 30 23:27:15 CDT 2023 -->
<title>SwerveController</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2023-03-29">
<meta name="dc.created" content="2023-03-30">
<meta name="description" content="declaration: package: swervelib, class: SwerveController">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
@@ -159,58 +159,64 @@ loadScripts(document, 'script');</script>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Add slew rate limiters to all controls.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRawTargetSpeeds(double,double,double)" class="member-name-link">getRawTargetSpeeds</a><wbr>(double&nbsp;xSpeed,
double&nbsp;ySpeed,
double&nbsp;omega)</code></div>
<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="#getJoystickAngle(double,double)" class="member-name-link">getJoystickAngle</a><wbr>(double&nbsp;headingX,
double&nbsp;headingY)</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 <code>ChassisSpeeds</code> based of raw speeds desired in meters/second and heading in radians.</div>
<div class="block">Get the angle in radians based off of the heading joysticks.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRawTargetSpeeds(double,double,double,double)" class="member-name-link">getRawTargetSpeeds</a><wbr>(double&nbsp;xSpeed,
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRawTargetSpeeds(double,double,double)" class="member-name-link">getRawTargetSpeeds</a><wbr>(double&nbsp;xSpeed,
double&nbsp;ySpeed,
double&nbsp;targetHeadingAngleRadians,
double&nbsp;currentHeadingAngleRadians)</code></div>
double&nbsp;omega)</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 <code>ChassisSpeeds</code> based of raw speeds desired in meters/second and heading in radians.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTargetSpeeds(double,double,double,double)" class="member-name-link">getTargetSpeeds</a><wbr>(double&nbsp;xInput,
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRawTargetSpeeds(double,double,double,double)" class="member-name-link">getRawTargetSpeeds</a><wbr>(double&nbsp;xSpeed,
double&nbsp;ySpeed,
double&nbsp;targetHeadingAngleRadians,
double&nbsp;currentHeadingAngleRadians)</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 <code>ChassisSpeeds</code> based of raw speeds desired in meters/second and heading in radians.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTargetSpeeds(double,double,double,double)" class="member-name-link">getTargetSpeeds</a><wbr>(double&nbsp;xInput,
double&nbsp;yInput,
double&nbsp;angle,
double&nbsp;currentHeadingAngleRadians)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the chassis speeds based on controller input of 1 joystick [-1,1] and an angle.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTargetSpeeds(double,double,double,double,double)" class="member-name-link">getTargetSpeeds</a><wbr>(double&nbsp;xInput,
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>edu.wpi.first.math.kinematics.ChassisSpeeds</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTargetSpeeds(double,double,double,double,double)" class="member-name-link">getTargetSpeeds</a><wbr>(double&nbsp;xInput,
double&nbsp;yInput,
double&nbsp;headingX,
double&nbsp;headingY,
double&nbsp;currentHeadingAngleRadians)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Get the chassis speeds based on controller input of 2 joysticks.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static edu.wpi.first.math.geometry.Translation2d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getTranslation2d(edu.wpi.first.math.kinematics.ChassisSpeeds)" class="member-name-link">getTranslation2d</a><wbr>(edu.wpi.first.math.kinematics.ChassisSpeeds&nbsp;speeds)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static edu.wpi.first.math.geometry.Translation2d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getTranslation2d(edu.wpi.first.math.kinematics.ChassisSpeeds)" class="member-name-link">getTranslation2d</a><wbr>(edu.wpi.first.math.kinematics.ChassisSpeeds&nbsp;speeds)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Helper function to get the <code>Translation2d</code> of the chassis speeds given the <code>ChassisSpeeds</code>.</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="#headingCalculate(double,double)" class="member-name-link">headingCalculate</a><wbr>(double&nbsp;currentHeadingAngleRadians,
<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="#headingCalculate(double,double)" class="member-name-link">headingCalculate</a><wbr>(double&nbsp;currentHeadingAngleRadians,
double&nbsp;targetHeadingAngleRadians)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Calculate the angular velocity given the current and target heading angle in radians.</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="#setMaximumAngularVelocity(double)" class="member-name-link">setMaximumAngularVelocity</a><wbr>(double&nbsp;angularVelocity)</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>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setMaximumAngularVelocity(double)" class="member-name-link">setMaximumAngularVelocity</a><wbr>(double&nbsp;angularVelocity)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set a new maximum angular velocity that is different from the auto-generated one.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#withinHypotDeadband(double,double)" class="member-name-link">withinHypotDeadband</a><wbr>(double&nbsp;x,
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#withinHypotDeadband(double,double)" class="member-name-link">withinHypotDeadband</a><wbr>(double&nbsp;x,
double&nbsp;y)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Calculate the hypot deadband and check if the joystick is within it.</div>
</div>
</div>
@@ -366,6 +372,21 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="getJoystickAngle(double,double)">
<h3>getJoystickAngle</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getJoystickAngle</span><wbr><span class="parameters">(double&nbsp;headingX,
double&nbsp;headingY)</span></div>
<div class="block">Get the angle in radians based off of the heading joysticks.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>headingX</code> - X joystick which controls the angle of the robot.</dd>
<dd><code>headingY</code> - Y joystick which controls the angle of the robot.</dd>
<dt>Returns:</dt>
<dd>angle in radians from the joystick.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getTargetSpeeds(double,double,double,double,double)">
<h3>getTargetSpeeds</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.math.kinematics.ChassisSpeeds</span>&nbsp;<span class="element-name">getTargetSpeeds</span><wbr><span class="parameters">(double&nbsp;xInput,