mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Merge branch 'main' of github.com:BroncBotz3481/YAGSL
This commit is contained in:
@@ -20,7 +20,7 @@ SwerveDrive swerveDrive=new SwerveParser(new File(Filesystem.getDeployDirectory(
|
||||
# Library Information
|
||||
### Installation
|
||||
- [ ] Install NavX Library
|
||||
- [ ] Install Pheonix Library
|
||||
- [ ] Install Phoenix Library
|
||||
- [ ] Install REVLib.
|
||||
- [ ] Install YAGSL (`https://broncbotz3481.github.io/YAGSL-Lib/yagsl/yagsl.json`)
|
||||
|
||||
|
||||
@@ -901,6 +901,8 @@ public class SwerveDrive
|
||||
"Module[" + module.configuration.name + "] Relative Encoder", module.getRelativePosition());
|
||||
SmartDashboard.putNumber(
|
||||
"Module[" + module.configuration.name + "] Absolute Encoder", module.getAbsolutePosition());
|
||||
SmartDashboard.putNumber(
|
||||
"Module[" + module.configuration.name + "] Absolute Encoder Read Issue", module.getAbsoluteEncoderReadIssue());
|
||||
}
|
||||
if (SwerveDriveTelemetry.verbosity.ordinal() >= TelemetryVerbosity.HIGH.ordinal())
|
||||
{
|
||||
|
||||
@@ -65,6 +65,11 @@ 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.
|
||||
*
|
||||
@@ -298,13 +303,16 @@ 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;
|
||||
@@ -387,4 +395,14 @@ 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.
|
||||
*/
|
||||
public boolean getAbsoluteEncoderReadIssue()
|
||||
{
|
||||
return absoluteEncoderReadIssue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user