Skip to content

Commit

Permalink
Changed the telemetry location for modules to swerve/modules/.../ f…
Browse files Browse the repository at this point in the history
…rom `Module[...]`

Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
  • Loading branch information
thenetworkgrinch committed Jun 12, 2024
1 parent 1d0bb34 commit d0f7ae7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/main/java/swervelib/SwerveDriveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ public static void logDriveMotorActivity(SwerveModule module, SysIdRoutineLog lo
double power = powerSupplied.get();
double distance = module.getPosition().distanceMeters;
double velocity = module.getDriveMotor().getVelocity();
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Drive Power", power);
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Drive Position", distance);
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Drive Velocity", velocity);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Drive Power", power);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Drive Position", distance);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Drive Velocity", velocity);
log.motor("drive-" + module.configuration.name)
.voltage(m_appliedVoltage.mut_replace(power, Volts))
.linearPosition(m_distance.mut_replace(distance, Meters))
Expand Down Expand Up @@ -358,9 +358,9 @@ public static void logAngularMotorActivity(SwerveModule module, SysIdRoutineLog
double power = powerSupplied.get();
double angle = module.getAbsolutePosition();
double velocity = module.getAbsoluteEncoder().getVelocity();
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Angle Power", power);
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Angle Position", angle);
SmartDashboard.putNumber("Module[" + module.configuration.name + "] SysId Absolute Encoder Velocity", velocity);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Angle Power", power);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Angle Position", angle);
SmartDashboard.putNumber("swerve/modules/" + module.configuration.name + "/SysId Absolute Encoder Velocity", velocity);
log.motor("angle-" + module.configuration.name)
.voltage(m_appliedVoltage.mut_replace(power, Volts))
.angularPosition(m_anglePosition.mut_replace(angle, Degrees))
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/swervelib/SwerveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ public SwerveModule(int moduleNumber, SwerveModuleConfiguration moduleConfigurat
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";
}

/**
Expand Down Expand Up @@ -379,8 +379,8 @@ public void setDesiredState(SwerveModuleState desiredState, boolean isOpenLoop,

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());
}
}

Expand Down

0 comments on commit d0f7ae7

Please sign in to comment.