mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
701 lines
46 KiB
HTML
701 lines
46 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (17) on Thu Jan 18 15:35:15 CST 2024 -->
|
|
<title>SparkMaxSwerve</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="2024-01-18">
|
|
<meta name="description" content="declaration: package: swervelib.motors, class: SparkMaxSwerve">
|
|
<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: </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="sub-nav-list">
|
|
<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>
|
|
<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> <a href="package-summary.html">swervelib.motors</a></div>
|
|
<h1 title="Class SparkMaxSwerve" class="title">Class SparkMaxSwerve</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"><a href="SwerveMotor.html" title="class in swervelib.motors">swervelib.motors.SwerveMotor</a>
|
|
<div class="inheritance">swervelib.motors.SparkMaxSwerve</div>
|
|
</div>
|
|
</div>
|
|
<section class="class-description" id="class-description">
|
|
<hr>
|
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">SparkMaxSwerve</span>
|
|
<span class="extends-implements">extends <a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></span></div>
|
|
<div class="block">An implementation of <code>CANSparkMax</code> as a <a href="SwerveMotor.html" title="class in swervelib.motors"><code>SwerveMotor</code></a>.</div>
|
|
</section>
|
|
<section class="summary">
|
|
<ul class="summary-list">
|
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
<li>
|
|
<section class="nested-class-summary" id="nested-class-summary">
|
|
<h2>Nested Class Summary</h2>
|
|
<div class="caption"><span>Nested Classes</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">Class</div>
|
|
<div class="table-header col-last">Description</div>
|
|
<div class="col-first even-row-color"><code>(package private) static enum </code></div>
|
|
<div class="col-second even-row-color"><code><a href="SparkMaxSwerve.SparkMAX_slotIdx.html" class="type-name-link" title="enum class in swervelib.motors">SparkMaxSwerve.SparkMAX_slotIdx</a></code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">REV Slots for PID configuration.</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</li>
|
|
<!-- =========== 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><a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a></code></div>
|
|
<div class="col-second even-row-color"><code><a href="#absoluteEncoder" class="member-name-link">absoluteEncoder</a></code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">Absolute encoder attached to the SparkMax (if exists)</div>
|
|
</div>
|
|
<div class="col-first odd-row-color"><code>com.revrobotics.RelativeEncoder</code></div>
|
|
<div class="col-second odd-row-color"><code><a href="#encoder" class="member-name-link">encoder</a></code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block">Integrated encoder.</div>
|
|
</div>
|
|
<div class="col-first even-row-color"><code>private boolean</code></div>
|
|
<div class="col-second even-row-color"><code><a href="#factoryDefaultOccurred" class="member-name-link">factoryDefaultOccurred</a></code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">Factory default already occurred.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color"><code>com.revrobotics.CANSparkMax</code></div>
|
|
<div class="col-second odd-row-color"><code><a href="#motor" class="member-name-link">motor</a></code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block">SparkMAX Instance.</div>
|
|
</div>
|
|
<div class="col-first even-row-color"><code>com.revrobotics.SparkPIDController</code></div>
|
|
<div class="col-second even-row-color"><code><a href="#pid" class="member-name-link">pid</a></code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">Closed-loop PID controller.</div>
|
|
</div>
|
|
</div>
|
|
<div class="inherited-list">
|
|
<h3 id="fields-inherited-from-class-swervelib.motors.SwerveMotor">Fields inherited from class swervelib.motors.<a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></h3>
|
|
<code><a href="SwerveMotor.html#isDriveMotor">isDriveMotor</a>, <a href="SwerveMotor.html#maximumRetries">maximumRetries</a></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(int,boolean)" class="member-name-link">SparkMaxSwerve</a><wbr>(int id,
|
|
boolean isDriveMotor)</code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">Initialize the <a href="SwerveMotor.html" title="class in swervelib.motors"><code>SwerveMotor</code></a> as a <code>CANSparkMax</code> connected to a Brushless Motor.</div>
|
|
</div>
|
|
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(com.revrobotics.CANSparkMax,boolean)" class="member-name-link">SparkMaxSwerve</a><wbr>(com.revrobotics.CANSparkMax motor,
|
|
boolean isDriveMotor)</code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block">Initialize the swerve motor.</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-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-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="#burnFlash()" class="member-name-link">burnFlash</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Save the configurations from flash to EEPROM.</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="#clearStickyFaults()" class="member-name-link">clearStickyFaults</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Clear the sticky faults on the motor controller.</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="#configureCANStatusFrames(int,int,int,int,int,int,int)" class="member-name-link">configureCANStatusFrames</a><wbr>(int CANStatus0,
|
|
int CANStatus1,
|
|
int CANStatus2,
|
|
int CANStatus3,
|
|
int CANStatus4,
|
|
int CANStatus5,
|
|
int CANStatus6)</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 CAN status frames.</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="#configureIntegratedEncoder(double)" class="member-name-link">configureIntegratedEncoder</a><wbr>(double positionConversionFactor)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Configure the integrated encoder for the swerve module.</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="#configurePIDF(swervelib.parser.PIDFConfig)" class="member-name-link">configurePIDF</a><wbr>(<a href="../parser/PIDFConfig.html" title="class in swervelib.parser">PIDFConfig</a> config)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Configure the PIDF values for the closed loop controller.</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="#configurePIDWrapping(double,double)" class="member-name-link">configurePIDWrapping</a><wbr>(double minInput,
|
|
double maxInput)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Configure the PID wrapping for the position closed loop controller.</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="#configureSparkMax(java.util.function.Supplier)" class="member-name-link">configureSparkMax</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a><com.revrobotics.REVLibError> config)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Run the configuration until it succeeds or times out.</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="#factoryDefaults()" class="member-name-link">factoryDefaults</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Configure the factory defaults.</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/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMotor()" class="member-name-link">getMotor</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 motor object from the module.</div>
|
|
</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="#getPosition()" class="member-name-link">getPosition</a>()</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 position of the integrated encoder.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getVelocity()" class="member-name-link">getVelocity</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 velocity of the integrated encoder.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isAttachedAbsoluteEncoder()" class="member-name-link">isAttachedAbsoluteEncoder</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Queries whether the absolute encoder is directly attached to the motor controller.</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="#set(double)" class="member-name-link">set</a><wbr>(double percentOutput)</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 percentage output.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)" class="member-name-link">setAbsoluteEncoder</a><wbr>(<a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a> encoder)</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 absolute encoder to be a compatible absolute encoder.</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="#setCurrentLimit(int)" class="member-name-link">setCurrentLimit</a><wbr>(int currentLimit)</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 current limit for the swerve drive motor, remember this may cause jumping if used in conjunction with
|
|
voltage compensation.</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="#setInverted(boolean)" class="member-name-link">setInverted</a><wbr>(boolean inverted)</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 motor to be inverted.</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="#setLoopRampRate(double)" class="member-name-link">setLoopRampRate</a><wbr>(double rampRate)</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 rate the open/closed loop output can change by.</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="#setMotorBrake(boolean)" class="member-name-link">setMotorBrake</a><wbr>(boolean isBrakeMode)</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 idle mode.</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="#setPosition(double)" class="member-name-link">setPosition</a><wbr>(double position)</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 integrated encoder position.</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="#setReference(double,double)" class="member-name-link">setReference</a><wbr>(double setpoint,
|
|
double feedforward)</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 closed loop PID controller reference point.</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="#setReference(double,double,double)" class="member-name-link">setReference</a><wbr>(double setpoint,
|
|
double feedforward,
|
|
double position)</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 closed loop PID controller reference point.</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="#setVoltageCompensation(double)" class="member-name-link">setVoltageCompensation</a><wbr>(double nominalVoltage)</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 voltage compensation for the swerve module motor.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="inherited-list">
|
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class 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#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</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#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</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#toString()" title="class or interface in java.lang" class="external-link">toString</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="motor">
|
|
<h3>motor</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">com.revrobotics.CANSparkMax</span> <span class="element-name">motor</span></div>
|
|
<div class="block">SparkMAX Instance.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="encoder">
|
|
<h3>encoder</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">com.revrobotics.RelativeEncoder</span> <span class="element-name">encoder</span></div>
|
|
<div class="block">Integrated encoder.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="absoluteEncoder">
|
|
<h3>absoluteEncoder</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a></span> <span class="element-name">absoluteEncoder</span></div>
|
|
<div class="block">Absolute encoder attached to the SparkMax (if exists)</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="pid">
|
|
<h3>pid</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">com.revrobotics.SparkPIDController</span> <span class="element-name">pid</span></div>
|
|
<div class="block">Closed-loop PID controller.</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="factoryDefaultOccurred">
|
|
<h3>factoryDefaultOccurred</h3>
|
|
<div class="member-signature"><span class="modifiers">private</span> <span class="return-type">boolean</span> <span class="element-name">factoryDefaultOccurred</span></div>
|
|
<div class="block">Factory default already occurred.</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="<init>(com.revrobotics.CANSparkMax,boolean)">
|
|
<h3>SparkMaxSwerve</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">SparkMaxSwerve</span><wbr><span class="parameters">(com.revrobotics.CANSparkMax motor,
|
|
boolean isDriveMotor)</span></div>
|
|
<div class="block">Initialize the swerve motor.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>motor</code> - The SwerveMotor as a SparkMax object.</dd>
|
|
<dd><code>isDriveMotor</code> - Is the motor being initialized a drive motor?</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(int,boolean)">
|
|
<h3>SparkMaxSwerve</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">SparkMaxSwerve</span><wbr><span class="parameters">(int id,
|
|
boolean isDriveMotor)</span></div>
|
|
<div class="block">Initialize the <a href="SwerveMotor.html" title="class in swervelib.motors"><code>SwerveMotor</code></a> as a <code>CANSparkMax</code> connected to a Brushless Motor.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>id</code> - CAN ID of the SparkMax.</dd>
|
|
<dd><code>isDriveMotor</code> - Is the motor being initialized a drive motor?</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="configureSparkMax(java.util.function.Supplier)">
|
|
<h3>configureSparkMax</h3>
|
|
<div class="member-signature"><span class="modifiers">private</span> <span class="return-type">void</span> <span class="element-name">configureSparkMax</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Supplier.html" title="class or interface in java.util.function" class="external-link">Supplier</a><com.revrobotics.REVLibError> config)</span></div>
|
|
<div class="block">Run the configuration until it succeeds or times out.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>config</code> - Lambda supplier returning the error state.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setVoltageCompensation(double)">
|
|
<h3>setVoltageCompensation</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setVoltageCompensation</span><wbr><span class="parameters">(double nominalVoltage)</span></div>
|
|
<div class="block">Set the voltage compensation for the swerve module motor.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setVoltageCompensation(double)">setVoltageCompensation</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>nominalVoltage</code> - Nominal voltage for operation to output to.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setCurrentLimit(int)">
|
|
<h3>setCurrentLimit</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setCurrentLimit</span><wbr><span class="parameters">(int currentLimit)</span></div>
|
|
<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 class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setCurrentLimit(int)">setCurrentLimit</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>currentLimit</code> - Current limit in AMPS at free speed.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setLoopRampRate(double)">
|
|
<h3>setLoopRampRate</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setLoopRampRate</span><wbr><span class="parameters">(double rampRate)</span></div>
|
|
<div class="block">Set the maximum rate the open/closed loop output can change by.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setLoopRampRate(double)">setLoopRampRate</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>rampRate</code> - Time in seconds to go from 0 to full throttle.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getMotor()">
|
|
<h3>getMotor</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><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></span> <span class="element-name">getMotor</span>()</div>
|
|
<div class="block">Get the motor object from the module.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#getMotor()">getMotor</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>Motor object.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="isAttachedAbsoluteEncoder()">
|
|
<h3>isAttachedAbsoluteEncoder</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isAttachedAbsoluteEncoder</span>()</div>
|
|
<div class="block">Queries whether the absolute encoder is directly attached to the motor controller.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#isAttachedAbsoluteEncoder()">isAttachedAbsoluteEncoder</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>connected absolute encoder state.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="factoryDefaults()">
|
|
<h3>factoryDefaults</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">factoryDefaults</span>()</div>
|
|
<div class="block">Configure the factory defaults.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#factoryDefaults()">factoryDefaults</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="clearStickyFaults()">
|
|
<h3>clearStickyFaults</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">clearStickyFaults</span>()</div>
|
|
<div class="block">Clear the sticky faults on the motor controller.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#clearStickyFaults()">clearStickyFaults</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)">
|
|
<h3>setAbsoluteEncoder</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></span> <span class="element-name">setAbsoluteEncoder</span><wbr><span class="parameters">(<a href="../encoders/SwerveAbsoluteEncoder.html" title="class in swervelib.encoders">SwerveAbsoluteEncoder</a> encoder)</span></div>
|
|
<div class="block">Set the absolute encoder to be a compatible absolute encoder.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setAbsoluteEncoder(swervelib.encoders.SwerveAbsoluteEncoder)">setAbsoluteEncoder</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>encoder</code> - The encoder to use.</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>The <a href="SwerveMotor.html" title="class in swervelib.motors"><code>SwerveMotor</code></a> for easy instantiation.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="configureIntegratedEncoder(double)">
|
|
<h3>configureIntegratedEncoder</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">configureIntegratedEncoder</span><wbr><span class="parameters">(double positionConversionFactor)</span></div>
|
|
<div class="block">Configure the integrated encoder for the swerve module. Sets the conversion factors for position and velocity.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#configureIntegratedEncoder(double)">configureIntegratedEncoder</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>positionConversionFactor</code> - The conversion factor to apply.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="configurePIDF(swervelib.parser.PIDFConfig)">
|
|
<h3>configurePIDF</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">configurePIDF</span><wbr><span class="parameters">(<a href="../parser/PIDFConfig.html" title="class in swervelib.parser">PIDFConfig</a> config)</span></div>
|
|
<div class="block">Configure the PIDF values for the closed loop controller.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#configurePIDF(swervelib.parser.PIDFConfig)">configurePIDF</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>config</code> - Configuration class holding the PIDF values.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="configurePIDWrapping(double,double)">
|
|
<h3>configurePIDWrapping</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">configurePIDWrapping</span><wbr><span class="parameters">(double minInput,
|
|
double maxInput)</span></div>
|
|
<div class="block">Configure the PID wrapping for the position closed loop controller.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#configurePIDWrapping(double,double)">configurePIDWrapping</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>minInput</code> - Minimum PID input.</dd>
|
|
<dd><code>maxInput</code> - Maximum PID input.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="configureCANStatusFrames(int,int,int,int,int,int,int)">
|
|
<h3>configureCANStatusFrames</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">configureCANStatusFrames</span><wbr><span class="parameters">(int CANStatus0,
|
|
int CANStatus1,
|
|
int CANStatus2,
|
|
int CANStatus3,
|
|
int CANStatus4,
|
|
int CANStatus5,
|
|
int CANStatus6)</span></div>
|
|
<div class="block">Set the CAN status frames.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>CANStatus0</code> - Applied Output, Faults, Sticky Faults, Is Follower</dd>
|
|
<dd><code>CANStatus1</code> - Motor Velocity, Motor Temperature, Motor Voltage, Motor Current</dd>
|
|
<dd><code>CANStatus2</code> - Motor Position</dd>
|
|
<dd><code>CANStatus3</code> - Analog Sensor Voltage, Analog Sensor Velocity, Analog Sensor Position</dd>
|
|
<dd><code>CANStatus4</code> - Alternate Encoder Velocity, Alternate Encoder Position</dd>
|
|
<dd><code>CANStatus5</code> - Duty Cycle Absolute Encoder Position, Duty Cycle Absolute Encoder Absolute Angle</dd>
|
|
<dd><code>CANStatus6</code> - Duty Cycle Absolute Encoder Velocity, Duty Cycle Absolute Encoder Frequency</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setMotorBrake(boolean)">
|
|
<h3>setMotorBrake</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setMotorBrake</span><wbr><span class="parameters">(boolean isBrakeMode)</span></div>
|
|
<div class="block">Set the idle mode.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setMotorBrake(boolean)">setMotorBrake</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>isBrakeMode</code> - Set the brake mode.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setInverted(boolean)">
|
|
<h3>setInverted</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setInverted</span><wbr><span class="parameters">(boolean inverted)</span></div>
|
|
<div class="block">Set the motor to be inverted.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setInverted(boolean)">setInverted</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>inverted</code> - State of inversion.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="burnFlash()">
|
|
<h3>burnFlash</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">burnFlash</span>()</div>
|
|
<div class="block">Save the configurations from flash to EEPROM.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#burnFlash()">burnFlash</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="set(double)">
|
|
<h3>set</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">set</span><wbr><span class="parameters">(double percentOutput)</span></div>
|
|
<div class="block">Set the percentage output.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#set(double)">set</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>percentOutput</code> - percent out for the motor controller.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setReference(double,double)">
|
|
<h3>setReference</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setReference</span><wbr><span class="parameters">(double setpoint,
|
|
double feedforward)</span></div>
|
|
<div class="block">Set the closed loop PID controller reference point.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setReference(double,double)">setReference</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</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>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setReference(double,double,double)">
|
|
<h3>setReference</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setReference</span><wbr><span class="parameters">(double setpoint,
|
|
double feedforward,
|
|
double position)</span></div>
|
|
<div class="block">Set the closed loop PID controller reference point.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setReference(double,double,double)">setReference</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>setpoint</code> - Setpoint in meters per second or angle in degrees.</dd>
|
|
<dd><code>feedforward</code> - Feedforward in volt-meter-per-second or kV.</dd>
|
|
<dd><code>position</code> - Only used on the angle motor, the position of the motor in degrees.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getVelocity()">
|
|
<h3>getVelocity</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double</span> <span class="element-name">getVelocity</span>()</div>
|
|
<div class="block">Get the velocity of the integrated encoder.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#getVelocity()">getVelocity</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>velocity</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getPosition()">
|
|
<h3>getPosition</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double</span> <span class="element-name">getPosition</span>()</div>
|
|
<div class="block">Get the position of the integrated encoder.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#getPosition()">getPosition</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>Position</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setPosition(double)">
|
|
<h3>setPosition</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setPosition</span><wbr><span class="parameters">(double position)</span></div>
|
|
<div class="block">Set the integrated encoder position.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="SwerveMotor.html#setPosition(double)">setPosition</a></code> in class <code><a href="SwerveMotor.html" title="class in swervelib.motors">SwerveMotor</a></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>position</code> - Integrated encoder position.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
</main>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|