Skip to content

Commit

Permalink
Reduced code footprint, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thenetworkgrinch committed Nov 29, 2023
1 parent 55598bd commit 087d318
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 32 deletions.
15 changes: 5 additions & 10 deletions src/main/java/swervelib/SwerveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public class SwerveModule {
/** Encoder synchronization queued. */
private boolean synchronizeEncoderQueued = false;

/** Absolute Encoder Read Issue Dectected. */
public boolean absoluteEncoderReadIssue = false;

/**
* Construct the swerve module and initialize the swerve module motors and absolute encoder.
*
Expand Down Expand Up @@ -256,14 +253,11 @@ public SwerveModulePosition getPosition() {
public double getAbsolutePosition() {
double angle;
if (absoluteEncoder != null) {
absoluteEncoderReadIssue = false;
angle = absoluteEncoder.getAbsolutePosition() - angleOffset;
if (absoluteEncoder.readingError) {
absoluteEncoderReadIssue = true;
angle = getRelativePosition();
}
} else {
absoluteEncoderReadIssue = true;
angle = getRelativePosition();
}
angle %= 360;
Expand Down Expand Up @@ -340,12 +334,13 @@ public SwerveModuleConfiguration getConfiguration() {
return configuration;
}

/*
* Get if the last Absolute Encoder had a read issue.
/**
* Get if the last Absolute Encoder had a read issue, such as it does not exist.
*
* @return If the last Absolute Encoder had a read issue.
* @return If the last Absolute Encoder had a read issue, or absolute encoder does not exist.
*/
public boolean getAbsoluteEncoderReadIssue() {
return absoluteEncoderReadIssue;
if (absoluteEncoder == null) return true;
else return absoluteEncoder.readingError;
}
}
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<versions>
<version>2023.1.6</version>
</versions>
<lastUpdated>20231129225827</lastUpdated>
<lastUpdated>20231129233622</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7b07e72d5ec6d34358857f96863a056d
63a22b931b0c5a74161af5908fe9b005
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a9e94492cdfd009f170d24e98375431f35055f68
641871e7ebe0b9937e5be9b1740495818c341a97
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f1d4f66647ca83fccab78c37334b8657c69cf87d81c6275559c4888502586a63
f7b2c29a274f489f713c90a671444d85d637f4f3acfb1f692515e4f5dda0bf31
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
952620311014b85c13cc8536499ca8995b369d81e70c9f2411af1a594215c971a0d3ceb0f715b225a12656dd405bbc76a750bb1d7057d030bccdf81204c359c5
215e36f0073035fa7d9c8654491498451e50408a068db5562243e29414fb503c519db3d2b5fddab3a57ffa4d3404355bfa8ae60aff957820206dd1e766a0930f
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a9b6e4ef2f13a3ffa5f538d8e7d2e86f
27eeec8643556916a8330b31fe0af871
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60f023ce7400505143f5672f13d08c1c8af4aad9
830a43b1bade68378dedab8872f84dba0a5ab32d
Original file line number Diff line number Diff line change
@@ -1 +1 @@
650d2e09c41a3da692683851a46ee37aded93cf412517dce9eced23a75219207
9cf86b2ae08e41c9bf5b06fdcd810f0c5f550e8608d0fcab20a3dd258a911463
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0db77600b91f0f1b4c3b9da56d3a8ea5358b8f5be7146455f59567fb5ba2f712daadb8b9bd20ec497df41d5b33922ae44b0ae7e24da6fda2cdd6d277c0fa8e93
23487203f388a5a654f5853bd871fedb58b2e56ef9b73b29114cac144be56d1afc14d078475129bf1f67c77355c4fbf6ceaf36d8abd89cf87e8b4f41c8e36506
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3f1bb702c6841ffa0b8db5b0abb13fae
2ec7e6f6a285b9316dae028db2c050d8
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8c95f3a4fc470af9bbc774fc21e18804d976be96
6189cb66d3092554f96e8bc2c96caae82f8a0d14
Original file line number Diff line number Diff line change
@@ -1 +1 @@
edb889fdfb1bfde6bd1da3bec22adf38b6b85031bba19c150d82d1c9f2f71e76
8df247740c0c843e3e067025ad9a5d47972b0359772b338cc16ec3c3af0eca27
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f468fb925b3cb84f5e431eafad6683e46d10e65f67397b08394aa7116a2fedcfa8974ef2fdb4dbe0dd48d233372359095e86f9080d3a0654e0ea76bdb77a4866
5016eb148ac4f75166f83aa3a7955d0b30c495c3accbebe0c19ff8a72a9a937b206e286439cd07bc504ae2dc132181f36e295bc91bea714cc71231b3f99e36a9
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0da4ed1fac7941f33a70ccd88a1ac48a
fd726bb0c10ed0a5bb7b75f50d328af1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a6e9d9b6e02a7207efda1c7edfeecf6d4ed0f7de
aea5fd8ab50bac89b58652c7dadc849deba4a83c
Original file line number Diff line number Diff line change
@@ -1 +1 @@
898862a89bada709f06210c9da5d1b1a30a4f6b0eeaef98197579066f5325033
d5c5b02a4ef7b3fc1b499db9a2c05e8d08352ed429f5013e4a7a0063a32d89bd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aef834d3f6836cf09dddc80b459138e0b9e48658493030fb75e9f3098b6ab88afc153b1547980ad694fcaa2461e9d9733b70e72cb73de6c59343bec39f780a66
53a27fc3c95cca155a45cadad4cbdc66b760b103eb68d2db67eb601fa22317464145d82aaaa2741c215b9ccd2851b934b95adb92e73491f438d2dd5efedafc3f
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-java/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<versions>
<version>2023.1.6</version>
</versions>
<lastUpdated>20231129225829</lastUpdated>
<lastUpdated>20231129233624</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-java/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f9100383b38c6b6b9e6bfc968846212f
3321db731dc770209cdc23dec71d7eb7
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-java/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51021f4ae5fe1c76dd06932e8671170cf1a0760b
b1e902f3731abdd5a1eb1cc6f909b28adcdfd3b1
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-java/maven-metadata.xml.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ff298e242f9ed60ac81d8692f889ff0727fcd1cdf6aa9df88a7291091ab76541
162c179a75917f6758808d0b2bca252915586d88c84ba5a6690e3be7a627df21
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-java/maven-metadata.xml.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
37a772772c7eab2e3556b6bb663a3cf576854815ebf27fc55e8fe4e443ddb181600caf7083977947de6c7b598347613e3fe325152c3f31e4b1337cab11502a9a
cb50d799d1d65b991fc477d6bcd55dda980746f88ae36a15fd3f08b6f274a0c2980bc37c433946bcd88b167780671ed28df1c1357f5b7e8607955b7c57e9d633

0 comments on commit 087d318

Please sign in to comment.