@@ -58,11 +58,13 @@ public RobotContainer() {
5858 autoChooser = AutoBuilder .buildAutoChooser ("Auto Chooser" );
5959 SmartDashboard .putData ("Auto Mode" , autoChooser );
6060
61- configureSubsystemDefaultCommands ();
62- configureBindings ();
61+ // Idle while the robot is disabled. This ensures the configured
62+ // neutral mode is applied to the drive motors while disabled.
63+ RobotModeTriggers .disabled ()
64+ .whileTrue (drivetrain .applyRequest (() -> new SwerveRequest .Idle ()).ignoringDisable (true ));
6365 }
6466
65- private void configureSubsystemDefaultCommands () {
67+ public void configureSubsystemDefaultCommands () {
6668
6769 drivetrain .setDefaultCommand (
6870 // Drivetrain will execute this command periodically
@@ -90,34 +92,36 @@ private void configureSubsystemDefaultCommands() {
9092 .withRotationalDeadband (DriveConstants .MAX_ANGULAR_SPEED * 0.1 )));
9193 }
9294
93- private void configureBindings () {
95+ public void removeSubsystemDefaultCommands (){
96+ drivetrain .removeDefaultCommand ();
97+ }
98+
99+ public void configureTestBindings () {
94100 // Idle while the robot is disabled. This ensures the configured
95101 // neutral mode is applied to the drive motors while disabled.
102+
96103 final var idle = new SwerveRequest .Idle ();
97104 RobotModeTriggers .disabled ()
98105 .whileTrue (drivetrain .applyRequest (() -> idle ).ignoringDisable (true ));
106+
107+ driverJoystick .rightBumper ().onTrue (Commands .runOnce (SignalLogger ::start ));
108+ driverJoystick .leftBumper ().onTrue (Commands .runOnce (SignalLogger ::stop ));
99109
100- // // driverJoystick.a().whileTrue(drivetrain.applyRequest(() -> brake));
101- // driverJoystick
102- // .b()
103- // .whileTrue(
104- // drivetrain.applyRequest(
105- // () ->
106- // point.withModuleDirection(
107- // new Rotation2d(-driverJoystick.getLeftY(),
108- // -driverJoystick.getLeftX()))));
110+ operatorJoystick .y ().whileTrue (shooter .sysIdQuasistatic (SysIdRoutine .Direction .kForward ));
111+ operatorJoystick .a ().whileTrue (shooter .sysIdQuasistatic (SysIdRoutine .Direction .kReverse ));
112+ operatorJoystick .b ().whileTrue (shooter .sysIdDynamic (SysIdRoutine .Direction .kForward ));
113+ operatorJoystick .x ().whileTrue (shooter .sysIdDynamic (SysIdRoutine .Direction .kReverse ));
109114
115+ // Reset the field-centric heading on left bumper press.
116+ driverJoystick .start ().onTrue (drivetrain .runOnce (drivetrain ::seedFieldCentric ));
117+ }
118+
119+ public void configureTeleopBindings () {
110120 // Run SysId routines when holding back/start and X/Y.
111121 // Note that each routine should be run exactly once in a single log.
112122
113123 // joystick.x().onTrue(drivetrain.sysIdSteer());
114124 // joystick.y().onTrue(drivetrain.sysIdTranslation());
115- // driverJoystick.x().onTrue(new WheelSlipTest(drivetrain));
116- /*
117- driverJoystick
118- .y()
119- .whileTrue(new DriveBySpeed(drivetrain, DrivePreferences.onemeter_speed)); // Testing only
120- */
121125
122126 driverJoystick
123127 .rightTrigger ()
@@ -139,14 +143,6 @@ private void configureBindings() {
139143 .whileTrue (indexer .setIndexerNoPID ())
140144 .onFalse (indexer .stopIndexerNoPID ());
141145
142- driverJoystick .rightBumper ().onTrue (Commands .runOnce (SignalLogger ::start ));
143- driverJoystick .leftBumper ().onTrue (Commands .runOnce (SignalLogger ::stop ));
144-
145- operatorJoystick .y ().whileTrue (shooter .sysIdQuasistatic (SysIdRoutine .Direction .kForward ));
146- operatorJoystick .a ().whileTrue (shooter .sysIdQuasistatic (SysIdRoutine .Direction .kReverse ));
147- operatorJoystick .b ().whileTrue (shooter .sysIdDynamic (SysIdRoutine .Direction .kForward ));
148- operatorJoystick .x ().whileTrue (shooter .sysIdDynamic (SysIdRoutine .Direction .kReverse ));
149-
150146 // Reset the field-centric heading on left bumper press.
151147 driverJoystick .start ().onTrue (drivetrain .runOnce (drivetrain ::seedFieldCentric ));
152148
0 commit comments