Files
YAGSL/docs/swervelib/parser/SwerveModulePhysicalCharacteristics.html
thenetworkgrinch 73b253bce8 Update reliability
2024-08-24 17:40:19 -05:00

293 lines
18 KiB
HTML

<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Sat Aug 24 17:37:32 CDT 2024 -->
<title>SwerveModulePhysicalCharacteristics</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-08-24">
<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.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 pathtoroot = "../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../index-files/index-1.html">Index</a></li>
<li><a href="../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li>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="#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><a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a></code></div>
<div class="col-second even-row-color"><code><a href="#conversionFactor" class="member-name-link">conversionFactor</a></code></div>
<div class="col-last even-row-color">
<div class="block">The conversion factors for the drive and angle motors, created by
<a href="../math/SwerveMath.html#calculateMetersPerRotation(double,double,double)"><code>SwerveMath.calculateMetersPerRotation(double, double, double)</code></a> and
<a href="../math/SwerveMath.html#calculateDegreesPerSteeringRotation(double,double)"><code>SwerveMath.calculateDegreesPerSteeringRotation(double, double)</code></a>.</div>
</div>
<div class="col-first odd-row-color"><code>final int</code></div>
<div class="col-second odd-row-color"><code><a href="#driveMotorCurrentLimit" class="member-name-link">driveMotorCurrentLimit</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Current limits for the Swerve Module.</div>
</div>
<div class="col-first even-row-color"><code>final double</code></div>
<div class="col-second even-row-color"><code><a href="#driveMotorRampRate" class="member-name-link">driveMotorRampRate</a></code></div>
<div class="col-last even-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 odd-row-color"><code>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">The voltage to use for the smart motor voltage compensation.</div>
</div>
<div class="col-first even-row-color"><code>final double</code></div>
<div class="col-second even-row-color"><code><a href="#wheelGripCoefficientOfFriction" class="member-name-link">wheelGripCoefficientOfFriction</a></code></div>
<div class="col-last even-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(swervelib.parser.json.MotorConfigDouble,double,double)" class="member-name-link">SwerveModulePhysicalCharacteristics</a><wbr>(<a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a>&nbsp;conversionFactors,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate)</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(swervelib.parser.json.MotorConfigDouble,double,double,int,int,double,double)" class="member-name-link">SwerveModulePhysicalCharacteristics</a><wbr>(<a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a>&nbsp;conversionFactors,
double&nbsp;wheelGripCoefficientOfFriction,
double&nbsp;optimalVoltage,
int&nbsp;driveMotorCurrentLimit,
int&nbsp;angleMotorCurrentLimit,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate)</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="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="optimalVoltage">
<h3>optimalVoltage</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">optimalVoltage</span></div>
<div class="block">The voltage to use for the smart motor voltage compensation.</div>
</section>
</li>
<li>
<section class="detail" id="conversionFactor">
<h3>conversionFactor</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a></span>&nbsp;<span class="element-name">conversionFactor</span></div>
<div class="block">The conversion factors for the drive and angle motors, created by
<a href="../math/SwerveMath.html#calculateMetersPerRotation(double,double,double)"><code>SwerveMath.calculateMetersPerRotation(double, double, double)</code></a> and
<a href="../math/SwerveMath.html#calculateDegreesPerSteeringRotation(double,double)"><code>SwerveMath.calculateDegreesPerSteeringRotation(double, double)</code></a>.</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;(swervelib.parser.json.MotorConfigDouble,double,double,int,int,double,double)">
<h3>SwerveModulePhysicalCharacteristics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModulePhysicalCharacteristics</span><wbr><span class="parameters">(<a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a>&nbsp;conversionFactors,
double&nbsp;wheelGripCoefficientOfFriction,
double&nbsp;optimalVoltage,
int&nbsp;driveMotorCurrentLimit,
int&nbsp;angleMotorCurrentLimit,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate)</span></div>
<div class="block">Construct the swerve module physical characteristics.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>conversionFactors</code> - The conversion factors for the drive and angle motors, created by
<a href="../math/SwerveMath.html#calculateMetersPerRotation(double,double,double)"><code>SwerveMath.calculateMetersPerRotation(double, double, double)</code></a> and
<a href="../math/SwerveMath.html#calculateDegreesPerSteeringRotation(double,double)"><code>SwerveMath.calculateDegreesPerSteeringRotation(double, double)</code></a>.</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>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(swervelib.parser.json.MotorConfigDouble,double,double)">
<h3>SwerveModulePhysicalCharacteristics</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">SwerveModulePhysicalCharacteristics</span><wbr><span class="parameters">(<a href="json/MotorConfigDouble.html" title="class in swervelib.parser.json">MotorConfigDouble</a>&nbsp;conversionFactors,
double&nbsp;driveMotorRampRate,
double&nbsp;angleMotorRampRate)</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>conversionFactors</code> - The conversion factors for the drive and angle motors, created by
<a href="../math/SwerveMath.html#calculateMetersPerRotation(double,double,double)"><code>SwerveMath.calculateMetersPerRotation(double, double, double)</code></a> and
<a href="../math/SwerveMath.html#calculateDegreesPerSteeringRotation(double,double)"><code>SwerveMath.calculateDegreesPerSteeringRotation(double, double)</code></a>.</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>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>