mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
884 lines
32 KiB
HTML
884 lines
32 KiB
HTML
<!DOCTYPE HTML>
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (11.0.13) on Sun Jan 29 15:36:03 CST 2023 -->
|
|
<title>SwerveMotor</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="dc.created" content="2023-01-29">
|
|
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.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.5.1.js"></script>
|
|
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="SwerveMotor";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var data = {"i0":9,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6};
|
|
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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 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: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </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"> </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> <a href="package-summary.html">frc.robot.subsystems.swervedrive.swerve</a></div>
|
|
<h2 title="Class SwerveMotor" class="title">Class SwerveMotor</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>frc.robot.subsystems.swervedrive.swerve.SwerveMotor</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl>
|
|
<dt>Direct Known Subclasses:</dt>
|
|
<dd><code><a href="motors/CTRESwerveMotor.html" title="class in frc.robot.subsystems.swervedrive.swerve.motors">CTRESwerveMotor</a></code>, <code><a href="motors/REVSwerveMotor.html" title="class in frc.robot.subsystems.swervedrive.swerve.motors">REVSwerveMotor</a></code></dd>
|
|
</dl>
|
|
<hr>
|
|
<pre>public abstract class <span class="typeNameLabel">SwerveMotor</span>
|
|
extends java.lang.Object</pre>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="nested.class.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Nested Class Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colSecond" scope="col">Class</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SwerveMotor.ModuleMotorType.html" title="enum in frc.robot.subsystems.swervedrive.swerve">SwerveMotor.ModuleMotorType</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Motor type for the swerve drive module</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- =========== FIELD SUMMARY =========== -->
|
|
<section role="region">
|
|
<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"> </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>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#kD">kD</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">PIDF Values.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#kF">kF</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">PIDF Values.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#kI">kI</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">PIDF Values.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#kIZ">kIZ</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">PIDF Values.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#kP">kP</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">PIDF Values.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="SwerveMotor.ModuleMotorType.html" title="enum in frc.robot.subsystems.swervedrive.swerve">SwerveMotor.ModuleMotorType</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#m_motorType">m_motorType</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Module motor type.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#target">target</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Target value for PID.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<section role="region">
|
|
<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"> </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()">SwerveMotor</a></span>()</code></th>
|
|
<td class="colLast"> </td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<section role="region">
|
|
<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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </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>static <MotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController><br><a href="SwerveMotor.html" title="class in frc.robot.subsystems.swervedrive.swerve">SwerveMotor</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromMotor(MotorType,frc.robot.subsystems.swervedrive.swerve.SwerveEncoder,frc.robot.subsystems.swervedrive.swerve.SwerveMotor.ModuleMotorType,double,double,double,double)">fromMotor</a></span>​(MotorType motor,
|
|
<a href="SwerveEncoder.html" title="class in frc.robot.subsystems.swervedrive.swerve">SwerveEncoder</a><?> absoluteEncoder,
|
|
<a href="SwerveMotor.ModuleMotorType.html" title="enum in frc.robot.subsystems.swervedrive.swerve">SwerveMotor.ModuleMotorType</a> type,
|
|
double gearRatio,
|
|
double wheelDiameter,
|
|
double freeSpeedRPM,
|
|
double powerLimit)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Constructor for Swerve Motor, expecting CANSparkMax or TalonFX.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>abstract double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get()">get</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Get the current value of the encoder corresponding to the PID.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>abstract double</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAmps()">getAmps</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Get the current output.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>abstract 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 current value of the encoder.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#optimizeCANFrames()">optimizeCANFrames</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Optimize the CAN status frames to reduce utilization.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code>abstract boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reachable()">reachable</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Check that the link is good on the swerve module and CAN bus is able to retrieve data.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code>abstract boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#remoteIntegratedEncoder()">remoteIntegratedEncoder</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Check if the absolute encoder is used inplace of the integrated encoder.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#saveConfig()">saveConfig</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Save configuration data to the motor controller so it is persistent on reboot.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(double)">set</a></span>​(double speed)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the speed of the drive motor from -1 to 1.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setConversionFactor(double)">setConversionFactor</a></span>​(double conversionFactor)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configures the conversion factor based upon which motor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setCurrentLimit(int)">setCurrentLimit</a></span>​(int 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="i11" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEncoder(double)">setEncoder</a></span>​(double value)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the encoder value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setInverted(boolean)">setInverted</a></span>​(boolean inverted)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Invert the motor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPIDF(double,double,double,double,double)">setPIDF</a></span>​(double P,
|
|
double I,
|
|
double D,
|
|
double F,
|
|
double integralZone)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the PIDF coefficients for the closed loop PID onboard the SparkMax.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPIDOutputRange(double,double)">setPIDOutputRange</a></span>​(double min,
|
|
double max)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configure the maximum power (-1 to 1) the PID can output.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i15" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTarget(double,double)">setTarget</a></span>​(double target,
|
|
double feedforward)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the target for the PID loop.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setVoltageCompensation(double)">setVoltageCompensation</a></span>​(double nominalVoltage)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Set the voltage compensation for the swerve module motor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>abstract void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stop()">stop</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Stop the motor by sending 0 volts to it.</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 java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ============ FIELD DETAIL =========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="field.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Field Detail</h3>
|
|
<a id="m_motorType">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>m_motorType</h4>
|
|
<pre>public <a href="SwerveMotor.ModuleMotorType.html" title="enum in frc.robot.subsystems.swervedrive.swerve">SwerveMotor.ModuleMotorType</a> m_motorType</pre>
|
|
<div class="block">Module motor type.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="kP">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>kP</h4>
|
|
<pre>public double kP</pre>
|
|
<div class="block">PIDF Values.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="kI">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>kI</h4>
|
|
<pre>public double kI</pre>
|
|
<div class="block">PIDF Values.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="kD">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>kD</h4>
|
|
<pre>public double kD</pre>
|
|
<div class="block">PIDF Values.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="kF">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>kF</h4>
|
|
<pre>public double kF</pre>
|
|
<div class="block">PIDF Values.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="kIZ">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>kIZ</h4>
|
|
<pre>public double kIZ</pre>
|
|
<div class="block">PIDF Values.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="target">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>target</h4>
|
|
<pre>public double target</pre>
|
|
<div class="block">Target value for PID.</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="constructor.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a id="<init>()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>SwerveMotor</h4>
|
|
<pre>public SwerveMotor()</pre>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a id="fromMotor(edu.wpi.first.wpilibj.motorcontrol.MotorController,frc.robot.subsystems.swervedrive.swerve.SwerveEncoder,frc.robot.subsystems.swervedrive.swerve.SwerveMotor.ModuleMotorType,double,double,double,double)">
|
|
<!-- -->
|
|
</a><a id="fromMotor(MotorType,frc.robot.subsystems.swervedrive.swerve.SwerveEncoder,frc.robot.subsystems.swervedrive.swerve.SwerveMotor.ModuleMotorType,double,double,double,double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>fromMotor</h4>
|
|
<pre class="methodSignature">public static <MotorType extends edu.wpi.first.wpilibj.motorcontrol.MotorController> <a href="SwerveMotor.html" title="class in frc.robot.subsystems.swervedrive.swerve">SwerveMotor</a> fromMotor​(MotorType motor,
|
|
<a href="SwerveEncoder.html" title="class in frc.robot.subsystems.swervedrive.swerve">SwerveEncoder</a><?> absoluteEncoder,
|
|
<a href="SwerveMotor.ModuleMotorType.html" title="enum in frc.robot.subsystems.swervedrive.swerve">SwerveMotor.ModuleMotorType</a> type,
|
|
double gearRatio,
|
|
double wheelDiameter,
|
|
double freeSpeedRPM,
|
|
double powerLimit)</pre>
|
|
<div class="block">Constructor for Swerve Motor, expecting CANSparkMax or TalonFX. Clears sticky faults and restores factory
|
|
defaults.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Type Parameters:</span></dt>
|
|
<dd><code>MotorType</code> - Motor type to use.</dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>motor</code> - Motor controller.</dd>
|
|
<dd><code>absoluteEncoder</code> - The absolute encoder used for the module, if the motor is a turning motor and the encoder is
|
|
compatible it will set the encoder as the remote integrated encoder and does not need
|
|
periodic synchronization.</dd>
|
|
<dd><code>type</code> - Swerve module motor type.</dd>
|
|
<dd><code>gearRatio</code> - Gear ratio.</dd>
|
|
<dd><code>wheelDiameter</code> - Wheel diameter in meters.</dd>
|
|
<dd><code>freeSpeedRPM</code> - Free speed RPM of the motor.</dd>
|
|
<dd><code>powerLimit</code> - Power limit for the motor.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setPIDOutputRange(double,double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setPIDOutputRange</h4>
|
|
<pre class="methodSignature">public abstract void setPIDOutputRange​(double min,
|
|
double max)</pre>
|
|
<div class="block">Configure the maximum power (-1 to 1) the PID can output. This helps manage voltage pull for the drive base.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>min</code> - Minimum output.</dd>
|
|
<dd><code>max</code> - Maximum output.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setPIDF(double,double,double,double,double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setPIDF</h4>
|
|
<pre class="methodSignature">public abstract void setPIDF​(double P,
|
|
double I,
|
|
double D,
|
|
double F,
|
|
double integralZone)</pre>
|
|
<div class="block">Set the PIDF coefficients for the closed loop PID onboard the SparkMax.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>P</code> - Proportional gain for closed loop. This is multiplied by closed loop error in sensor units.
|
|
Default is 1.0</dd>
|
|
<dd><code>I</code> - Integral gain for closed loop. This is multiplied by closed loop error in sensor units every
|
|
PID Loop.</dd>
|
|
<dd><code>D</code> - Derivative gain for closed loop. This is multiplied by derivative error (sensor units per PID
|
|
loop). Default is 0.1</dd>
|
|
<dd><code>F</code> - Feed Fwd gain for Closed loop.</dd>
|
|
<dd><code>integralZone</code> - Integral Zone can be used to auto clear the integral accumulator if the sensor pos is too far
|
|
from the target. This prevents unstable oscillation if the kI is too large. Value is in sensor
|
|
units.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setConversionFactor(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setConversionFactor</h4>
|
|
<pre class="methodSignature">public abstract void setConversionFactor​(double conversionFactor)</pre>
|
|
<div class="block">Configures the conversion factor based upon which motor.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>conversionFactor</code> - Conversion from RPM to MPS for drive motor, and rotations to degrees for the turning
|
|
motor.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setTarget(double,double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setTarget</h4>
|
|
<pre class="methodSignature">public abstract void setTarget​(double target,
|
|
double feedforward)</pre>
|
|
<div class="block">Set the target for the PID loop.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>target</code> - The PID target to aim for.</dd>
|
|
<dd><code>feedforward</code> - The feedforward for this target.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="stop()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>stop</h4>
|
|
<pre class="methodSignature">public abstract void stop()</pre>
|
|
<div class="block">Stop the motor by sending 0 volts to it.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="set(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>set</h4>
|
|
<pre class="methodSignature">public abstract void set​(double speed)</pre>
|
|
<div class="block">Set the speed of the drive motor from -1 to 1.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>speed</code> - Speed from -1 to 1.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="get()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>get</h4>
|
|
<pre class="methodSignature">public abstract double get()</pre>
|
|
<div class="block">Get the current value of the encoder corresponding to the PID.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Current value of the encoder either in velocity or position..</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getAmps()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getAmps</h4>
|
|
<pre class="methodSignature">public abstract double getAmps()</pre>
|
|
<div class="block">Get the current output.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Output amps.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getPosition()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPosition</h4>
|
|
<pre class="methodSignature">public abstract double getPosition()</pre>
|
|
<div class="block">Get the current value of the encoder.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Current value of the encoder.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setVoltageCompensation(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setVoltageCompensation</h4>
|
|
<pre class="methodSignature">public abstract void setVoltageCompensation​(double nominalVoltage)</pre>
|
|
<div class="block">Set the voltage compensation for the swerve module motor.</div>
|
|
<dl>
|
|
<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 abstract void setCurrentLimit​(int 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="paramLabel">Parameters:</span></dt>
|
|
<dd><code>currentLimit</code> - Current limit in AMPS at free speed.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setEncoder(double)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setEncoder</h4>
|
|
<pre class="methodSignature">public abstract void setEncoder​(double value)</pre>
|
|
<div class="block">Set the encoder value.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>value</code> - Value to set the encoder to.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="reachable()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>reachable</h4>
|
|
<pre class="methodSignature">public abstract boolean reachable()</pre>
|
|
<div class="block">Check that the link is good on the swerve module and CAN bus is able to retrieve data.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>true on all devices are accessible over CAN.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="remoteIntegratedEncoder()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>remoteIntegratedEncoder</h4>
|
|
<pre class="methodSignature">public abstract boolean remoteIntegratedEncoder()</pre>
|
|
<div class="block">Check if the absolute encoder is used inplace of the integrated encoder.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>true, if the absolute encoder is being used as the integrated controller.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="optimizeCANFrames()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>optimizeCANFrames</h4>
|
|
<pre class="methodSignature">public abstract void optimizeCANFrames()</pre>
|
|
<div class="block">Optimize the CAN status frames to reduce utilization.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="saveConfig()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>saveConfig</h4>
|
|
<pre class="methodSignature">public abstract void saveConfig()</pre>
|
|
<div class="block">Save configuration data to the motor controller so it is persistent on reboot.</div>
|
|
</li>
|
|
</ul>
|
|
<a id="setInverted(boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>setInverted</h4>
|
|
<pre class="methodSignature">public abstract void setInverted​(boolean inverted)</pre>
|
|
<div class="block">Invert the motor.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>inverted</code> - Set the motor as inverted.</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 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: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </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>
|