@@ -98,7 +98,8 @@ enum DriveMode {
9898 private final Function <Pose2d , List <EstimatedRobotPose >> cameraPoseDataSupplier ;
9999
100100 private final TelemetryPigeon2 pigeon =
101- new TelemetryPigeon2 (PIGEON_ID , "/drive/gyro" , MiscConstants .CANIVORE_NAME , MiscConstants .TUNING_MODE );
101+ new TelemetryPigeon2 (
102+ PIGEON_ID , "/drive/gyro" , MiscConstants .CANIVORE_NAME , MiscConstants .TUNING_MODE );
102103
103104 private StatusSignal <Double > yawSignal ;
104105
@@ -113,11 +114,15 @@ enum DriveMode {
113114 null ,
114115 this ));
115116
117+ private final SysIdRoutine steerPositionSysId =
118+ new SysIdRoutine (
119+ new SysIdRoutine .Config (
120+ null , null , null , (state ) -> SignalLogger .writeString ("State" , state .toString ())),
121+ new SysIdRoutine .Mechanism (
122+ (Measure <Voltage > voltage ) -> setRawVolts (0.0 , voltage .in (Volts )), null , this ));
123+
116124 private final Alert pigeonConfigurationAlert =
117125 new Alert ("Pigeon failed to initialize" , Alert .AlertType .ERROR );
118- private final BooleanTelemetryEntry allModulesAtAbsoluteZeroEntry =
119- new BooleanTelemetryEntry ("/drive/allModulesAtAbsoluteZero" , true );
120-
121126 private final DoubleTelemetryEntry gyroEntry =
122127 new DoubleTelemetryEntry ("/drive/gyroRadians" , true );
123128
@@ -327,20 +332,6 @@ public double[] getActualDriveVoltages() {
327332 return voltages ;
328333 }
329334
330- public void setAllModulesToAbsolute () {
331- for (SwerveModule module : modules ) {
332- module .resetSteerToAbsolute ();
333- }
334- }
335-
336- private boolean allModulesAtAbsolute () {
337- boolean allSet = true ;
338- for (SwerveModule module : modules ) {
339- allSet &= module .isSetToAbsolute ();
340- }
341- return allSet ;
342- }
343-
344335 /**
345336 * Should only be used for characterization
346337 *
@@ -376,14 +367,22 @@ public SwerveModulePosition[] getModulePositions() {
376367 return actualPositions ;
377368 }
378369
379- public Command quasistaticSysIDCommand (SysIdRoutine .Direction direction ) {
370+ public Command driveQuasistaticSysIDCommand (SysIdRoutine .Direction direction ) {
380371 return driveVelocitySysId .quasistatic (direction ).beforeStarting (SignalLogger ::start );
381372 }
382373
383- public Command dynamicSysIDCommand (SysIdRoutine .Direction direction ) {
374+ public Command driveDynamicSysIDCommand (SysIdRoutine .Direction direction ) {
384375 return driveVelocitySysId .dynamic (direction ).beforeStarting (SignalLogger ::start );
385376 }
386377
378+ public Command steerQuasistaticSysIDCommand (SysIdRoutine .Direction direction ) {
379+ return steerPositionSysId .quasistatic (direction ).beforeStarting (SignalLogger ::start );
380+ }
381+
382+ public Command steerDynamicSysIDCommand (SysIdRoutine .Direction direction ) {
383+ return steerPositionSysId .dynamic (direction ).beforeStarting (SignalLogger ::start );
384+ }
385+
387386 @ Override
388387 public void periodic () {
389388 switch (driveMode ) {
@@ -401,7 +400,7 @@ public void periodic() {
401400 }
402401 case CHARACTERIZATION -> {
403402 for (SwerveModule module : modules ) {
404- module .setCharacterizationVoltage (rawDriveVolts );
403+ module .setDriveCharacterizationVoltage (rawDriveVolts );
405404 }
406405 }
407406 }
@@ -418,7 +417,6 @@ public void periodic() {
418417 }
419418
420419 private void logValues () {
421- allModulesAtAbsoluteZeroEntry .append (allModulesAtAbsolute ());
422420 gyroEntry .append (getGyroRotation ().getRadians ());
423421 chassisSpeedsEntry .append (getCurrentChassisSpeeds ());
424422 actualSwerveStatesEntry .append (getActualStates ());
0 commit comments