YAGSL uses telemetry in SwerveDrive
and SwerveModule
for consolidation. There are a few remainders of telemetry which is pushed from SwerveDrive.updateOdometry()
. All Telemtry is bound by a verbosity level in SwerveDriveTelemtry.verbosity
as a static variable. The following are the options which you can utilize.
/**
* Verbosity of telemetry data sent back.
*/
public enum TelemetryVerbosity
{
/**
* No telemetry data is sent back.
*/
NONE,
/**
* Low telemetry data, only post the robot position on the field.
*/
LOW,
/**
* Medium telemetry data, swerve directory
*/
INFO,
/**
* Info level + field info
*/
POSE,
/**
* Full swerve drive data is sent back in both human and machine readable forms.
*/
HIGH,
/**
* Only send the machine readable data related to swerve drive.
*/
MACHINE
}
{% hint style="warning" %} Higher telemetry could induce some lag on the robot and slow down the cycle times. So be cautious on what you chose! {% endhint %}
To configure the telemetry please change SwerveDriveTelemetry.verbosity
to one of the enum values that you desire.
/**
* Initialize {@link SwerveDrive} with the directory provided.
*
* @param directory Directory of swerve drive config files.
*/
public SwerveSubsystem(File directory)
{
// Configure the Telemetry before creating the SwerveDrive to avoid unnecessary objects being created.
SwerveDriveTelemetry.verbosity = TelemetryVerbosity.HIGH;
swerveDrive = new SwerveParser(directory).createSwerveDrive(Constants.MAX_SPEED);
}
Telemetry outputs relevant Swerve Drive data to NetworkTables on the roboRIO. You can view these using any dashboard you like!
Some dashboard support swerve drive widgets based off of the SmartDashboard/swerve
NetworkTable entry.
All Swerve Module data is stored under the relevant modules in SmartDashboard/swerve/modules/
which is invaluable during setup.
Swerve Module Telemetry in Shuffleboard
Swerve Drive Telemetry in Shuffleboard with circled relevant keys
Raw Absolute Encoder group on left side, Raw Angle Encoder group on right side.
I use this layout during setup to ensure all modules are reading CCW+. This is the most common overlooked part while configuring swerve drives.
If the Raw Angle Encoder is CCW- (decreasing while rotated counter clockwise) then the angle motor needs to be inverted in the configuration file for that module.
If the Raw Absolute Encoder is CCW- (decreasing while the wheel is rotated counter clockwise) then the absolute encoder might need to be inverted for that module.
There are a few dashboard which support YAGSL widgets too! These developers are amazing and you should definitely checkout their work!