Files
YAGSL/docs/swervelib/motors/TalonFXSwerve.html
2023-02-13 17:21:24 -06:00

903 lines
38 KiB
HTML

<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.17) on Mon Feb 13 17:20:01 CST 2023 -->
<title>TalonFXSwerve</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2023-02-13">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery/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="../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../jquery/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../jquery/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TalonFXSwerve";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-files/index-1.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">swervelib.motors</a></div>
<h2 title="Class TalonFXSwerve" class="title">Class TalonFXSwerve</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="SwerveMotor.html" title="class in swervelib.motors">swervelib.motors.SwerveMotor</a></li>
<li>
<ul class="inheritance">
<li>swervelib.motors.TalonFXSwerve</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">TalonFXSwerve</span>
extends <a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></pre>
<div class="block"><code>TalonFX</code> Swerve Motor.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#absoluteEncoder">absoluteEncoder</a></span></code></th>
<td class="colLast">
<div class="block">Whether the absolute encoder is integrated.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#factoryDefaultOccurred">factoryDefaultOccurred</a></span></code></th>
<td class="colLast">
<div class="block">Factory default already occurred.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>(package private) com.ctre.phoenix.motorcontrol.can.WPI_TalonFX</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#motor">motor</a></span></code></th>
<td class="colLast">
<div class="block">TalonFX motor controller.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#positionConversionFactor">positionConversionFactor</a></span></code></th>
<td class="colLast">
<div class="block">The position conversion factor.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.swervelib.motors.SwerveMotor">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;swervelib.motors.<a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></h3>
<code><a href="SwerveMotor.html#isDriveMotor">isDriveMotor</a></code></li>
</ul>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,boolean)">TalonFXSwerve</a></span>&#8203;(int&nbsp;id,
boolean&nbsp;isDriveMotor)</code></th>
<td class="colLast">
<div class="block">Construct the TalonFX swerve motor given the ID.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,java.lang.String,boolean)">TalonFXSwerve</a></span>&#8203;(int&nbsp;id,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;canbus,
boolean&nbsp;isDriveMotor)</code></th>
<td class="colLast">
<div class="block">Construct the TalonFX swerve motor given the ID and CANBus.</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(com.ctre.phoenix.motorcontrol.can.WPI_TalonFX,boolean)">TalonFXSwerve</a></span>&#8203;(com.ctre.phoenix.motorcontrol.can.WPI_TalonFX&nbsp;motor,
boolean&nbsp;isDriveMotor)</code></th>
<td class="colLast">
<div class="block">Constructor for TalonFX swerve motor.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#burnFlash()">burnFlash</a></span>()</code></th>
<td class="colLast">
<div class="block">Save the configurations from flash to EEPROM.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearStickyFaults()">clearStickyFaults</a></span>()</code></th>
<td class="colLast">
<div class="block">Clear the sticky faults on the motor controller.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#configureIntegratedEncoder(double)">configureIntegratedEncoder</a></span>&#8203;(double&nbsp;positionConversionFactor)</code></th>
<td class="colLast">
<div class="block">Configure the integrated encoder for the swerve module.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#configurePIDF(swervelib.parser.PIDFConfig)">configurePIDF</a></span>&#8203;(<a href="../parser/PIDFConfig.html" title="class in swervelib.parser">PIDFConfig</a>&nbsp;config)</code></th>
<td class="colLast">
<div class="block">Configure the PIDF values for the closed loop controller.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#configurePIDWrapping(double,double)">configurePIDWrapping</a></span>&#8203;(double&nbsp;minInput,
double&nbsp;maxInput)</code></th>
<td class="colLast">
<div class="block">Configure the PID wrapping for the position closed loop controller.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#factoryDefaults()">factoryDefaults</a></span>()</code></th>
<td class="colLast">
<div class="block">Configure the factory defaults.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMotor()">getMotor</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the motor object from the module.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPosition()">getPosition</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the position of the integrated encoder.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getVelocity()">getVelocity</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the velocity of the integrated encoder.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAttachedAbsoluteEncoder()">isAttachedAbsoluteEncoder</a></span>()</code></th>
<td class="colLast">
<div class="block">Queries whether the absolute encoder is directly attached to the motor controller.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(double)">set</a></span>&#8203;(double&nbsp;percentOutput)</code></th>
<td class="colLast">
<div class="block">Set the percentage output.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)">setAbsoluteEncoder</a></span>&#8203;(<a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a>&nbsp;encoder)</code></th>
<td class="colLast">
<div class="block">Set the absolute encoder to be a compatible absolute encoder.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setCurrentLimit(int)">setCurrentLimit</a></span>&#8203;(int&nbsp;currentLimit)</code></th>
<td class="colLast">
<div class="block">Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with
voltage compensation.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setInverted(boolean)">setInverted</a></span>&#8203;(boolean&nbsp;inverted)</code></th>
<td class="colLast">
<div class="block">Set the motor to be inverted.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setLoopRampRate(double)">setLoopRampRate</a></span>&#8203;(double&nbsp;rampRate)</code></th>
<td class="colLast">
<div class="block">Set the maximum rate the open/closed loop output can change by.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMotorBrake(boolean)">setMotorBrake</a></span>&#8203;(boolean&nbsp;isBrakeMode)</code></th>
<td class="colLast">
<div class="block">Set the idle mode.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPosition(double)">setPosition</a></span>&#8203;(double&nbsp;position)</code></th>
<td class="colLast">
<div class="block">Set the integrated encoder position.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setReference(double,double)">setReference</a></span>&#8203;(double&nbsp;setpoint,
double&nbsp;feedforward)</code></th>
<td class="colLast">
<div class="block">Set the closed loop PID controller reference point.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setVoltageCompensation(double)">setVoltageCompensation</a></span>&#8203;(double&nbsp;nominalVoltage)</code></th>
<td class="colLast">
<div class="block">Set the voltage compensation for the swerve module motor.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="motor">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>motor</h4>
<pre>com.ctre.phoenix.motorcontrol.can.WPI_TalonFX motor</pre>
<div class="block">TalonFX motor controller.</div>
</li>
</ul>
<a id="factoryDefaultOccurred">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>factoryDefaultOccurred</h4>
<pre>private final&nbsp;boolean factoryDefaultOccurred</pre>
<div class="block">Factory default already occurred.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#swervelib.motors.TalonFXSwerve.factoryDefaultOccurred">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="absoluteEncoder">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>absoluteEncoder</h4>
<pre>private&nbsp;boolean absoluteEncoder</pre>
<div class="block">Whether the absolute encoder is integrated.</div>
</li>
</ul>
<a id="positionConversionFactor">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>positionConversionFactor</h4>
<pre>private&nbsp;double positionConversionFactor</pre>
<div class="block">The position conversion factor.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(com.ctre.phoenix.motorcontrol.can.WPI_TalonFX,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TalonFXSwerve</h4>
<pre>public&nbsp;TalonFXSwerve&#8203;(com.ctre.phoenix.motorcontrol.can.WPI_TalonFX&nbsp;motor,
boolean&nbsp;isDriveMotor)</pre>
<div class="block">Constructor for TalonFX swerve motor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>motor</code> - Motor to use.</dd>
<dd><code>isDriveMotor</code> - Whether this motor is a drive motor.</dd>
</dl>
</li>
</ul>
<a id="&lt;init&gt;(int,java.lang.String,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TalonFXSwerve</h4>
<pre>public&nbsp;TalonFXSwerve&#8203;(int&nbsp;id,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;canbus,
boolean&nbsp;isDriveMotor)</pre>
<div class="block">Construct the TalonFX swerve motor given the ID and CANBus.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>id</code> - ID of the TalonFX on the CANBus.</dd>
<dd><code>canbus</code> - CANBus on which the TalonFX is on.</dd>
<dd><code>isDriveMotor</code> - Whether the motor is a drive or steering motor.</dd>
</dl>
</li>
</ul>
<a id="&lt;init&gt;(int,boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TalonFXSwerve</h4>
<pre>public&nbsp;TalonFXSwerve&#8203;(int&nbsp;id,
boolean&nbsp;isDriveMotor)</pre>
<div class="block">Construct the TalonFX swerve motor given the ID.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>id</code> - ID of the TalonFX on the canbus.</dd>
<dd><code>isDriveMotor</code> - Whether the motor is a drive or steering motor.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="factoryDefaults()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>factoryDefaults</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;factoryDefaults()</pre>
<div class="block">Configure the factory defaults.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#factoryDefaults()">factoryDefaults</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
</dl>
</li>
</ul>
<a id="clearStickyFaults()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearStickyFaults</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;clearStickyFaults()</pre>
<div class="block">Clear the sticky faults on the motor controller.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#clearStickyFaults()">clearStickyFaults</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
</dl>
</li>
</ul>
<a id="setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAbsoluteEncoder</h4>
<pre class="methodSignature">public&nbsp;<a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a>&nbsp;setAbsoluteEncoder&#8203;(<a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a>&nbsp;encoder)</pre>
<div class="block">Set the absolute encoder to be a compatible absolute encoder.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)">setAbsoluteEncoder</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>encoder</code> - The encoder to use.</dd>
</dl>
</li>
</ul>
<a id="configureIntegratedEncoder(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configureIntegratedEncoder</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;configureIntegratedEncoder&#8203;(double&nbsp;positionConversionFactor)</pre>
<div class="block">Configure the integrated encoder for the swerve module. Sets the conversion factors for position and velocity.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#configureIntegratedEncoder(double)">configureIntegratedEncoder</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positionConversionFactor</code> - The conversion factor to apply for position.</dd>
</dl>
</li>
</ul>
<a id="configurePIDF(swervelib.parser.PIDFConfig)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configurePIDF</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;configurePIDF&#8203;(<a href="../parser/PIDFConfig.html" title="class in swervelib.parser">PIDFConfig</a>&nbsp;config)</pre>
<div class="block">Configure the PIDF values for the closed loop controller. 0 is disabled or off.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#configurePIDF(swervelib.parser.PIDFConfig)">configurePIDF</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>config</code> - Configuration class holding the PIDF values.</dd>
</dl>
</li>
</ul>
<a id="configurePIDWrapping(double,double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configurePIDWrapping</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;configurePIDWrapping&#8203;(double&nbsp;minInput,
double&nbsp;maxInput)</pre>
<div class="block">Configure the PID wrapping for the position closed loop controller.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#configurePIDWrapping(double,double)">configurePIDWrapping</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>minInput</code> - Minimum PID input.</dd>
<dd><code>maxInput</code> - Maximum PID input.</dd>
</dl>
</li>
</ul>
<a id="setMotorBrake(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMotorBrake</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMotorBrake&#8203;(boolean&nbsp;isBrakeMode)</pre>
<div class="block">Set the idle mode.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setMotorBrake(boolean)">setMotorBrake</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>isBrakeMode</code> - Set the brake mode.</dd>
</dl>
</li>
</ul>
<a id="setInverted(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInverted</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setInverted&#8203;(boolean&nbsp;inverted)</pre>
<div class="block">Set the motor to be inverted.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setInverted(boolean)">setInverted</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inverted</code> - State of inversion.</dd>
</dl>
</li>
</ul>
<a id="burnFlash()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>burnFlash</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;burnFlash()</pre>
<div class="block">Save the configurations from flash to EEPROM.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#burnFlash()">burnFlash</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
</dl>
</li>
</ul>
<a id="set(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;set&#8203;(double&nbsp;percentOutput)</pre>
<div class="block">Set the percentage output.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#set(double)">set</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>percentOutput</code> - percent out for the motor controller.</dd>
</dl>
</li>
</ul>
<a id="setReference(double,double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setReference</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setReference&#8203;(double&nbsp;setpoint,
double&nbsp;feedforward)</pre>
<div class="block">Set the closed loop PID controller reference point.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setReference(double,double)">setReference</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>setpoint</code> - Setpoint in MPS or Angle in degrees.</dd>
<dd><code>feedforward</code> - Feedforward in volt-meter-per-second or kV.</dd>
</dl>
</li>
</ul>
<a id="getVelocity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVelocity</h4>
<pre class="methodSignature">public&nbsp;double&nbsp;getVelocity()</pre>
<div class="block">Get the velocity of the integrated encoder.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#getVelocity()">getVelocity</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>velocity</dd>
</dl>
</li>
</ul>
<a id="getPosition()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPosition</h4>
<pre class="methodSignature">public&nbsp;double&nbsp;getPosition()</pre>
<div class="block">Get the position of the integrated encoder.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#getPosition()">getPosition</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Position</dd>
</dl>
</li>
</ul>
<a id="setPosition(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPosition</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setPosition&#8203;(double&nbsp;position)</pre>
<div class="block">Set the integrated encoder position.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setPosition(double)">setPosition</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>position</code> - Integrated encoder position. Should be angle in degrees or meters per second.</dd>
</dl>
</li>
</ul>
<a id="setVoltageCompensation(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVoltageCompensation</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setVoltageCompensation&#8203;(double&nbsp;nominalVoltage)</pre>
<div class="block">Set the voltage compensation for the swerve module motor.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setVoltageCompensation(double)">setVoltageCompensation</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nominalVoltage</code> - Nominal voltage for operation to output to.</dd>
</dl>
</li>
</ul>
<a id="setCurrentLimit(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCurrentLimit</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setCurrentLimit&#8203;(int&nbsp;currentLimit)</pre>
<div class="block">Set the current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with
voltage compensation. This is useful to protect the motor from current spikes.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setCurrentLimit(int)">setCurrentLimit</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>currentLimit</code> - Current limit in AMPS at free speed.</dd>
</dl>
</li>
</ul>
<a id="setLoopRampRate(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLoopRampRate</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setLoopRampRate&#8203;(double&nbsp;rampRate)</pre>
<div class="block">Set the maximum rate the open/closed loop output can change by.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#setLoopRampRate(double)">setLoopRampRate</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>rampRate</code> - Time in seconds to go from 0 to full throttle.</dd>
</dl>
</li>
</ul>
<a id="getMotor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMotor</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>&nbsp;getMotor()</pre>
<div class="block">Get the motor object from the module.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#getMotor()">getMotor</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Motor object.</dd>
</dl>
</li>
</ul>
<a id="isAttachedAbsoluteEncoder()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isAttachedAbsoluteEncoder</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isAttachedAbsoluteEncoder()</pre>
<div class="block">Queries whether the absolute encoder is directly attached to the motor controller.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SwerveMotor.html#isAttachedAbsoluteEncoder()">isAttachedAbsoluteEncoder</a></code>&nbsp;in class&nbsp;<code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>connected absolute encoder state.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-files/index-1.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>