2626import frc .robot .subsystems .elevator .ElevatorSubsystem ;
2727import frc .robot .subsystems .intake .IntakeSubsystem ;
2828import frc .robot .subsystems .shooter .ShooterSubsystem ;
29- import frc .robot .subsystems .slapdown .SlapdownSubsystem ;
29+ import frc .robot .subsystems .slapdown .SlapdownSuperstructure ;
3030import frc .robot .subsystems .swerve .SwerveDriveSubsystem ;
3131import frc .robot .subsystems .transport .TransportSubsystem ;
3232import frc .robot .subsystems .wrist .WristSubsystem ;
@@ -47,15 +47,13 @@ public class RobotContainer {
4747 // new SwerveDriveSubsystem(photonSubsystem::getEstimatedGlobalPose);
4848 private final SwerveDriveSubsystem driveSubsystem =
4949 new SwerveDriveSubsystem (
50- (pose ) -> {
51- return List .of ();
52- });
50+ (pose ) -> List .of ());
5351 private final ElevatorSubsystem elevatorSubsystem = new ElevatorSubsystem ();
5452 private final ShooterSubsystem shooterSubsystem = new ShooterSubsystem ();
5553 private final WristSubsystem wristSubsystem = new WristSubsystem ();
5654 private final TransportSubsystem transportSubsystem = new TransportSubsystem ();
5755 private final IntakeSubsystem intakeSubsystem = new IntakeSubsystem ();
58- private final SlapdownSubsystem slapdownSubsystem = new SlapdownSubsystem ();
56+ private final SlapdownSuperstructure slapdownSuperstructure = new SlapdownSuperstructure ();
5957 private final ClimberSubsystem climberSubsystem = new ClimberSubsystem ();
6058
6159 private final SendableChooser <Command > autoCommand = new SendableChooser <>();
@@ -79,11 +77,17 @@ public RobotContainer() {
7977 }
8078
8179 private void configureAutos () {
82- autoCommand .addOption ("Wrist Q Forward" , wristSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kForward ));
83- autoCommand .addOption ("Wrist Q Back" , wristSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kReverse ));
84- autoCommand .addOption ("Wrist D Forward" , wristSubsystem .sysIdDynamic (SysIdRoutine .Direction .kForward ));
85- autoCommand .addOption ("Wrist D Back" , wristSubsystem .sysIdDynamic (SysIdRoutine .Direction .kReverse ));
86- autoCommand .addOption ("Wrist 5 deg" , wristSubsystem .setPositonCommand (new Rotation2d (Units .degreesToRadians (40 ))));
80+ autoCommand .addOption (
81+ "Wrist Q Forward" , wristSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kForward ));
82+ autoCommand .addOption (
83+ "Wrist Q Back" , wristSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kReverse ));
84+ autoCommand .addOption (
85+ "Wrist D Forward" , wristSubsystem .sysIdDynamic (SysIdRoutine .Direction .kForward ));
86+ autoCommand .addOption (
87+ "Wrist D Back" , wristSubsystem .sysIdDynamic (SysIdRoutine .Direction .kReverse ));
88+ autoCommand .addOption (
89+ "Wrist 5 deg" ,
90+ wristSubsystem .setPositonCommand (new Rotation2d (Units .degreesToRadians (40 ))));
8791 autoCommand .addOption (
8892 "Elevator Quastatic Backward" ,
8993 elevatorSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kReverse ));
@@ -106,12 +110,6 @@ private void configureAutos() {
106110 "Intake Test Command" ,
107111 intakeSubsystem .setIntakeVoltageCommand (Constants .IntakeConstants .INTAKE_VOLTAGE ));
108112 autoCommand .addOption ("Shooter Test Command 4000" , shooterSubsystem .runVelocityCommand (100 ));
109- autoCommand .addOption ("Slap Feed" , slapdownSubsystem .setFeederVoltageCommand (5 ));
110- autoCommand .addOption (
111- "Intake feed" ,
112- Commands .parallel (
113- slapdownSubsystem .setFeederVoltageCommand (5 ),
114- intakeSubsystem .setIntakeVoltageCommand (Constants .IntakeConstants .INTAKE_VOLTAGE )));
115113 autoCommand .addOption (
116114 "Shooter Quastatic Forward Command" ,
117115 shooterSubsystem .sysIdQuasistatic (SysIdRoutine .Direction .kForward ));
@@ -155,15 +153,10 @@ private void configureDriverBindings() {
155153 // .onTrue(nearestAmpCommand(DriverStation.getAlliance().get(), driveSubsystem));
156154 driverController
157155 .povDown ()
158- .toggleOnTrue (slapdownSubsystem . setRotationGoalCommand ( new Rotation2d ( 0 ) ));
156+ .toggleOnTrue (slapdownSuperstructure . setDownAndRunCommand ( ));
159157 driverController
160- .povDown ()
161- .toggleOnTrue (slapdownSubsystem .setFeederVoltageCommand (4 )); // TODO: THIS
162- driverController
163- .povDown ()
164- .toggleOnFalse (
165- slapdownSubsystem .setRotationGoalCommand (new Rotation2d (Units .degreesToRadians (90 ))));
166- driverController .povDown ().toggleOnFalse (slapdownSubsystem .setFeederVoltageCommand (0 ));
158+ .povUp ()
159+ .toggleOnTrue (slapdownSuperstructure .setUpCommand ()); // TODO: THIS
167160 driverController .a ().onTrue (intakeSubsystem .checkIntakeCommand ());
168161 }
169162
@@ -181,7 +174,10 @@ private void configureOperatorBindings() {
181174 // operatorController
182175 // .rightStick()
183176 // .whileTrue(elevatorSubsystem.runElevatorCommand(operatorController.getRightY()));
184- operatorController .rightTrigger ().onTrue (new ShootAtAngleCommand (
177+ operatorController
178+ .rightTrigger ()
179+ .onTrue (
180+ new ShootAtAngleCommand (
185181 shooterSubsystem , transportSubsystem , wristSubsystem , SHOOTING_ANGLE ));
186182 operatorController
187183 .leftTrigger ()
@@ -197,10 +193,29 @@ private void configureOperatorBindings() {
197193 .onTrue (
198194 new AmpPlaceCommand (
199195 elevatorSubsystem , wristSubsystem , shooterSubsystem , transportSubsystem ));
200- operatorController .share ().whileTrue (Commands .parallel (elevatorSubsystem .setElevatorPositionCommand (0 ), slapdownSubsystem .setFeederVoltageCommand (6 ), intakeSubsystem .setIntakeVoltageCommand (6 ), transportSubsystem .setVoltageCommand (4.0 ).until (transportSubsystem ::atSensor ).andThen (transportSubsystem .setVoltageCommand (0.0 ))));
201- // operatorController.share().onTrue(transportSubsystem.setVoltageCommand(6.0).until(transportSubsystem::atSensor));
196+ operatorController
197+ .share ()
198+ .whileTrue (
199+ Commands .parallel (
200+ elevatorSubsystem .setElevatorPositionCommand (0 ),
201+ slapdownSuperstructure .setDownAndRunCommand (),
202+ intakeSubsystem .setIntakeVoltageCommand (6 ),
203+ transportSubsystem
204+ .setVoltageCommand (4.0 )
205+ .until (transportSubsystem ::atSensor )
206+ .andThen (transportSubsystem .setVoltageCommand (0.0 ))));
207+ //
208+ // operatorController.share().onTrue(transportSubsystem.setVoltageCommand(6.0).until(transportSubsystem::atSensor));
202209 double rpm = 10000 ;
203- operatorController .options ().whileTrue (Commands .parallel (elevatorSubsystem .setElevatorPositionCommand (Units .inchesToMeters (0 )), shooterSubsystem .runVelocityCommand (rpm /60 ), Commands .sequence (Commands .waitUntil (shooterSubsystem ::inTolerance ), transportSubsystem .setVoltageCommand (12.0 ))));
210+ operatorController
211+ .options ()
212+ .whileTrue (
213+ Commands .parallel (
214+ elevatorSubsystem .setElevatorPositionCommand (Units .inchesToMeters (0 )),
215+ shooterSubsystem .runVelocityCommand (rpm / 60 ),
216+ Commands .sequence (
217+ Commands .waitUntil (shooterSubsystem ::inTolerance ),
218+ transportSubsystem .setVoltageCommand (12.0 ))));
204219 }
205220
206221 private void configureDriving () {
0 commit comments