Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ private void addAutos() {
autoChooser.addOption("Hood Sysid", shooter.runHoodSysid());
autoChooser.addOption("Index Roller Sysid", indexer.runRollerSysId());
autoChooser.addOption("Intake Roller Sysid", intake.runRollerSysid());
autoChooser.addOption("Kicker Sysid", indexer.runKickerSysId());
autoChooser.addOption("Flywheel Sysid", shooter.runFlywheelSysid());
haveAutosGenerated = true;
System.out.println("Done generating autos");
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/frc/robot/subsystems/indexer/IndexerSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ public class IndexerSubsystem extends SubsystemBase {
(state) -> Logger.recordOutput("Indexer/Roller/SysID State", state)),
new Mechanism((volts) -> indexRollerIO.setRollerVoltage(volts.in(Volts)), null, this));

private SysIdRoutine kickerRollerSysid =
new SysIdRoutine(
new Config(
null,
null,
null,
(state) -> Logger.recordOutput("Indexer/Kicker/SysID State", state)),
new Mechanism((volts) -> kickerIO.setRollerVoltage(volts.in(Volts)), null, this));

public static final double MAX_ACCELERATION = 10.0;
public static final double MAX_VELOCITY = 10.0;
public static final double KICKER_GEAR_RATIO = 2.0;
Expand Down Expand Up @@ -174,4 +183,12 @@ public Command runRollerSysId() {
indexRollerSysid.dynamic(Direction.kForward),
indexRollerSysid.dynamic(Direction.kReverse));
}

public Command runKickerSysId() {
return Commands.sequence(
kickerRollerSysid.quasistatic(Direction.kForward),
kickerRollerSysid.quasistatic(Direction.kReverse),
kickerRollerSysid.dynamic(Direction.kForward),
kickerRollerSysid.dynamic(Direction.kReverse));
}
}