Updated javadocs

This commit is contained in:
thenetworkgrinch
2023-08-09 16:23:30 -05:00
parent de4e35db62
commit 38c7bdba7d
156 changed files with 3972 additions and 33744 deletions

View File

@@ -1,18 +1,17 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sat Apr 08 13:46:47 CDT 2023 -->
<title>SwerveDrive</title>
<!-- Generated by javadoc (17) -->
<title>SwerveDrive (YAGSL-Lib API)</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-04-08">
<meta name="description" content="declaration: package: swervelib, class: SwerveDrive">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
<script type="text/javascript" src="../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
@@ -36,7 +35,7 @@ loadScripts(document, 'script');</script>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html#class">Help</a></li>
</ul>
</div>
@@ -94,49 +93,29 @@ loadScripts(document, 'script');</script>
<div class="col-first even-row-color"><code>boolean</code></div>
<div class="col-second even-row-color"><code><a href="#chassisVelocityCorrection" class="member-name-link">chassisVelocityCorrection</a></code></div>
<div class="col-last even-row-color">
<div class="block">Correct chassis velocity in <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(Translation2d, double, boolean, boolean)</code></a> using 254's
correction.</div>
<div class="block">Correct chassis velocity in <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(Translation2d, double, boolean, boolean)</code></a>
using 254's correction.</div>
</div>
<div class="col-first odd-row-color"><code>edu.wpi.first.wpilibj.smartdashboard.Field2d</code></div>
<div class="col-second odd-row-color"><code><a href="#field" class="member-name-link">field</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Field object.</div>
</div>
<div class="col-first even-row-color"><code>private <a href="imu/SwerveIMU.html" title="class in swervelib.imu">SwerveIMU</a></code></div>
<div class="col-second even-row-color"><code><a href="#imu" class="member-name-link">imu</a></code></div>
<div class="col-first even-row-color"><code>boolean</code></div>
<div class="col-second even-row-color"><code><a href="#invertOdometry" class="member-name-link">invertOdometry</a></code></div>
<div class="col-last even-row-color">
<div class="block">Swerve IMU device for sensing the heading of the robot.</div>
</div>
<div class="col-first odd-row-color"><code>boolean</code></div>
<div class="col-second odd-row-color"><code><a href="#invertOdometry" class="member-name-link">invertOdometry</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Invert odometry readings of drive motor positions, used as a patch for debugging currently.</div>
</div>
<div class="col-first even-row-color"><code>final <a href="math/SwerveKinematics2.html" title="class in swervelib.math">SwerveKinematics2</a></code></div>
<div class="col-second even-row-color"><code><a href="#kinematics" class="member-name-link">kinematics</a></code></div>
<div class="col-last even-row-color">
<div class="col-first odd-row-color"><code>final <a href="math/SwerveKinematics2.html" title="class in swervelib.math">SwerveKinematics2</a></code></div>
<div class="col-second odd-row-color"><code><a href="#kinematics" class="member-name-link">kinematics</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Swerve Kinematics object utilizing second order kinematics.</div>
</div>
<div class="col-first odd-row-color"><code>private double</code></div>
<div class="col-second odd-row-color"><code><a href="#lastHeadingRadians" class="member-name-link">lastHeadingRadians</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The last heading set in radians.</div>
</div>
<div class="col-first even-row-color"><code>private int</code></div>
<div class="col-second even-row-color"><code><a href="#moduleSynchronizationCounter" class="member-name-link">moduleSynchronizationCounter</a></code></div>
<div class="col-last even-row-color">
<div class="block">Counter to synchronize the modules relative encoder with absolute encoder when not moving.</div>
</div>
<div class="col-first odd-row-color"><code>private <a href="simulation/SwerveIMUSimulation.html" title="class in swervelib.simulation">SwerveIMUSimulation</a></code></div>
<div class="col-second odd-row-color"><code><a href="#simIMU" class="member-name-link">simIMU</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Simulation of the swerve drive.</div>
</div>
<div class="col-first even-row-color"><code>edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;</code></div>
<div class="col-second even-row-color"><code><a href="#stateStdDevs" class="member-name-link">stateStdDevs</a></code></div>
<div class="col-last even-row-color">
<div class="block">Trustworthiness of the internal model of how motors should be moving Measured in expected standard deviation
(meters of position and degrees of rotation)</div>
<div class="block">Trustworthiness of the internal model of how motors should be moving Measured in expected
standard deviation (meters of position and degrees of rotation)</div>
</div>
<div class="col-first odd-row-color"><code><a href="SwerveController.html" title="class in swervelib">SwerveController</a></code></div>
<div class="col-second odd-row-color"><code><a href="#swerveController" class="member-name-link">swerveController</a></code></div>
@@ -153,16 +132,11 @@ loadScripts(document, 'script');</script>
<div class="col-last odd-row-color">
<div class="block">Swerve odometry.</div>
</div>
<div class="col-first even-row-color"><code>private final <a href="SwerveModule.html" title="class in swervelib">SwerveModule</a>[]</code></div>
<div class="col-second even-row-color"><code><a href="#swerveModules" class="member-name-link">swerveModules</a></code></div>
<div class="col-first even-row-color"><code>edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;</code></div>
<div class="col-second even-row-color"><code><a href="#visionMeasurementStdDevs" class="member-name-link">visionMeasurementStdDevs</a></code></div>
<div class="col-last even-row-color">
<div class="block">Swerve modules.</div>
</div>
<div class="col-first odd-row-color"><code>edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;</code></div>
<div class="col-second odd-row-color"><code><a href="#visionMeasurementStdDevs" class="member-name-link">visionMeasurementStdDevs</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Trustworthiness of the vision system Measured in expected standard deviation (meters of position and degrees of
rotation)</div>
<div class="block">Trustworthiness of the vision system Measured in expected standard deviation (meters of
position and degrees of rotation)</div>
</div>
</div>
</section>
@@ -200,8 +174,7 @@ loadScripts(document, 'script');</script>
boolean&nbsp;soft,
double&nbsp;trustWorthiness)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with
the given timestamp of the vision measurement.</div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with the given timestamp of the vision measurement.</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="#addVisionMeasurement(edu.wpi.first.math.geometry.Pose2d,double,boolean,edu.wpi.first.math.Matrix)" class="member-name-link">addVisionMeasurement</a><wbr>(edu.wpi.first.math.geometry.Pose2d&nbsp;robotPose,
@@ -209,8 +182,7 @@ loadScripts(document, 'script');</script>
boolean&nbsp;soft,
edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;&nbsp;visionMeasurementStdDevs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with
the given timestamp of the vision measurement.</div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with the given timestamp of the vision measurement.</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="#disableSecondOrderKinematics()" class="member-name-link">disableSecondOrderKinematics</a>()</code></div>
@@ -244,124 +216,133 @@ 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">Enable second order kinematics for simulation and modifying the feedforward.</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/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;edu.wpi.first.math.geometry.Translation3d&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAccel()" class="member-name-link">getAccel</a>()</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="#enableSecondOrderKinematics(int)" class="member-name-link">enableSecondOrderKinematics</a><wbr>(int&nbsp;motorFreeSpeedRPM)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Enable second order kinematics with calculated values for the feedforward and return the value
used.</div>
</div>
<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/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;edu.wpi.first.math.geometry.Translation3d&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAccel()" class="member-name-link">getAccel</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets current acceleration of the robot in m/s/s.</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="#getFieldVelocity()" class="member-name-link">getFieldVelocity</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>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="#getFieldVelocity()" class="member-name-link">getFieldVelocity</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current field-relative velocity (x, y and omega) of the robot</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.geometry.Rotation3d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGyroRotation3d()" class="member-name-link">getGyroRotation3d</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>edu.wpi.first.math.geometry.Rotation3d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGyroRotation3d()" class="member-name-link">getGyroRotation3d</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current gyro <code>Rotation3d</code> of the robot, as reported by the imu.</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.SwerveModulePosition[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getModulePositions()" class="member-name-link">getModulePositions</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>edu.wpi.first.math.kinematics.SwerveModulePosition[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getModulePositions()" class="member-name-link">getModulePositions</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current module positions (azimuth and wheel position (meters)).</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="SwerveModule.html" title="class in swervelib">SwerveModule</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getModules()" class="member-name-link">getModules</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="SwerveModule.html" title="class in swervelib">SwerveModule</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getModules()" class="member-name-link">getModules</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 <a href="SwerveModule.html" title="class in swervelib"><code>SwerveModule</code></a>s associated with the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a>.</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.geometry.Rotation2d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPitch()" class="member-name-link">getPitch</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>edu.wpi.first.math.geometry.Rotation2d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPitch()" class="member-name-link">getPitch</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current pitch angle of the robot, as reported by the imu.</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.geometry.Pose2d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPose()" class="member-name-link">getPose</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>edu.wpi.first.math.geometry.Pose2d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPose()" class="member-name-link">getPose</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current pose (position and rotation) of the robot, as reported by odometry.</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="#getRobotVelocity()" class="member-name-link">getRobotVelocity</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>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="#getRobotVelocity()" class="member-name-link">getRobotVelocity</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current robot-relative velocity (x, y and omega) of the robot</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.geometry.Rotation2d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRoll()" class="member-name-link">getRoll</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>edu.wpi.first.math.geometry.Rotation2d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRoll()" class="member-name-link">getRoll</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current roll angle of the robot, as reported by the imu.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStates()" class="member-name-link">getStates</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><a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStates()" class="member-name-link">getStates</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current module states (azimuth and velocity)</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="SwerveController.html" title="class in swervelib">SwerveController</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSwerveController()" class="member-name-link">getSwerveController</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Helper function to get the <a href="#swerveController"><code>swerveController</code></a> for the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a> which can be used to
generate <code>ChassisSpeeds</code> for the robot to orient it correctly given axis or angles, and apply
<code>SlewRateLimiter</code> to given inputs.</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.geometry.Pose2d[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSwerveModulePoses(edu.wpi.first.math.geometry.Pose2d)" class="member-name-link">getSwerveModulePoses</a><wbr>(edu.wpi.first.math.geometry.Pose2d&nbsp;robotPose)</code></div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="SwerveController.html" title="class in swervelib">SwerveController</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSwerveController()" class="member-name-link">getSwerveController</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Helper function to get the <a href="#swerveController"><code>swerveController</code></a> for the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a>
which can be used to generate <code>ChassisSpeeds</code> for the robot to orient it correctly given
axis or angles, and apply <code>SlewRateLimiter</code> to given inputs.</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.geometry.Pose2d[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSwerveModulePoses(edu.wpi.first.math.geometry.Pose2d)" class="member-name-link">getSwerveModulePoses</a><wbr>(edu.wpi.first.math.geometry.Pose2d&nbsp;robotPose)</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 swerve module poses and on the field relative to the robot.</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.geometry.Rotation2d</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getYaw()" class="member-name-link">getYaw</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>edu.wpi.first.math.geometry.Rotation2d</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getYaw()" class="member-name-link">getYaw</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Gets the current yaw angle of the robot, as reported by the imu.</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="#lockPose()" class="member-name-link">lockPose</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>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#lockPose()" class="member-name-link">lockPose</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Point all modules toward the robot center, thus making the robot very difficult to move.</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="#postTrajectory(edu.wpi.first.math.trajectory.Trajectory)" class="member-name-link">postTrajectory</a><wbr>(edu.wpi.first.math.trajectory.Trajectory&nbsp;trajectory)</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="#postTrajectory(edu.wpi.first.math.trajectory.Trajectory)" class="member-name-link">postTrajectory</a><wbr>(edu.wpi.first.math.trajectory.Trajectory&nbsp;trajectory)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Post the trajectory to the field</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="#replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward)" class="member-name-link">replaceSwerveModuleFeedforward</a><wbr>(edu.wpi.first.math.controller.SimpleMotorFeedforward&nbsp;feedforward)</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>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward)" class="member-name-link">replaceSwerveModuleFeedforward</a><wbr>(edu.wpi.first.math.controller.SimpleMotorFeedforward&nbsp;feedforward)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Setup the swerve module feedforward.</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="#resetEncoders()" class="member-name-link">resetEncoders</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 drive encoders on the robot, useful when manually resetting the robot without a reboot, like in
autonomous.</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="#resetOdometry(edu.wpi.first.math.geometry.Pose2d)" class="member-name-link">resetOdometry</a><wbr>(edu.wpi.first.math.geometry.Pose2d&nbsp;pose)</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#resetEncoders()" class="member-name-link">resetEncoders</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Reset the drive encoders on the robot, useful when manually resetting the robot without a
reboot, like in autonomous.</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="#resetOdometry(edu.wpi.first.math.geometry.Pose2d)" class="member-name-link">resetOdometry</a><wbr>(edu.wpi.first.math.geometry.Pose2d&nbsp;pose)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Resets odometry to the given pose.</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="#setChassisSpeeds(edu.wpi.first.math.kinematics.ChassisSpeeds)" class="member-name-link">setChassisSpeeds</a><wbr>(edu.wpi.first.math.kinematics.ChassisSpeeds&nbsp;chassisSpeeds)</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="#setChassisSpeeds(edu.wpi.first.math.kinematics.ChassisSpeeds)" class="member-name-link">setChassisSpeeds</a><wbr>(edu.wpi.first.math.kinematics.ChassisSpeeds&nbsp;chassisSpeeds)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set chassis speeds with closed-loop velocity control and second order kinematics.</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="#setGyro(edu.wpi.first.math.geometry.Rotation3d)" class="member-name-link">setGyro</a><wbr>(edu.wpi.first.math.geometry.Rotation3d&nbsp;gyro)</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>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setGyro(edu.wpi.first.math.geometry.Rotation3d)" class="member-name-link">setGyro</a><wbr>(edu.wpi.first.math.geometry.Rotation3d&nbsp;gyro)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the expected gyroscope angle using a <code>Rotation3d</code> object.</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="#setGyroOffset(edu.wpi.first.math.geometry.Rotation3d)" class="member-name-link">setGyroOffset</a><wbr>(edu.wpi.first.math.geometry.Rotation3d&nbsp;offset)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the gyro scope offset to a desired known rotation.</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="#setMaximumSpeed(double)" class="member-name-link">setMaximumSpeed</a><wbr>(double&nbsp;maximumSpeed)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and
<a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is used for the
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(SwerveModuleState2[], boolean)</code></a> function and
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and <a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is
used for the <code>setRawModuleStates(SwerveModuleState2[], boolean)</code> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions.</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="#setMaximumSpeed(double,boolean)" class="member-name-link">setMaximumSpeed</a><wbr>(double&nbsp;maximumSpeed,
boolean&nbsp;updateModuleFeedforward)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and
<a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is used for the
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(SwerveModuleState2[], boolean)</code></a> function and
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and <a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is
used for the <code>setRawModuleStates(SwerveModuleState2[], boolean)</code> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
@@ -372,22 +353,22 @@ loadScripts(document, 'script');</script>
<div class="block">Set the maximum speeds for desaturation.</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="#setModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)" class="member-name-link">setModuleStates</a><wbr>(<a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]&nbsp;desiredStates,
boolean&nbsp;isOpenLoop)</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setModuleStateOptimization(boolean)" class="member-name-link">setModuleStateOptimization</a><wbr>(boolean&nbsp;optimizationEnabled)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Set the module states (azimuth and velocity) directly.</div>
<div class="block">Configure whether the <a href="math/SwerveModuleState2.html" title="class in swervelib.math"><code>SwerveModuleState2</code></a> will be optimized to prevent spinning more
than 90deg.</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="#setMotorIdleMode(boolean)" class="member-name-link">setMotorIdleMode</a><wbr>(boolean&nbsp;brake)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the drive motors to brake/coast mode.</div>
</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="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)" class="member-name-link">setRawModuleStates</a><wbr>(<a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]&nbsp;desiredStates,
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)" class="member-name-link">setModuleStates</a><wbr>(<a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]&nbsp;desiredStates,
boolean&nbsp;isOpenLoop)</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">Set the module states (azimuth and velocity) directly.</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="#setMotorIdleMode(boolean)" class="member-name-link">setMotorIdleMode</a><wbr>(boolean&nbsp;brake)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the drive motors to brake/coast mode.</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="#synchronizeModuleEncoders()" class="member-name-link">synchronizeModuleEncoders</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
@@ -442,13 +423,6 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="swerveModules">
<h3>swerveModules</h3>
<div class="member-signature"><span class="modifiers">private final</span>&nbsp;<span class="return-type"><a href="SwerveModule.html" title="class in swervelib">SwerveModule</a>[]</span>&nbsp;<span class="element-name">swerveModules</span></div>
<div class="block">Swerve modules.</div>
</section>
</li>
<li>
<section class="detail" id="field">
<h3>field</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.wpilibj.smartdashboard.Field2d</span>&nbsp;<span class="element-name">field</span></div>
@@ -466,16 +440,16 @@ loadScripts(document, 'script');</script>
<section class="detail" id="stateStdDevs">
<h3>stateStdDevs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;</span>&nbsp;<span class="element-name">stateStdDevs</span></div>
<div class="block">Trustworthiness of the internal model of how motors should be moving Measured in expected standard deviation
(meters of position and degrees of rotation)</div>
<div class="block">Trustworthiness of the internal model of how motors should be moving Measured in expected
standard deviation (meters of position and degrees of rotation)</div>
</section>
</li>
<li>
<section class="detail" id="visionMeasurementStdDevs">
<h3>visionMeasurementStdDevs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;</span>&nbsp;<span class="element-name">visionMeasurementStdDevs</span></div>
<div class="block">Trustworthiness of the vision system Measured in expected standard deviation (meters of position and degrees of
rotation)</div>
<div class="block">Trustworthiness of the vision system Measured in expected standard deviation (meters of
position and degrees of rotation)</div>
</section>
</li>
<li>
@@ -489,36 +463,8 @@ loadScripts(document, 'script');</script>
<section class="detail" id="chassisVelocityCorrection">
<h3>chassisVelocityCorrection</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">chassisVelocityCorrection</span></div>
<div class="block">Correct chassis velocity in <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(Translation2d, double, boolean, boolean)</code></a> using 254's
correction.</div>
</section>
</li>
<li>
<section class="detail" id="imu">
<h3>imu</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="imu/SwerveIMU.html" title="class in swervelib.imu">SwerveIMU</a></span>&nbsp;<span class="element-name">imu</span></div>
<div class="block">Swerve IMU device for sensing the heading of the robot.</div>
</section>
</li>
<li>
<section class="detail" id="simIMU">
<h3>simIMU</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type"><a href="simulation/SwerveIMUSimulation.html" title="class in swervelib.simulation">SwerveIMUSimulation</a></span>&nbsp;<span class="element-name">simIMU</span></div>
<div class="block">Simulation of the swerve drive.</div>
</section>
</li>
<li>
<section class="detail" id="moduleSynchronizationCounter">
<h3>moduleSynchronizationCounter</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">moduleSynchronizationCounter</span></div>
<div class="block">Counter to synchronize the modules relative encoder with absolute encoder when not moving.</div>
</section>
</li>
<li>
<section class="detail" id="lastHeadingRadians">
<h3>lastHeadingRadians</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">lastHeadingRadians</span></div>
<div class="block">The last heading set in radians.</div>
<div class="block">Correct chassis velocity in <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(Translation2d, double, boolean, boolean)</code></a>
using 254's correction.</div>
</section>
</li>
</ul>
@@ -534,16 +480,18 @@ loadScripts(document, 'script');</script>
<h3>SwerveDrive</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveDrive</span><wbr><span class="parameters">(<a href="parser/SwerveDriveConfiguration.html" title="class in swervelib.parser">SwerveDriveConfiguration</a>&nbsp;config,
<a href="parser/SwerveControllerConfiguration.html" title="class in swervelib.parser">SwerveControllerConfiguration</a>&nbsp;controllerConfig)</span></div>
<div class="block">Creates a new swerve drivebase subsystem. Robot is controlled via the <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(edu.wpi.first.math.geometry.Translation2d, double, boolean, boolean)</code></a> method, or via the
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(swervelib.math.SwerveModuleState2[], boolean)</code></a> method. The <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(edu.wpi.first.math.geometry.Translation2d, double, boolean, boolean)</code></a> method incorporates kinematics-- it
takes a translation and rotation, as well as parameters for field-centric and closed-loop velocity control.
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(swervelib.math.SwerveModuleState2[], boolean)</code></a> takes a list of SwerveModuleStates and directly passes them to the modules.
This subsystem also handles odometry.</div>
<div class="block">Creates a new swerve drivebase subsystem. Robot is controlled via the <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(edu.wpi.first.math.geometry.Translation2d, double, boolean, boolean)</code></a>
method, or via the <code>setRawModuleStates(swervelib.math.SwerveModuleState2[], boolean)</code> method. The <a href="#drive(edu.wpi.first.math.geometry.Translation2d,double,boolean,boolean)"><code>drive(edu.wpi.first.math.geometry.Translation2d, double, boolean, boolean)</code></a>
method incorporates kinematics-- it takes a translation and rotation, as well as parameters for
field-centric and closed-loop velocity control. <code>setRawModuleStates(swervelib.math.SwerveModuleState2[], boolean)</code> takes a
list of SwerveModuleStates and directly passes them to the modules. This subsystem also handles
odometry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>config</code> - The <a href="parser/SwerveDriveConfiguration.html" title="class in swervelib.parser"><code>SwerveDriveConfiguration</code></a> configuration to base the swerve drive off of.</dd>
<dd><code>config</code> - The <a href="parser/SwerveDriveConfiguration.html" title="class in swervelib.parser"><code>SwerveDriveConfiguration</code></a> configuration to base the swerve drive off
of.</dd>
<dd><code>controllerConfig</code> - The <a href="parser/SwerveControllerConfiguration.html" title="class in swervelib.parser"><code>SwerveControllerConfiguration</code></a> to use when creating the
<a href="SwerveController.html" title="class in swervelib"><code>SwerveController</code></a>.</dd>
<a href="SwerveController.html" title="class in swervelib"><code>SwerveController</code></a>.</dd>
</dl>
</section>
</li>
@@ -562,21 +510,22 @@ loadScripts(document, 'script');</script>
double&nbsp;rotation,
boolean&nbsp;fieldRelative,
boolean&nbsp;isOpenLoop)</span></div>
<div class="block">The primary method for controlling the drivebase. Takes a Translation2d and a rotation rate, and calculates and
commands module states accordingly. Can use either open-loop or closed-loop velocity control for the wheel
velocities. Also has field- and robot-relative modes, which affect how the translation vector is used. This method
defaults to no heading correction.</div>
<div class="block">The primary method for controlling the drivebase. Takes a Translation2d and a rotation rate,
and calculates and commands module states accordingly. Can use either open-loop or closed-loop
velocity control for the wheel velocities. Also has field- and robot-relative modes, which
affect how the translation vector is used. This method defaults to no heading correction.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>translation</code> - <code>Translation2d</code> that is the commanded linear velocity of the robot, in meters per
second. In robot-relative mode, positive x is torwards the bow (front) and positive y is
torwards port (left). In field-relative mode, positive x is away from the alliance wall (field
North) and positive y is torwards the left wall when looking through the driver station glass
(field West).</dd>
<dd><code>rotation</code> - Robot angular rate, in radians per second. CCW positive. Unaffected by field/robot
relativity.</dd>
<dd><code>translation</code> - <code>Translation2d</code> that is the commanded linear velocity of the robot, in
meters per second. In robot-relative mode, positive x is torwards the bow (front) and
positive y is torwards port (left). In field-relative mode, positive x is away from the
alliance wall (field North) and positive y is torwards the left wall when looking through
the driver station glass (field West).</dd>
<dd><code>rotation</code> - Robot angular rate, in radians per second. CCW positive. Unaffected by
field/robot relativity.</dd>
<dd><code>fieldRelative</code> - Drive mode. True for field-relative, false for robot-relative.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable closed-loop.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable
closed-loop.</dd>
</dl>
</section>
</li>
@@ -588,21 +537,24 @@ loadScripts(document, 'script');</script>
boolean&nbsp;fieldRelative,
boolean&nbsp;isOpenLoop,
boolean&nbsp;headingCorrection)</span></div>
<div class="block">The primary method for controlling the drivebase. Takes a Translation2d and a rotation rate, and calculates and
commands module states accordingly. Can use either open-loop or closed-loop velocity control for the wheel
velocities. Also has field- and robot-relative modes, which affect how the translation vector is used.</div>
<div class="block">The primary method for controlling the drivebase. Takes a Translation2d and a rotation rate,
and calculates and commands module states accordingly. Can use either open-loop or closed-loop
velocity control for the wheel velocities. Also has field- and robot-relative modes, which
affect how the translation vector is used.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>translation</code> - <code>Translation2d</code> that is the commanded linear velocity of the robot, in meters per
second. In robot-relative mode, positive x is torwards the bow (front) and positive y is
torwards port (left). In field-relative mode, positive x is away from the alliance wall
(field North) and positive y is torwards the left wall when looking through the driver
station glass (field West).</dd>
<dd><code>rotation</code> - Robot angular rate, in radians per second. CCW positive. Unaffected by field/robot
relativity.</dd>
<dd><code>translation</code> - <code>Translation2d</code> that is the commanded linear velocity of the robot, in
meters per second. In robot-relative mode, positive x is torwards the bow (front) and
positive y is torwards port (left). In field-relative mode, positive x is away from the
alliance wall (field North) and positive y is torwards the left wall when looking through
the driver station glass (field West).</dd>
<dd><code>rotation</code> - Robot angular rate, in radians per second. CCW positive. Unaffected by
field/robot relativity.</dd>
<dd><code>fieldRelative</code> - Drive mode. True for field-relative, false for robot-relative.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable closed-loop.</dd>
<dd><code>headingCorrection</code> - Whether to correct heading when driving translationally. Set to true to enable.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable
closed-loop.</dd>
<dd><code>headingCorrection</code> - Whether to correct heading when driving translationally. Set to true
to enable.</dd>
</dl>
</section>
</li>
@@ -615,25 +567,12 @@ loadScripts(document, 'script');</script>
<div class="block">Set the maximum speeds for desaturation.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>attainableMaxModuleSpeedMetersPerSecond</code> - The absolute max speed that a module can reach in meters per
second.</dd>
<dd><code>attainableMaxTranslationalSpeedMetersPerSecond</code> - The absolute max speed that your robot can reach while
translating in meters per second.</dd>
<dd><code>attainableMaxRotationalVelocityRadiansPerSecond</code> - The absolute max speed the robot can reach while rotating in
radians per second.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setRawModuleStates(swervelib.math.SwerveModuleState2[],boolean)">
<h3>setRawModuleStates</h3>
<div class="member-signature"><span class="modifiers">private</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setRawModuleStates</span><wbr><span class="parameters">(<a href="math/SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>[]&nbsp;desiredStates,
boolean&nbsp;isOpenLoop)</span></div>
<div class="block">Set the module states (azimuth and velocity) directly. Used primarily for auto pathing.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>desiredStates</code> - A list of SwerveModuleStates to send to the modules.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable closed-loop.</dd>
<dd><code>attainableMaxModuleSpeedMetersPerSecond</code> - The absolute max speed that a module can reach
in meters per second.</dd>
<dd><code>attainableMaxTranslationalSpeedMetersPerSecond</code> - The absolute max speed that your robot
can reach while translating in meters per second.</dd>
<dd><code>attainableMaxRotationalVelocityRadiansPerSecond</code> - The absolute max speed the robot can
reach while rotating in radians per second.</dd>
</dl>
</section>
</li>
@@ -646,7 +585,8 @@ loadScripts(document, 'script');</script>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>desiredStates</code> - A list of SwerveModuleStates to send to the modules.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable closed-loop.</dd>
<dd><code>isOpenLoop</code> - Whether to use closed-loop velocity control. Set to true to disable
closed-loop.</dd>
</dl>
</section>
</li>
@@ -698,9 +638,9 @@ loadScripts(document, 'script');</script>
<section class="detail" id="resetOdometry(edu.wpi.first.math.geometry.Pose2d)">
<h3>resetOdometry</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">resetOdometry</span><wbr><span class="parameters">(edu.wpi.first.math.geometry.Pose2d&nbsp;pose)</span></div>
<div class="block">Resets odometry to the given pose. Gyro angle and module positions do not need to be reset when calling this
method. However, if either gyro angle or module position is reset, this must be called in order for odometry to
keep working.</div>
<div class="block">Resets odometry to the given pose. Gyro angle and module positions do not need to be reset when
calling this method. However, if either gyro angle or module position is reset, this must be
called in order for odometry to keep working.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>pose</code> - The pose to set the odometry to</dd>
@@ -733,8 +673,8 @@ loadScripts(document, 'script');</script>
<section class="detail" id="getModulePositions()">
<h3>getModulePositions</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.math.kinematics.SwerveModulePosition[]</span>&nbsp;<span class="element-name">getModulePositions</span>()</div>
<div class="block">Gets the current module positions (azimuth and wheel position (meters)). Inverts the distance from each module if
<a href="#invertOdometry"><code>invertOdometry</code></a> is true.</div>
<div class="block">Gets the current module positions (azimuth and wheel position (meters)). Inverts the distance
from each module if <a href="#invertOdometry"><code>invertOdometry</code></a> is true.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>A list of SwerveModulePositions containg the current module positions</dd>
@@ -819,17 +759,17 @@ loadScripts(document, 'script');</script>
<h3>setMaximumSpeed</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setMaximumSpeed</span><wbr><span class="parameters">(double&nbsp;maximumSpeed,
boolean&nbsp;updateModuleFeedforward)</span></div>
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and
<a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is used for the
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(SwerveModuleState2[], boolean)</code></a> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions. This function overrides
what was placed in the JSON and could damage your motor/robot if set too high or unachievable rates.</div>
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and <a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is
used for the <code>setRawModuleStates(SwerveModuleState2[], boolean)</code> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions.
This function overrides what was placed in the JSON and could damage your motor/robot if set
too high or unachievable rates.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>maximumSpeed</code> - Maximum speed for the drive motors in meters / second.</dd>
<dd><code>updateModuleFeedforward</code> - Update the swerve module feedforward to account for the new maximum speed. This
should be true unless you have replaced the drive motor feedforward with
<a href="#replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward)"><code>replaceSwerveModuleFeedforward(SimpleMotorFeedforward)</code></a></dd>
<dd><code>updateModuleFeedforward</code> - Update the swerve module feedforward to account for the new
maximum speed. This should be true unless you have replaced the drive motor feedforward
with <a href="#replaceSwerveModuleFeedforward(edu.wpi.first.math.controller.SimpleMotorFeedforward)"><code>replaceSwerveModuleFeedforward(SimpleMotorFeedforward)</code></a></dd>
</dl>
</section>
</li>
@@ -837,12 +777,11 @@ loadScripts(document, 'script');</script>
<section class="detail" id="setMaximumSpeed(double)">
<h3>setMaximumSpeed</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setMaximumSpeed</span><wbr><span class="parameters">(double&nbsp;maximumSpeed)</span></div>
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and
<a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is used for the
<a href="#setRawModuleStates(swervelib.math.SwerveModuleState2%5B%5D,boolean)"><code>setRawModuleStates(SwerveModuleState2[], boolean)</code></a> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions. This function overrides
what was placed in the JSON and could damage your motor/robot if set too high or unachievable rates. Overwrites the
<a href="SwerveModule.html#feedforward"><code>SwerveModule.feedforward</code></a>.</div>
<div class="block">Set the maximum speed of the drive motors, modified <a href="parser/SwerveControllerConfiguration.html#maxSpeed"><code>SwerveControllerConfiguration.maxSpeed</code></a> and <a href="parser/SwerveDriveConfiguration.html#maxSpeed"><code>SwerveDriveConfiguration.maxSpeed</code></a> which is
used for the <code>setRawModuleStates(SwerveModuleState2[], boolean)</code> function and
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double, double)</code></a> functions.
This function overrides what was placed in the JSON and could damage your motor/robot if set
too high or unachievable rates. Overwrites the <a href="SwerveModule.html#feedforward"><code>SwerveModule.feedforward</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>maximumSpeed</code> - Maximum speed for the drive motors in meters / second.</dd>
@@ -853,8 +792,8 @@ loadScripts(document, 'script');</script>
<section class="detail" id="lockPose()">
<h3>lockPose</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">lockPose</span>()</div>
<div class="block">Point all modules toward the robot center, thus making the robot very difficult to move. Forcing the robot to keep
the current pose.</div>
<div class="block">Point all modules toward the robot center, thus making the robot very difficult to move.
Forcing the robot to keep the current pose.</div>
</section>
</li>
<li>
@@ -885,9 +824,9 @@ loadScripts(document, 'script');</script>
<section class="detail" id="updateOdometry()">
<h3>updateOdometry</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">updateOdometry</span>()</div>
<div class="block">Update odometry should be run every loop. Synchronizes module absolute encoders with relative encoders
periodically. In simulation mode will also post the pose of each module. Updates SmartDashboard with module encoder
readings and states.</div>
<div class="block">Update odometry should be run every loop. Synchronizes module absolute encoders with relative
encoders periodically. In simulation mode will also post the pose of each module. Updates
SmartDashboard with module encoder readings and states.</div>
</section>
</li>
<li>
@@ -898,25 +837,35 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="setGyroOffset(edu.wpi.first.math.geometry.Rotation3d)">
<h3>setGyroOffset</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setGyroOffset</span><wbr><span class="parameters">(edu.wpi.first.math.geometry.Rotation3d&nbsp;offset)</span></div>
<div class="block">Set the gyro scope offset to a desired known rotation. Unlike <a href="#setGyro(edu.wpi.first.math.geometry.Rotation3d)"><code>setGyro(Rotation3d)</code></a> it DOES NOT take the current rotation into account.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>offset</code> - <code>Rotation3d</code> known offset of the robot for gyroscope to use.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addVisionMeasurement(edu.wpi.first.math.geometry.Pose2d,double,boolean,double)">
<h3>addVisionMeasurement</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addVisionMeasurement</span><wbr><span class="parameters">(edu.wpi.first.math.geometry.Pose2d&nbsp;robotPose,
double&nbsp;timestamp,
boolean&nbsp;soft,
double&nbsp;trustWorthiness)</span></div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with
the given timestamp of the vision measurement.</div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with the given timestamp of the vision measurement. <br>
<b>IT IS HIGHLY RECOMMENDED TO UPDATE YOUR GYROSCOPE OFFSET AFTER USING THIS FUNCTION!</b> <br>
To update your gyroscope readings directly use <a href="#setGyroOffset(edu.wpi.first.math.geometry.Rotation3d)"><code>setGyroOffset(Rotation3d)</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>robotPose</code> - Robot <code>Pose2d</code> as measured by vision.</dd>
<dd><code>timestamp</code> - Timestamp the measurement was taken as time since startup, should be taken from
<code>Timer.getFPGATimestamp()</code> or similar sources.</dd>
<dd><code>soft</code> - Add vision estimate using the
<code>SwerveDrivePoseEstimator.addVisionMeasurement(Pose2d, double)</code> function, or hard
reset odometry with the given position with
<code>SwerveDriveOdometry.resetPosition(Rotation2d, SwerveModulePosition[], Pose2d)</code>.</dd>
<dd><code>trustWorthiness</code> - Trust level of vision reading when using a soft measurement, used to multiply the standard
deviation. Set to 1 for full trust.</dd>
<dd><code>timestamp</code> - Timestamp the measurement was taken as time since startup, should be taken
from <code>Timer.getFPGATimestamp()</code> or similar sources.</dd>
<dd><code>soft</code> - Add vision estimate using the <code>PoseEstimator.addVisionMeasurement(Pose2d, double)</code> function, or hard reset
odometry with the given position with <code>SwerveDriveOdometry.resetPosition(Rotation2d, SwerveModulePosition[], Pose2d)</code>.</dd>
<dd><code>trustWorthiness</code> - Trust level of vision reading when using a soft measurement, used to
multiply the standard deviation. Set to 1 for full trust. Higher = Less Weight.</dd>
</dl>
</section>
</li>
@@ -927,19 +876,16 @@ loadScripts(document, 'script');</script>
double&nbsp;timestamp,
boolean&nbsp;soft,
edu.wpi.first.math.Matrix&lt;edu.wpi.first.math.numbers.N3,<wbr>edu.wpi.first.math.numbers.N1&gt;&nbsp;visionMeasurementStdDevs)</span></div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with
the given timestamp of the vision measurement.</div>
<div class="block">Add a vision measurement to the <code>SwerveDrivePoseEstimator</code> and update the <a href="imu/SwerveIMU.html" title="class in swervelib.imu"><code>SwerveIMU</code></a> gyro reading with the given timestamp of the vision measurement.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>robotPose</code> - Robot <code>Pose2d</code> as measured by vision.</dd>
<dd><code>timestamp</code> - Timestamp the measurement was taken as time since startup, should be taken from
<code>Timer.getFPGATimestamp()</code> or similar sources.</dd>
<dd><code>soft</code> - Add vision estimate using the
<code>SwerveDrivePoseEstimator.addVisionMeasurement(Pose2d, double)</code> function, or
hard reset odometry with the given position with
<code>SwerveDriveOdometry.resetPosition(Rotation2d, SwerveModulePosition[], Pose2d)</code>.</dd>
<dd><code>timestamp</code> - Timestamp the measurement was taken as time since startup, should be taken
from <code>Timer.getFPGATimestamp()</code> or similar sources.</dd>
<dd><code>soft</code> - Add vision estimate using the <code>PoseEstimator.addVisionMeasurement(Pose2d, double)</code> function, or hard reset
odometry with the given position with <code>SwerveDriveOdometry.resetPosition(Rotation2d, SwerveModulePosition[], Pose2d)</code>.</dd>
<dd><code>visionMeasurementStdDevs</code> - Vision measurement standard deviation that will be sent to the
<code>SwerveDrivePoseEstimator</code>.</dd>
<code>SwerveDrivePoseEstimator</code>.</dd>
</dl>
</section>
</li>
@@ -948,10 +894,10 @@ loadScripts(document, 'script');</script>
<h3>setGyro</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setGyro</span><wbr><span class="parameters">(edu.wpi.first.math.geometry.Rotation3d&nbsp;gyro)</span></div>
<div class="block">Set the expected gyroscope angle using a <code>Rotation3d</code> object. To reset gyro, set to a new
<code>Rotation3d</code>.</div>
<code>Rotation3d</code> subtracted from the current gyroscopic readings <a href="imu/SwerveIMU.html#getRotation3d()"><code>SwerveIMU.getRotation3d()</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>gyro</code> - expected gyroscope angle.</dd>
<dd><code>gyro</code> - expected gyroscope angle as <code>Rotation3d</code>.</dd>
</dl>
</section>
</li>
@@ -959,12 +905,10 @@ loadScripts(document, 'script');</script>
<section class="detail" id="getSwerveController()">
<h3>getSwerveController</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="SwerveController.html" title="class in swervelib">SwerveController</a></span>&nbsp;<span class="element-name">getSwerveController</span>()</div>
<div class="block">Helper function to get the <a href="#swerveController"><code>swerveController</code></a> for the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a> which can be used to
generate <code>ChassisSpeeds</code> for the robot to orient it correctly given axis or angles, and apply
<code>SlewRateLimiter</code> to given inputs. Important functions to look at are
<a href="SwerveController.html#getTargetSpeeds(double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double)</code></a>,
<a href="SwerveController.html#addSlewRateLimiters(edu.wpi.first.math.filter.SlewRateLimiter,edu.wpi.first.math.filter.SlewRateLimiter,edu.wpi.first.math.filter.SlewRateLimiter)"><code>SwerveController.addSlewRateLimiters(SlewRateLimiter, SlewRateLimiter, SlewRateLimiter)</code></a>,
<a href="SwerveController.html#getRawTargetSpeeds(double,double,double)"><code>SwerveController.getRawTargetSpeeds(double, double, double)</code></a>.</div>
<div class="block">Helper function to get the <a href="#swerveController"><code>swerveController</code></a> for the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a>
which can be used to generate <code>ChassisSpeeds</code> for the robot to orient it correctly given
axis or angles, and apply <code>SlewRateLimiter</code> to given inputs.
Important functions to look at are <a href="SwerveController.html#getTargetSpeeds(double,double,double,double)"><code>SwerveController.getTargetSpeeds(double, double, double, double)</code></a>, <a href="SwerveController.html#addSlewRateLimiters(edu.wpi.first.math.filter.SlewRateLimiter,edu.wpi.first.math.filter.SlewRateLimiter,edu.wpi.first.math.filter.SlewRateLimiter)"><code>SwerveController.addSlewRateLimiters(SlewRateLimiter, SlewRateLimiter, SlewRateLimiter)</code></a>, <a href="SwerveController.html#getRawTargetSpeeds(double,double,double)"><code>SwerveController.getRawTargetSpeeds(double, double, double)</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd><a href="SwerveController.html" title="class in swervelib"><code>SwerveController</code></a> for the <a href="SwerveDrive.html" title="class in swervelib"><code>SwerveDrive</code></a>.</dd>
@@ -986,16 +930,28 @@ loadScripts(document, 'script');</script>
<section class="detail" id="resetEncoders()">
<h3>resetEncoders</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">resetEncoders</span>()</div>
<div class="block">Reset the drive encoders on the robot, useful when manually resetting the robot without a reboot, like in
autonomous.</div>
<div class="block">Reset the drive encoders on the robot, useful when manually resetting the robot without a
reboot, like in autonomous.</div>
</section>
</li>
<li>
<section class="detail" id="setModuleStateOptimization(boolean)">
<h3>setModuleStateOptimization</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setModuleStateOptimization</span><wbr><span class="parameters">(boolean&nbsp;optimizationEnabled)</span></div>
<div class="block">Configure whether the <a href="math/SwerveModuleState2.html" title="class in swervelib.math"><code>SwerveModuleState2</code></a> will be optimized to prevent spinning more
than 90deg.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>optimizationEnabled</code> - Whether the module optimization is enabled.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="enableSecondOrderKinematics(double)">
<h3>enableSecondOrderKinematics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">enableSecondOrderKinematics</span><wbr><span class="parameters">(double&nbsp;moduleFeedforward)</span></div>
<div class="block">Enable second order kinematics for simulation and modifying the feedforward. Second order kinematics could increase
accuracy in odometry.</div>
<div class="block">Enable second order kinematics for simulation and modifying the feedforward. Second order
kinematics could increase accuracy in odometry.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>moduleFeedforward</code> - Module feedforward to apply should be between [-1, 1] excluding 0.</dd>
@@ -1003,6 +959,20 @@ loadScripts(document, 'script');</script>
</section>
</li>
<li>
<section class="detail" id="enableSecondOrderKinematics(int)">
<h3>enableSecondOrderKinematics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">enableSecondOrderKinematics</span><wbr><span class="parameters">(int&nbsp;motorFreeSpeedRPM)</span></div>
<div class="block">Enable second order kinematics with calculated values for the feedforward and return the value
used.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>motorFreeSpeedRPM</code> - Steering motor free speed RPM.</dd>
<dt>Returns:</dt>
<dd>The feedforward value used for the last swerve module.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="enableSecondOrderKinematics()">
<h3>enableSecondOrderKinematics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">enableSecondOrderKinematics</span>()</div>