Files
YAGSL/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
thenetworkgrinch 38c7bdba7d Updated javadocs
2023-08-09 16:23:30 -05:00

386 lines
21 KiB
HTML

<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>SwerveModulePhysicalCharacteristics (YAGSL-Lib API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="declaration: package: swervelib.parser, class: SwerveModulePhysicalCharacteristics">
<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.6.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 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-all.html">Index</a></li>
<li><a href="../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li>Method</li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">swervelib.parser</a></div>
<h1 title="Class SwerveModulePhysicalCharacteristics" class="title">Class SwerveModulePhysicalCharacteristics</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">swervelib.parser.SwerveModulePhysicalCharacteristics</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">SwerveModulePhysicalCharacteristics</span>
<span class="extends-implements">extends <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></div>
<div class="block">Configuration class which stores physical characteristics shared between every swerve module.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>final int</code></div>
<div class="col-second even-row-color"><code><a href="#angleEncoderPulsePerRotation" class="member-name-link">angleEncoderPulsePerRotation</a></code></div>
<div class="col-last even-row-color">
<div class="block">Angle motor encoder pulse per rotation.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#angleGearRatio" class="member-name-link">angleGearRatio</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Angle gear ratio.</div>
</div>
<div class="col-first even-row-color"><code>final int</code></div>
<div class="col-second even-row-color"><code><a href="#angleMotorCurrentLimit" class="member-name-link">angleMotorCurrentLimit</a></code></div>
<div class="col-last even-row-color">
<div class="block">Current limits for the Swerve Module.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#angleMotorRampRate" class="member-name-link">angleMotorRampRate</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The time it takes for the motor to go from 0 to full throttle in seconds.</div>
</div>
<div class="col-first even-row-color"><code>final int</code></div>
<div class="col-second even-row-color"><code><a href="#driveEncoderPulsePerRotation" class="member-name-link">driveEncoderPulsePerRotation</a></code></div>
<div class="col-last even-row-color">
<div class="block">Drive motor encoder pulse per rotation.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#driveGearRatio" class="member-name-link">driveGearRatio</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Drive gear ratio.</div>
</div>
<div class="col-first even-row-color"><code>final int</code></div>
<div class="col-second even-row-color"><code><a href="#driveMotorCurrentLimit" class="member-name-link">driveMotorCurrentLimit</a></code></div>
<div class="col-last even-row-color">
<div class="block">Current limits for the Swerve Module.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#driveMotorRampRate" class="member-name-link">driveMotorRampRate</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The time it takes for the motor to go from 0 to full throttle in seconds.</div>
</div>
<div class="col-first even-row-color"><code>final double</code></div>
<div class="col-second even-row-color"><code><a href="#moduleSteerFFCL" class="member-name-link">moduleSteerFFCL</a></code></div>
<div class="col-last even-row-color">
<div class="block">Angle motor kV used for second order kinematics to tune the feedforward, this variable should
be adjusted so that your drive train does not drift towards the direction you are rotating
while you translate.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#optimalVoltage" class="member-name-link">optimalVoltage</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Optimal voltage of the robot.</div>
</div>
<div class="col-first even-row-color"><code>final double</code></div>
<div class="col-second even-row-color"><code><a href="#wheelDiameter" class="member-name-link">wheelDiameter</a></code></div>
<div class="col-last even-row-color">
<div class="block">Wheel diameter in meters.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#wheelGripCoefficientOfFriction" class="member-name-link">wheelGripCoefficientOfFriction</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Wheel grip tape coefficient of friction on carpet, as described by the vendor.</div>
</div>
</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(double,double,double,double,double,int,int)" class="member-name-link">SwerveModulePhysicalCharacteristics</a><wbr>(double&nbsp;driveGearRatio,
double&nbsp;angleGearRatio,
double&nbsp;wheelDiameter,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate,
int&nbsp;driveEncoderPulsePerRotation,
int&nbsp;angleEncoderPulsePerRotation)</code></div>
<div class="col-last even-row-color">
<div class="block">Construct the swerve module physical characteristics.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(double,double,double,double,double,int,int,double,double,int,int,double)" class="member-name-link">SwerveModulePhysicalCharacteristics</a><wbr>(double&nbsp;driveGearRatio,
double&nbsp;angleGearRatio,
double&nbsp;wheelDiameter,
double&nbsp;wheelGripCoefficientOfFriction,
double&nbsp;optimalVoltage,
int&nbsp;driveMotorCurrentLimit,
int&nbsp;angleMotorCurrentLimit,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate,
int&nbsp;driveEncoderPulsePerRotation,
int&nbsp;angleEncoderPulsePerRotation,
double&nbsp;moduleSteerFFCL)</code></div>
<div class="col-last odd-row-color">
<div class="block">Construct the swerve module physical characteristics.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#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="wheelDiameter">
<h3>wheelDiameter</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">wheelDiameter</span></div>
<div class="block">Wheel diameter in meters.</div>
</section>
</li>
<li>
<section class="detail" id="driveGearRatio">
<h3>driveGearRatio</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">driveGearRatio</span></div>
<div class="block">Drive gear ratio. How many times the motor has to spin before the wheel makes a complete
rotation.</div>
</section>
</li>
<li>
<section class="detail" id="angleGearRatio">
<h3>angleGearRatio</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">angleGearRatio</span></div>
<div class="block">Angle gear ratio. How many times the motor has to spin before the wheel makes a full rotation.</div>
</section>
</li>
<li>
<section class="detail" id="driveEncoderPulsePerRotation">
<h3>driveEncoderPulsePerRotation</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">driveEncoderPulsePerRotation</span></div>
<div class="block">Drive motor encoder pulse per rotation. 1 if integrated encoder.</div>
</section>
</li>
<li>
<section class="detail" id="angleEncoderPulsePerRotation">
<h3>angleEncoderPulsePerRotation</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">angleEncoderPulsePerRotation</span></div>
<div class="block">Angle motor encoder pulse per rotation. 1 for Neo encoder. 2048 for Falcons.</div>
</section>
</li>
<li>
<section class="detail" id="optimalVoltage">
<h3>optimalVoltage</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">optimalVoltage</span></div>
<div class="block">Optimal voltage of the robot.</div>
</section>
</li>
<li>
<section class="detail" id="driveMotorCurrentLimit">
<h3>driveMotorCurrentLimit</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">driveMotorCurrentLimit</span></div>
<div class="block">Current limits for the Swerve Module.</div>
</section>
</li>
<li>
<section class="detail" id="angleMotorCurrentLimit">
<h3>angleMotorCurrentLimit</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">angleMotorCurrentLimit</span></div>
<div class="block">Current limits for the Swerve Module.</div>
</section>
</li>
<li>
<section class="detail" id="driveMotorRampRate">
<h3>driveMotorRampRate</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">driveMotorRampRate</span></div>
<div class="block">The time it takes for the motor to go from 0 to full throttle in seconds.</div>
</section>
</li>
<li>
<section class="detail" id="angleMotorRampRate">
<h3>angleMotorRampRate</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">angleMotorRampRate</span></div>
<div class="block">The time it takes for the motor to go from 0 to full throttle in seconds.</div>
</section>
</li>
<li>
<section class="detail" id="wheelGripCoefficientOfFriction">
<h3>wheelGripCoefficientOfFriction</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">wheelGripCoefficientOfFriction</span></div>
<div class="block">Wheel grip tape coefficient of friction on carpet, as described by the vendor.</div>
</section>
</li>
<li>
<section class="detail" id="moduleSteerFFCL">
<h3>moduleSteerFFCL</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">moduleSteerFFCL</span></div>
<div class="block">Angle motor kV used for second order kinematics to tune the feedforward, this variable should
be adjusted so that your drive train does not drift towards the direction you are rotating
while you translate. When set to 0 the calculated kV will be used.</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(double,double,double,double,double,int,int,double,double,int,int,double)">
<h3>SwerveModulePhysicalCharacteristics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModulePhysicalCharacteristics</span><wbr><span class="parameters">(double&nbsp;driveGearRatio,
double&nbsp;angleGearRatio,
double&nbsp;wheelDiameter,
double&nbsp;wheelGripCoefficientOfFriction,
double&nbsp;optimalVoltage,
int&nbsp;driveMotorCurrentLimit,
int&nbsp;angleMotorCurrentLimit,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate,
int&nbsp;driveEncoderPulsePerRotation,
int&nbsp;angleEncoderPulsePerRotation,
double&nbsp;moduleSteerFFCL)</span></div>
<div class="block">Construct the swerve module physical characteristics.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>driveGearRatio</code> - Gear ratio of the drive motor. Number of motor rotations to rotate the
wheel.</dd>
<dd><code>angleGearRatio</code> - Gear ratio of the angle motor. Number of motor rotations to spin the
wheel.</dd>
<dd><code>wheelDiameter</code> - Wheel diameter in meters.</dd>
<dd><code>wheelGripCoefficientOfFriction</code> - Wheel grip coefficient of friction on carpet given by
manufacturer.</dd>
<dd><code>optimalVoltage</code> - Optimal robot voltage.</dd>
<dd><code>driveMotorCurrentLimit</code> - Current limit for the drive motor.</dd>
<dd><code>angleMotorCurrentLimit</code> - Current limit for the angle motor.</dd>
<dd><code>driveMotorRampRate</code> - The time in seconds to go from 0 to full throttle on the motor.
(Prevents over drawing power from battery)</dd>
<dd><code>angleMotorRampRate</code> - The time in seconds to go from 0 to full throttle on the motor.
(Prevents overdrawing power and power loss).</dd>
<dd><code>driveEncoderPulsePerRotation</code> - The number of encoder pulses per motor rotation, 1 for
integrated encoders.</dd>
<dd><code>angleEncoderPulsePerRotation</code> - The number of encoder pulses per motor rotation, 1 for
integrated encoders.</dd>
<dd><code>moduleSteerFFCL</code> - The kV applied to the steering motor to ensure your drivetrain does not
drift towards a direction when rotating while translating.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(double,double,double,double,double,int,int)">
<h3>SwerveModulePhysicalCharacteristics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModulePhysicalCharacteristics</span><wbr><span class="parameters">(double&nbsp;driveGearRatio,
double&nbsp;angleGearRatio,
double&nbsp;wheelDiameter,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate,
int&nbsp;driveEncoderPulsePerRotation,
int&nbsp;angleEncoderPulsePerRotation)</span></div>
<div class="block">Construct the swerve module physical characteristics. Assume coefficient of friction is 1.19
(taken from blue nitrile on carpet from Studica) and optimal voltage is 12v. Assumes the drive
motor current limit is 40A, and the angle motor current limit is 20A.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>driveGearRatio</code> - Gear ratio of the drive motor. Number of motor rotations to rotate the
wheel.</dd>
<dd><code>angleGearRatio</code> - Gear ratio of the angle motor. Number of motor rotations to spin the
wheel.</dd>
<dd><code>wheelDiameter</code> - Wheel diameter in meters.</dd>
<dd><code>driveMotorRampRate</code> - The time in seconds to go from 0 to full throttle on the motor.
(Prevents over drawing power from battery)</dd>
<dd><code>angleMotorRampRate</code> - The time in seconds to go from 0 to full throttle on the motor.
(Prevents overdrawing power and power loss).</dd>
<dd><code>driveEncoderPulsePerRotation</code> - The number of encoder pulses per motor rotation, 1 for
integrated encoders.</dd>
<dd><code>angleEncoderPulsePerRotation</code> - The number of encoder pulses per motor rotation, 1 for
integrated encoders.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>