@@ -32,7 +32,7 @@ public class RobotContainer {
32
32
// The robot's subsystems and commands are defined here...
33
33
34
34
public static final Climber climber = new Climber ();
35
- public static final Magazine magazine = new Magazine ();
35
+ public static final Revolver revolver = new Revolver ();
36
36
public static final ShooterWheel shooterWheel = new ShooterWheel ();
37
37
public static final Hood hood = new Hood ();
38
38
public static final Turret turret = new Turret ();
@@ -74,33 +74,50 @@ public static void init() {
74
74
shooterWheel .init ();
75
75
}
76
76
77
+ public static void safetyInit () {
78
+ hood .setVBus (0.0 );
79
+ turret .setVBus (0.0 );
80
+ climber .setPistons (false );
81
+ }
82
+
77
83
private void configureDefaultCommands () {
78
84
drive .setDefaultCommand (new DriveDefault ());
79
85
// intake.setDefaultCommand(new IntakeExtenderVBus());
80
- magazine .setDefaultCommand (new MagazineDefault ());
81
-
82
- // TODO: Figure out if the current approach of "AirCompressorDefault()" is the way to go for compressor control.
83
- // KBS doesn't think the below is the right way to have the compressor be on "by default" because
84
- // it would require there to always be a command running to keep the compressor off. However, that
85
- // is a good way to ensure it doesn't get left off by accident. Not quite sure how to handle this;
86
- // would really rather that other commands which need the compressor off (such as a high-power command
87
- // which wants all the battery power available) would turn the compressor off when the command starts
88
- // and off when the command ends.) Then again, maybe the "defaultCommand" is a good way to do this
86
+ revolver .setDefaultCommand (new RevolverDefault ());
87
+
88
+ // TODO: Figure out if the current approach of "AirCompressorDefault()" is the
89
+ // way to go for compressor control.
90
+ // KBS doesn't think the below is the right way to have the compressor be on "by
91
+ // default" because
92
+ // it would require there to always be a command running to keep the compressor
93
+ // off. However, that
94
+ // is a good way to ensure it doesn't get left off by accident. Not quite sure
95
+ // how to handle this;
96
+ // would really rather that other commands which need the compressor off (such
97
+ // as a high-power command
98
+ // which wants all the battery power available) would turn the compressor off
99
+ // when the command starts
100
+ // and off when the command ends.) Then again, maybe the "defaultCommand" is a
101
+ // good way to do this
89
102
// and I just don't understand the style yet.
90
103
// compressor.setDefaultCommand(new AirCompressorDefault());
91
104
}
92
105
93
106
private void configureAutonomousPrograms () {
94
107
LinkedList <Command > autonomousPrograms = new LinkedList <Command >();
95
- // TODO: fix "wierdness" with auto program selection - sometimes doesn't seem to work
96
- // TODO: fix so that auto program is shown not just when changed (as shows old setting sometimes)
97
-
98
- // autonomousPrograms.push(/* 01 */ new StayStill());
99
- autonomousPrograms .push (/* 01 */ new DriveStraightOnly ());
100
- autonomousPrograms .push (/* 00 */ new TrenchAuto ());
101
108
102
- // autonomousPrograms.push( new ShooterReadyAimFire());
103
- // autonomousPrograms.push(new TestTurret());
109
+ autonomousPrograms .push (/* 11 */ new StayStill ());
110
+ autonomousPrograms .push (/* 10 */ new StartBWDriveOnlyToRP ());
111
+ autonomousPrograms .push (/* 09 */ new StartBWDriveOnlyToWall ());
112
+ autonomousPrograms .push (/* 08 */ new StartFWDriveOnlyToRP ());
113
+ autonomousPrograms .push (/* 07 */ new StartFWDriveOnlyToWall ());
114
+ autonomousPrograms .push (/* 06 */ new StartBWShoot3ThenToRP ());
115
+ autonomousPrograms .push (/* 05 */ new StartBWShoot3ThenToWall ());
116
+ autonomousPrograms .push (/* 04 */ new StartFWShoot3ThenToRP ());
117
+ autonomousPrograms .push (/* 03 */ new StartFWShoot3ThenToWall ());
118
+ autonomousPrograms .push (/* 02 */ new StartFWRendezvous ());
119
+ autonomousPrograms .push (/* 01 */ new StartBWOppTrench ());
120
+ autonomousPrograms .push (/* 00 */ new StartBWTrench ());
104
121
105
122
autonomous .setAutonomousPrograms (autonomousPrograms );
106
123
@@ -160,8 +177,8 @@ private void configureDriverPadButtons() {
160
177
// about -30 degrees
161
178
// DRIVER_PAD.DRIVER_PAD_D_PAD_RIGHT.whileHeld(new
162
179
// ShooterSetTurretVBus(+0.2));// about +30 degrees
163
- DRIVER_PAD .DRIVER_PAD_D_PAD_UP .whenPressed (new HoodSetAbs (Hood .HOOD_INITIATION_LINE_POSITION ));
164
- DRIVER_PAD .DRIVER_PAD_D_PAD_DOWN .whenPressed (new HoodSetAbs (Hood .HOOD_TARGET_ZONE_POSITION ));
180
+ DRIVER_PAD .DRIVER_PAD_D_PAD_UP .whenPressed (new HoodSetAbsWhileHeld (Hood .HOOD_INITIATION_LINE_POSITION ));
181
+ DRIVER_PAD .DRIVER_PAD_D_PAD_DOWN .whenPressed (new HoodSetAbsWhileHeld (Hood .HOOD_TARGET_ZONE_POSITION ));
165
182
166
183
// DRIVER_PAD.DRIVER_PAD_D_PAD_LEFT.whenPressed(new
167
184
// ShooterSetTurretRel(-200.0));
@@ -184,7 +201,8 @@ private void configureDriverPadButtons() {
184
201
DRIVER_PAD .DRIVER_PAD_YELLOW_BUTTON .whenPressed (new ShooterWheelSet (3000 ));
185
202
186
203
DRIVER_PAD .DRIVER_PAD_BACK_BUTTON .whileHeld (new DriveStraight (0.1 ));
187
- // TODO: above hard-coded constant (3000) should be a named constant from Shooter.java
204
+ // TODO: above hard-coded constant (3000) should be a named constant from
205
+ // Shooter.java
188
206
189
207
DRIVER_PAD .DRIVER_PAD_LEFT_UPPER_TRIGGER_BUTTON .whileHeld (new FeederSet (1.0 ));
190
208
@@ -194,37 +212,36 @@ private void configureOperatorStickButtons() {
194
212
}
195
213
196
214
private void configureOperatorPadButtons () {
197
- OPERATOR_PAD .OPERATOR_PAD_BUTTON_ONE .whileHeld (new MagazineSetTurntable (0.2 ));
215
+ OPERATOR_PAD .OPERATOR_PAD_BUTTON_ONE .whileHeld (new RevolverSetTurntable (0.2 ));
198
216
OPERATOR_PAD .OPERATOR_PAD_BUTTON_TWO .whenPressed (new IntakeSetPosition (RobotContainer .intake .PIVOT_DOWN ));
199
- OPERATOR_PAD .OPERATOR_PAD_BUTTON_THREE .whileHeld (new MagazineSetTurntable (0.5 ));
217
+ OPERATOR_PAD .OPERATOR_PAD_BUTTON_THREE .whileHeld (new RevolverSetTurntable (0.5 ));
200
218
OPERATOR_PAD .OPERATOR_PAD_BUTTON_FOUR .whenPressed (new IntakeSetPosition (RobotContainer .intake .PIVOT_UP ));
201
219
202
220
// new ShooterSetWheel(1000));
203
- OPERATOR_PAD .OPERATOR_PAD_BUTTON_FIVE .whileHeld (new ChimneySetChimney (1.0 ));
204
- OPERATOR_PAD .OPERATOR_PAD_BUTTON_SIX .whileHeld (new IntakeSetRollers (-1.0 ));
221
+ OPERATOR_PAD .OPERATOR_PAD_BUTTON_FIVE .whileHeld (new ChimneySet (1.0 ));
222
+ OPERATOR_PAD .OPERATOR_PAD_BUTTON_SIX .whileHeld (new IntakeSetRollersWhileHeld (-1.0 ));
205
223
206
224
OPERATOR_PAD .OPERATOR_PAD_BUTTON_SEVEN .whileHeld (new TurretAimToTarget ());
207
- OPERATOR_PAD .OPERATOR_PAD_BUTTON_EIGHT .whileHeld (new IntakeSetRollers (1.0 ));
208
-
225
+ OPERATOR_PAD .OPERATOR_PAD_BUTTON_EIGHT .whileHeld (new IntakeSetRollersWhileHeld (1.0 ));
226
+
209
227
OPERATOR_PAD .OPERATOR_PAD_BUTTON_NINE .whenPressed (new ClimberSetPistons (true ));
210
228
OPERATOR_PAD .OPERATOR_PAD_BUTTON_TEN .whenPressed (new ClimberSetPistons (false ));
211
229
212
-
213
230
// OPERATOR_PAD.OPERATOR_PAD_D_PAD_UP.whenPressed(new
214
231
// IntakeSetPosition(RobotContainer.intake.PIVOT_UP));
215
232
// OPERATOR_PAD.OPERATOR_PAD_D_PAD_DOWN.whenPressed(new
216
233
// IntakeSetPosition(RobotContainer.intake.PIVOT_DOWN));
217
- OPERATOR_PAD .OPERATOR_PAD_D_PAD_LEFT .whileHeld (new TurretSetVBus (-0.2 ));
218
- OPERATOR_PAD .OPERATOR_PAD_D_PAD_RIGHT .whileHeld (new TurretSetVBus (+0.2 ));
234
+ OPERATOR_PAD .OPERATOR_PAD_D_PAD_LEFT .whileHeld (new TurretSetVBus (-0.4 ));
235
+ OPERATOR_PAD .OPERATOR_PAD_D_PAD_RIGHT .whileHeld (new TurretSetVBus (+0.4 ));
219
236
OPERATOR_PAD .OPERATOR_PAD_D_PAD_UP .whileHeld (new HoodAdjust (+1000.0 ));
220
237
OPERATOR_PAD .OPERATOR_PAD_D_PAD_DOWN .whileHeld (new HoodAdjust (-1000.0 ));
221
238
222
239
OPERATOR_PAD .OPERATOR_PAD_RIGHT_Y_AXIS_UP .whileHeld (new ClimberSetWinchesPower (1.0 ));
223
240
OPERATOR_PAD .OPERATOR_PAD_RIGHT_Y_AXIS_DOWN .whileHeld (new ClimberSetWinchesPower (-1.0 ));
224
241
225
242
// OPERATOR_PAD.OPERATOR_PAD_LEFT_Y_AXIS_UP.whenPressed(new
226
- // MagazineSetTurntable ());
227
- OPERATOR_PAD .OPERATOR_PAD_LEFT_Y_AXIS_DOWN .whileHeld (new ChimneySetChimney (-1.0 ));
243
+ // RevolverSetTurntable ());
244
+ OPERATOR_PAD .OPERATOR_PAD_LEFT_Y_AXIS_DOWN .whileHeld (new ChimneySet (-1.0 ));
228
245
}
229
246
230
247
/**
0 commit comments