Skip to content

Commit 4455977

Browse files
committed
switched to signal logger for logging the sysid routine state in the swerve routines
1 parent 17589c5 commit 4455977

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/main/java/frc/robot/subsystems/Swerve.java

+12-6
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ public class Swerve extends SwerveDrivetrain implements Subsystem, SelfChecked {
8585
null, // Use default ramp rate (1 V/s)
8686
Volts.of(4), // Reduce dynamic step voltage to 4 V to prevent brownout
8787
null, // Use default timeout (10 s)
88-
state -> DogLog.log("SysId Translation Routine State", state.toString())),
88+
state ->
89+
SignalLogger.writeString(
90+
"Swerve SysId Translation Routine State", state.toString())),
8991
new SysIdRoutine.Mechanism(
9092
volts -> setControl(_translationSysIdRequest.withVolts(volts)), null, this));
9193

@@ -96,7 +98,8 @@ public class Swerve extends SwerveDrivetrain implements Subsystem, SelfChecked {
9698
null, // Use default ramp rate (1 V/s)
9799
Volts.of(7), // Use dynamic voltage of 7 V
98100
null, // Use default timeout (10 s)
99-
state -> DogLog.log("SysId Steer Routine State", state.toString())),
101+
state ->
102+
SignalLogger.writeString("Swerve SysId Steer Routine State", state.toString())),
100103
new SysIdRoutine.Mechanism(
101104
volts -> setControl(_steerSysIdRequest.withVolts(volts)), null, this));
102105

@@ -109,13 +112,15 @@ public class Swerve extends SwerveDrivetrain implements Subsystem, SelfChecked {
109112
// This is in radians per second, but SysId only supports "volts"
110113
Volts.of(Math.PI),
111114
null, // Use default timeout (10 s)
112-
state -> DogLog.log("SysId Rotation Routine State", state.toString())),
115+
state ->
116+
SignalLogger.writeString(
117+
"Swerve SysId Rotation Routine State", state.toString())),
113118
new SysIdRoutine.Mechanism(
114119
output -> {
115120
// output is actually radians per second, but SysId only supports "volts"
116121
setControl(_rotationSysIdRequest.withRotationalRate(output.in(Volts)));
117122
// also log the requested output for SysId
118-
SignalLogger.writeDouble("Rotational Rate", output.in(Volts));
123+
SignalLogger.writeDouble("Swerve Rotational Rate", output.in(Volts));
119124
},
120125
null,
121126
this));
@@ -467,11 +472,12 @@ public void periodic() {
467472

468473
@Override
469474
public void simulationPeriodic() {
470-
_visionSystemSim.update(getPose()); // TODO
475+
_visionSystemSim.update(getPose()); // TODO: this might require a seperate wheel-only odom
471476
}
472477

478+
// TODO: add self check routines
473479
private Command selfCheckModule(String name, SwerveModule module) {
474-
return shiftSequence(); // TODO
480+
return shiftSequence();
475481
}
476482

477483
@Override

0 commit comments

Comments
 (0)