Files
YAGSL/docs/swervelib/math/SwerveModuleState2.html
thenetworkgrinch b18491fa9c Removed UTF-8 char
2023-04-08 13:47:25 -05:00

283 lines
17 KiB
HTML

<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sat Apr 08 13:46:47 CDT 2023 -->
<title>SwerveModuleState2</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.math, class: SwerveModuleState2">
<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-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<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="../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">swervelib.math</a></div>
<h1 title="Class SwerveModuleState2" class="title">Class SwerveModuleState2</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">edu.wpi.first.math.kinematics.SwerveModuleState
<div class="inheritance">swervelib.math.SwerveModuleState2</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;edu.wpi.first.math.kinematics.SwerveModuleState&gt;</code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">SwerveModuleState2</span>
<span class="extends-implements">extends edu.wpi.first.math.kinematics.SwerveModuleState</span></div>
<div class="block">Second order kinematics swerve module state.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>double</code></div>
<div class="col-second even-row-color"><code><a href="#omegaRadPerSecond" class="member-name-link">omegaRadPerSecond</a></code></div>
<div class="col-last even-row-color">
<div class="block">Rad per sec</div>
</div>
</div>
<div class="inherited-list">
<h3 id="fields-inherited-from-class-edu.wpi.first.math.kinematics.SwerveModuleState">Fields inherited from class&nbsp;edu.wpi.first.math.kinematics.SwerveModuleState</h3>
<code>angle, speedMetersPerSecond</code></div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">SwerveModuleState2</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Constructs a SwerveModuleState with zeros for speed and angle.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(double,edu.wpi.first.math.geometry.Rotation2d,double)" class="member-name-link">SwerveModuleState2</a><wbr>(double&nbsp;speedMetersPerSecond,
edu.wpi.first.math.geometry.Rotation2d&nbsp;angle,
double&nbsp;omegaRadPerSecond)</code></div>
<div class="col-last odd-row-color">
<div class="block">Constructs a SwerveModuleState.</div>
</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(edu.wpi.first.math.kinematics.SwerveModuleState,double)" class="member-name-link">SwerveModuleState2</a><wbr>(edu.wpi.first.math.kinematics.SwerveModuleState&nbsp;state,
double&nbsp;omegaRadPerSecond)</code></div>
<div class="col-last even-row-color">
<div class="block">Create a <a href="SwerveModuleState2.html" title="class in swervelib.math"><code>SwerveModuleState2</code></a> based on the <code>SwerveModuleState</code> with the radians per second defined.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#optimize(swervelib.math.SwerveModuleState2,edu.wpi.first.math.geometry.Rotation2d,swervelib.math.SwerveModuleState2,double)" class="member-name-link">optimize</a><wbr>(<a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>&nbsp;desiredState,
edu.wpi.first.math.geometry.Rotation2d&nbsp;currentAngle,
<a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>&nbsp;lastState,
double&nbsp;moduleSteerFeedForwardClosedLoop)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Minimize the change in heading the desired swerve module state would require by potentially reversing the direction
the wheel spins.</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.SwerveModuleState</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toSwerveModuleState()" class="member-name-link">toSwerveModuleState</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Convert to a <code>SwerveModuleState</code>.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-edu.wpi.first.math.kinematics.SwerveModuleState">Methods inherited from class&nbsp;edu.wpi.first.math.kinematics.SwerveModuleState</h3>
<code>compareTo, equals, hashCode, optimize, toString</code></div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="omegaRadPerSecond">
<h3>omegaRadPerSecond</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">omegaRadPerSecond</span></div>
<div class="block">Rad per sec</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>SwerveModuleState2</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModuleState2</span>()</div>
<div class="block">Constructs a SwerveModuleState with zeros for speed and angle.</div>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(double,edu.wpi.first.math.geometry.Rotation2d,double)">
<h3>SwerveModuleState2</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModuleState2</span><wbr><span class="parameters">(double&nbsp;speedMetersPerSecond,
edu.wpi.first.math.geometry.Rotation2d&nbsp;angle,
double&nbsp;omegaRadPerSecond)</span></div>
<div class="block">Constructs a SwerveModuleState.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>speedMetersPerSecond</code> - The speed of the wheel of the module.</dd>
<dd><code>angle</code> - The angle of the module.</dd>
<dd><code>omegaRadPerSecond</code> - The angular velocity of the module.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(edu.wpi.first.math.kinematics.SwerveModuleState,double)">
<h3>SwerveModuleState2</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModuleState2</span><wbr><span class="parameters">(edu.wpi.first.math.kinematics.SwerveModuleState&nbsp;state,
double&nbsp;omegaRadPerSecond)</span></div>
<div class="block">Create a <a href="SwerveModuleState2.html" title="class in swervelib.math"><code>SwerveModuleState2</code></a> based on the <code>SwerveModuleState</code> with the radians per second defined.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>state</code> - First order kinematic module state.</dd>
<dd><code>omegaRadPerSecond</code> - Module wheel angular rotation in radians per second.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="optimize(swervelib.math.SwerveModuleState2,edu.wpi.first.math.geometry.Rotation2d,swervelib.math.SwerveModuleState2,double)">
<h3>optimize</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a></span>&nbsp;<span class="element-name">optimize</span><wbr><span class="parameters">(<a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>&nbsp;desiredState,
edu.wpi.first.math.geometry.Rotation2d&nbsp;currentAngle,
<a href="SwerveModuleState2.html" title="class in swervelib.math">SwerveModuleState2</a>&nbsp;lastState,
double&nbsp;moduleSteerFeedForwardClosedLoop)</span></div>
<div class="block">Minimize the change in heading the desired swerve module state would require by potentially reversing the direction
the wheel spins. If this is used with the PIDController class's continuous input functionality, the furthest a
wheel will ever rotate is 90 degrees.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>desiredState</code> - The desired state.</dd>
<dd><code>currentAngle</code> - The current module angle.</dd>
<dd><code>lastState</code> - The last state of the module.</dd>
<dd><code>moduleSteerFeedForwardClosedLoop</code> - The module feed forward closed loop for the angle motor.</dd>
<dt>Returns:</dt>
<dd>Optimized swerve module state.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toSwerveModuleState()">
<h3>toSwerveModuleState</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">edu.wpi.first.math.kinematics.SwerveModuleState</span>&nbsp;<span class="element-name">toSwerveModuleState</span>()</div>
<div class="block">Convert to a <code>SwerveModuleState</code>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd><code>SwerveModuleState</code> with the same angle and speed.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>