Updated docs, reduced code footprint

This commit is contained in:
thenetworkgrinch
2023-11-29 17:36:08 -06:00
parent 3d19a44b7f
commit 07095742e8
111 changed files with 297 additions and 282 deletions

View File

@@ -65,11 +65,6 @@ public class SwerveModule
*/
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.
*
@@ -303,16 +298,13 @@ public class SwerveModule
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;
@@ -396,13 +388,16 @@ public class SwerveModule
return configuration;
}
/*
* Get if the last Absolute Encoder had a read issue.
*
* @return 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, or absolute encoder does not exist.
*/
public boolean getAbsoluteEncoderReadIssue()
{
return absoluteEncoderReadIssue;
if(absoluteEncoder == null)
return true;
else
return absoluteEncoder.readingError;
}
}