mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated Telemetry, added javadocs
This commit is contained in:
@@ -82,14 +82,14 @@ public class SwerveModule
|
||||
* Module number for kinematics, usually 0 to 3. front left -> front right -> back left -> back right.
|
||||
*/
|
||||
public int moduleNumber;
|
||||
/**
|
||||
* Feedforward for the drive motor during closed loop control.
|
||||
*/
|
||||
private SimpleMotorFeedforward driveMotorFeedforward;
|
||||
/**
|
||||
* Maximum speed of the drive motors in meters per second.
|
||||
*/
|
||||
public double maxSpeed;
|
||||
/**
|
||||
* Feedforward for the drive motor during closed loop control.
|
||||
*/
|
||||
private SimpleMotorFeedforward driveMotorFeedforward;
|
||||
/**
|
||||
* Anti-Jitter AKA auto-centering disabled.
|
||||
*/
|
||||
@@ -206,12 +206,12 @@ public class SwerveModule
|
||||
moduleNumber,
|
||||
Alert.AlertType.WARNING);
|
||||
|
||||
rawAbsoluteAngleName = "Module[" + configuration.name + "] Raw Absolute Encoder";
|
||||
adjAbsoluteAngleName = "Module[" + configuration.name + "] Adjusted Absolute Encoder";
|
||||
absoluteEncoderIssueName = "Module[" + configuration.name + "] Absolute Encoder Read Issue";
|
||||
rawAngleName = "Module[" + configuration.name + "] Raw Angle Encoder";
|
||||
rawDriveName = "Module[" + configuration.name + "] Raw Drive Encoder";
|
||||
rawDriveVelName = "Module[" + configuration.name + "] Raw Drive Velocity";
|
||||
rawAbsoluteAngleName = "swerve/modules/" + configuration.name + "/Raw Absolute Encoder";
|
||||
adjAbsoluteAngleName = "swerve/modules/" + configuration.name + "/Adjusted Absolute Encoder";
|
||||
absoluteEncoderIssueName = "swerve/modules/" + configuration.name + "/Absolute Encoder Read Issue";
|
||||
rawAngleName = "swerve/modules/" + configuration.name + "/Raw Angle Encoder";
|
||||
rawDriveName = "swerve/modules/" + configuration.name + "/Raw Drive Encoder";
|
||||
rawDriveVelName = "swerve/modules/" + configuration.name + "/Raw Drive Velocity";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,6 +274,16 @@ public class SwerveModule
|
||||
this.driveMotorFeedforward = drive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current drive motor PIDF values.
|
||||
*
|
||||
* @return {@link PIDFConfig} of the drive motor.
|
||||
*/
|
||||
public PIDFConfig getDrivePIDF()
|
||||
{
|
||||
return configuration.velocityPIDF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the drive PIDF values.
|
||||
*
|
||||
@@ -286,13 +296,13 @@ public class SwerveModule
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current drive motor PIDF values.
|
||||
* Get the current angle/azimuth/steering motor PIDF values.
|
||||
*
|
||||
* @return {@link PIDFConfig} of the drive motor.
|
||||
* @return {@link PIDFConfig} of the angle motor.
|
||||
*/
|
||||
public PIDFConfig getDrivePIDF()
|
||||
public PIDFConfig getAnglePIDF()
|
||||
{
|
||||
return configuration.velocityPIDF;
|
||||
return configuration.anglePIDF;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,16 +316,6 @@ public class SwerveModule
|
||||
angleMotor.configurePIDF(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current angle/azimuth/steering motor PIDF values.
|
||||
*
|
||||
* @return {@link PIDFConfig} of the angle motor.
|
||||
*/
|
||||
public PIDFConfig getAnglePIDF()
|
||||
{
|
||||
return configuration.anglePIDF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the desired state of the swerve module. <br /><b>WARNING: If you are not using one of the functions from
|
||||
* {@link SwerveDrive} you may screw up {@link SwerveDrive#kinematics}</b>
|
||||
@@ -379,8 +379,8 @@ public class SwerveModule
|
||||
|
||||
if (SwerveDriveTelemetry.verbosity == TelemetryVerbosity.HIGH)
|
||||
{
|
||||
SmartDashboard.putNumber("Module[" + configuration.name + "] Speed Setpoint", desiredState.speedMetersPerSecond);
|
||||
SmartDashboard.putNumber("Module[" + configuration.name + "] Angle Setpoint", desiredState.angle.getDegrees());
|
||||
SmartDashboard.putNumber("swerve/modules/" + configuration.name + "/Speed Setpoint", desiredState.speedMetersPerSecond);
|
||||
SmartDashboard.putNumber("swerve/modules/" + configuration.name + "/Angle Setpoint", desiredState.angle.getDegrees());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,7 +638,8 @@ public class SwerveModule
|
||||
}
|
||||
SmartDashboard.putNumber(rawAngleName, angleMotor.getPosition());
|
||||
SmartDashboard.putNumber(rawDriveName, driveMotor.getPosition());
|
||||
SmartDashboard.putNumber(rawDriveVelName, driveMotor.getVelocity()); SmartDashboard.putNumber(adjAbsoluteAngleName, getAbsolutePosition());
|
||||
SmartDashboard.putNumber(rawDriveVelName, driveMotor.getVelocity());
|
||||
SmartDashboard.putNumber(adjAbsoluteAngleName, getAbsolutePosition());
|
||||
SmartDashboard.putNumber(absoluteEncoderIssueName, getAbsoluteEncoderReadIssue() ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user