-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobotContainer.java
More file actions
571 lines (499 loc) · 31 KB
/
RobotContainer.java
File metadata and controls
571 lines (499 loc) · 31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot;
import static frc.robot.subsystems.swervedrive.vision.estimation.PoseEstimator.visionMeasurementStdDevs2;
import java.io.File;
import choreo.auto.AutoFactory;
import choreo.auto.AutoRoutine;
import choreo.auto.AutoTrajectory;
import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.CommandJoystick;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.apriltags.ApriltagReading;
import frc.robot.commands.ResetAll;
import frc.robot.autochooser.AutoChooser;
import frc.robot.commands.AddApriltagReading;
import frc.robot.commands.AddGarbageReading;
import frc.robot.commands.AddTunableApriltagReading;
import frc.robot.commands.ShootButton;
import frc.robot.commands.angler.DefaultAnglerControl;
import frc.robot.commands.angler.RunAnglerToReverseLimit;
import frc.robot.commands.climber.ClimberDown;
import frc.robot.commands.climber.ClimberUp;
import frc.robot.commands.drive.DriveDirectionTime;
import frc.robot.commands.drive.DriveSwerve;
import frc.robot.commands.drive.FakeVision;
import frc.robot.commands.feeder.DefaultSpinFeeder;
import frc.robot.commands.feeder.SpinFeeder;
import frc.robot.commands.hopper.DefaultSpinHopper;
import frc.robot.commands.hopper.SpinHopper;
import frc.robot.commands.intake.SpinIntake;
import frc.robot.commands.intake.StopIntake;
import frc.robot.commands.intakeDeployment.SetDeploymentState;
import frc.robot.commands.intakeDeployment.ToggleDeployment;
import frc.robot.commands.parallels.RunHopperAndFeeder;
import frc.robot.commands.shooter.DefaultShooterControl;
import frc.robot.commands.shooter.SetShootingState;
import frc.robot.commands.shooter.SpinShooter;
import frc.robot.commands.testing.RunDashboardShotTest;
import frc.robot.commands.turret.DefaultTurretControl;
import frc.robot.commands.turret.RunTurretToFwdLimit;
import frc.robot.commands.turret.RunTurretToRevLimit;
import frc.robot.commands.turret.SetTurretAngle;
import frc.robot.commands.turret.TestSetTurretAngle;
import frc.robot.constants.Constants;
import frc.robot.constants.enums.DeploymentState;
import frc.robot.constants.enums.DriveDirection;
import frc.robot.constants.enums.ShootingState;
import frc.robot.constants.enums.ShootingState.ShootState;
import frc.robot.subsystems.AnglerSubsystem;
import frc.robot.subsystems.ApriltagSubsystem;
import frc.robot.subsystems.CameraThread;
import frc.robot.subsystems.ClimberSubsystem;
import frc.robot.subsystems.ControllerSubsystem;
import frc.robot.subsystems.FeederSubsystem;
import frc.robot.subsystems.GyroSubsystem;
import frc.robot.subsystems.HopperSubsystem;
import frc.robot.subsystems.IntakeDeployerSubsystem;
import frc.robot.subsystems.IntakeSubsystem;
import frc.robot.subsystems.LightStripSubsystem;
import frc.robot.subsystems.ShooterSubsystem;
import frc.robot.subsystems.TurretSubsystem;
//import frc.robot.subsystems.RollerSubsystem;
//import frc.robot.subsystems.TiltSubsystem;
import frc.robot.subsystems.swervedrive.SwerveSubsystem;
import frc.robot.subsystems.swervedrive.vision.truster.ConstantVisionTruster;
import frc.robot.subsystems.swervedrive.vision.truster.VisionTruster;
import frc.robot.utils.logging.io.gyro.RealGyroIo;
import frc.robot.utils.logging.io.gyro.ThreadedGyro;
import frc.robot.utils.logging.io.gyro.ThreadedGyroSwerveIMU;
import frc.robot.utils.simulation.RobotVisualizer;
import swervelib.SwerveInputStream;
import swervelib.imu.SwerveIMU;
/**
* This class is where the bulk of the robot should be declared. Since
* Command-based is a
* "declarative" paradigm, very little robot logic should actually be handled in
* the {@link Robot}
* periodic methods (other than the scheduler calls). Instead, the structure of
* the robot (including
* subsystems, commands, and trigger mappings) should be declared here.
*/
public class RobotContainer {
private static final String DRIVER_CAM_PREFIX = CameraThread.LOGGING_PREFIX;
private static final String DRIVER_CAM_SERVER_NAME = "serve_" + DRIVER_CAM_PREFIX;
private static final int DRIVER_CAM_PORT = 1182;
private static final int DRIVER_CAM_FPS = 30;
// Instantiate the autochooser.
private final AutoChooser autoChooser;
// The robot's subsystems and commands are defined here...
private final CommandXboxController controller =
new CommandXboxController(Constants.XBOX_CONTROLLER_PORT);
private final ClimberSubsystem climberSubsystem;
private final AnglerSubsystem anglerSubsystem;
private final IntakeSubsystem intakeSubsystem;
private final FeederSubsystem feederSubsystem;
private final ApriltagSubsystem apriltagSubsystem;
private final ShooterSubsystem shooterSubsystem;
private final ControllerSubsystem controllerSubsystem;
private RobotVisualizer robotVisualizer = null;
private final HopperSubsystem hopperSubsystem;
private final LightStripSubsystem lightStripSubsystem;
private final TurretSubsystem turretSubsystem;
private final IntakeDeployerSubsystem intakeDeployer;
private SwerveSubsystem drivebase = null;
private GyroSubsystem gyroSubsystem = null;
private final CommandJoystick driveJoystick = new CommandJoystick(Constants.DRIVE_JOYSTICK_PORT);
private final CommandJoystick steerJoystick = new CommandJoystick(Constants.STEER_JOYSTICK_PORT);
private ShootingState shootState = new ShootingState(ShootState.STOPPED);
private Drive drive;
private AutoFactory autoFactory;
private static AutoRoutine straightRoutine;
private static AutoTrajectory straightTrajectory;
private final VisionTruster truster = new ConstantVisionTruster(visionMeasurementStdDevs2);
// Replace with CommandPS4Controller or CommandJoystick if needed
// new CommandXboxController(OperatorConstants.kDriverControllerPort);private
// final CommandXboxController controller = new
// CommandXboxController(Constants.XBOX_CONTROLLER_PORT);
/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
public RobotContainer() {
// Configure the trigger bindings
switch (Constants.currentMode) {
case REAL -> {
anglerSubsystem = new AnglerSubsystem(AnglerSubsystem.createRealIo());
intakeSubsystem = new IntakeSubsystem(IntakeSubsystem.createRealIo());
hopperSubsystem = new HopperSubsystem(HopperSubsystem.createRealIo());
intakeDeployer = new IntakeDeployerSubsystem(IntakeDeployerSubsystem.createRealIo());
turretSubsystem = new TurretSubsystem(TurretSubsystem.createRealIo());
climberSubsystem = new ClimberSubsystem(ClimberSubsystem.createRealIo());
feederSubsystem = new FeederSubsystem(FeederSubsystem.createRealIo());
shooterSubsystem = new ShooterSubsystem(ShooterSubsystem.createRealIo());
RealGyroIo gyroIo = (RealGyroIo) GyroSubsystem.createRealIo();
ThreadedGyro threadedGyro = gyroIo.getThreadedGyro();
gyroSubsystem = new GyroSubsystem(gyroIo);
SwerveIMU swerveIMU = new ThreadedGyroSwerveIMU(threadedGyro);
drivebase = !Constants.TESTBED ? new SwerveSubsystem(
new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.SWERVE_JSON_DIRECTORY), swerveIMU) : null;
apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createRealIo(), drivebase, truster) : null;
controllerSubsystem = !Constants.TESTBED ? new ControllerSubsystem(drivebase, this) : null;
lightStripSubsystem = new LightStripSubsystem(drivebase, shootState, intakeSubsystem::getIntakeStalled);
}
case REPLAY -> {
anglerSubsystem = new AnglerSubsystem(AnglerSubsystem.createMockIo());
intakeSubsystem = new IntakeSubsystem(IntakeSubsystem.createMockIo());
hopperSubsystem = new HopperSubsystem(HopperSubsystem.createMockIo());
climberSubsystem = new ClimberSubsystem(ClimberSubsystem.createMockIo());
feederSubsystem = new FeederSubsystem(FeederSubsystem.createMockIo());
turretSubsystem = new TurretSubsystem(TurretSubsystem.createMockIo());
shooterSubsystem = new ShooterSubsystem(ShooterSubsystem.createMockIo());
intakeDeployer = new IntakeDeployerSubsystem(IntakeDeployerSubsystem.createMockIo());
// No GyroSubsystem in REPLAY for now
// create the drive subsystem with null gyro (use default json)
drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.SWERVE_JSON_DIRECTORY), null) : null;
apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createMockIo(), drivebase, truster) : null;
controllerSubsystem = !Constants.TESTBED ? new ControllerSubsystem(drivebase, this) : null;
lightStripSubsystem = new LightStripSubsystem(drivebase, shootState, intakeSubsystem::getIntakeStalled);
}
case SIM -> {
robotVisualizer = new RobotVisualizer();
anglerSubsystem = new AnglerSubsystem(AnglerSubsystem.createSimIo(robotVisualizer));
intakeSubsystem = new IntakeSubsystem(IntakeSubsystem.createSimIo(robotVisualizer));
hopperSubsystem = new HopperSubsystem(HopperSubsystem.createSimIo(robotVisualizer));
climberSubsystem = new ClimberSubsystem(ClimberSubsystem.createSimIo(robotVisualizer));
feederSubsystem = new FeederSubsystem(FeederSubsystem.createSimIo(robotVisualizer));
turretSubsystem = new TurretSubsystem(TurretSubsystem.createSimIo(robotVisualizer));
shooterSubsystem = new ShooterSubsystem(ShooterSubsystem.createSimIo(robotVisualizer));
intakeDeployer = new IntakeDeployerSubsystem(
IntakeDeployerSubsystem.createSimIo(robotVisualizer));// No GyroSubsystem in REPLAY for now
// create the drive subsystem with null gyro (use default json)
drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.SWERVE_JSON_DIRECTORY), null) : null;
controllerSubsystem = !Constants.TESTBED ? new ControllerSubsystem(drivebase, this) : null;
apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createSimIo(truster,drivebase), drivebase, truster) : null;
lightStripSubsystem = new LightStripSubsystem(drivebase, shootState, intakeSubsystem::getIntakeStalled);
}
default -> {
throw new RuntimeException("Did not specify Robot Mode");
}
}
setUpAutoFactory();
autoChooser = new AutoChooser(drivebase, shootState, autoFactory, shooterSubsystem, climberSubsystem, feederSubsystem, hopperSubsystem, turretSubsystem, anglerSubsystem, controllerSubsystem);
configureBindings();
putShuffleboardCommands();
}
/**
* Use this method to define your trigger->command mappings. Triggers can be
* created via the
* {@link Trigger#Trigger(java.util.function.BooleanSupplier)} constructor with
* an arbitrary
* predicate, or via the named factories in {@link
* edu.wpi.first.wpilibj2.command.button.CommandGenericHID}'s subclasses for
* {@link
* CommandXboxController
* Xbox}/{@link edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
* PS4} controllers or
* {@link edu.wpi.first.wpilibj2.command.button.CommandJoystick Flight
* joysticks}.
*/
private void setUpAutoFactory() {
if(!Constants.TESTBED){
drive = new Drive(drivebase);
// Sets up Choreo with pose, odometry, drivebase, and a follow trajectory
// command
autoFactory = new AutoFactory(drivebase::getPose,
drivebase::resetOdometry,
drive::followTrajectory,
true,
drivebase);
// example implementation of autoRoutine
if (false) {
// Uses autofactory to create a new routine
straightRoutine = autoFactory.newRoutine("StraightRoutine");
/*
* Loads a trajectory created in Choreo given the name
* Can load multiple trajectories from the same routine
*
* i.e.
* AutoRoutine routine = autoFactory.newRoutine("grabAndScore");
* AutoTrajectory grabTraj = routine.trajectory("grabPiece");
* AutoTrajectory scoreTraj = routine.trajectory("scorePiece");
*/
straightTrajectory = straightRoutine.trajectory("StraightPath");
/*
* .active() is a trigger that becomes true when the routine is running
* .onTrue() starts a command when the trigger becomes true (i.e. when the
* routine starts)
*
* Use commands.sequence() to sequence multiple commands (i.e. reset odometry,
* then follow trajectory)
*/
straightRoutine.active().onTrue(
straightTrajectory.resetOdometry()
.andThen(straightTrajectory.cmd()));
/*
* -----------------------------------------------------------------------------
* -------------------
* Trajectory Triggers (read more on docs page
* https://choreo.autos/choreolib/auto-factory/):
* -----------------------------------------------------------------------------
* -------------------
*
* trajectory.atTime(String)
* trajectory.atTime(double time)
* trajectory.done()
* trajectory.active()
* trajectory.inactive()
* trajectory.atPose(String, double, double)
* trajectory.atPose(Pose2d, double, double)
* trajectory.doneDelayed(int)
* trajectory.doneFor(int)
* trajectory.recentlyDone()
*/
}}
}
private void configureBindings() {
controller.a().onTrue(new ToggleDeployment(intakeDeployer));
controller.b().onTrue(new SetDeploymentState(intakeDeployer, DeploymentState.STOPPED));
controller.y().onTrue(new ClimberUp(climberSubsystem));
controller.x().onTrue(new ClimberDown(climberSubsystem));
controller.povUp().onTrue(new SetShootingState(shootState, ShootState.FIXED));
controller.povRight().onTrue(new SetShootingState(shootState, ShootState.STOPPED));
controller.povDown().onTrue(new SetShootingState(shootState, ShootState.SHOOTING_HUB));
controller.povLeft().onTrue(new SetShootingState(shootState, ShootState.SHUTTLING));
controller.leftTrigger().onTrue((new ResetAll(anglerSubsystem, climberSubsystem,
intakeDeployer, intakeSubsystem, shooterSubsystem, turretSubsystem, shootState)));
driveJoystick.trigger().whileTrue((new SetShootingState(shootState, ShootState.STOPPED)));
if (controllerSubsystem != null) {
steerJoystick.trigger().whileTrue(new ShootButton(controllerSubsystem));
}
// Schedule `ExampleCommand` when `exampleCondition` changes to `true`
// new Trigger(m_exampleSubsystem::exampleCondition)
// .onTrue(new ExampleCommand(m_exampleSubsystem));
// Schedule `exampleMethodCommand` when the Xbox controller's B button is
// pressed,
// cancelling on release.
// m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand());
intakeSubsystem.setDefaultCommand(new SpinIntake(intakeSubsystem, intakeDeployer));
if (controllerSubsystem != null) {
anglerSubsystem.setDefaultCommand(new DefaultAnglerControl(anglerSubsystem, controllerSubsystem));
shooterSubsystem.setDefaultCommand(new DefaultShooterControl(shooterSubsystem, controllerSubsystem));
turretSubsystem.setDefaultCommand(new DefaultTurretControl(turretSubsystem, controllerSubsystem));
hopperSubsystem.setDefaultCommand(new DefaultSpinHopper(hopperSubsystem, controllerSubsystem));
feederSubsystem.setDefaultCommand(new DefaultSpinFeeder(feederSubsystem, controllerSubsystem));
}
if (!Constants.TESTBED) {
SwerveInputStream driveAngularVelocity = SwerveInputStream.of(drivebase.getSwerveDrive(),
() -> driveJoystick.getY() * -1,
() -> driveJoystick.getX() * -1)
.withControllerRotationAxis(() -> {return steerJoystick.getX() * -1;})
.deadband(Constants.DEADBAND)
.scaleTranslation(0.8)
.allianceRelativeControl(true);
Command driveFieldOrientedAnglularVelocity = drivebase.driveFieldOriented(driveAngularVelocity);
drivebase.setDefaultCommand(driveFieldOrientedAnglularVelocity);
}
}
public void putShuffleboardCommands() {
if (Constants.DEBUG) {
/*
* SmartDashboard.putData(
* "Spin Roller",
* new SpinRoller(rollerSubsystem));
*
* SmartDashboard.putData(
* "Tilt Up",
* new TiltUp(tiltSubsystem));
*
* SmartDashboard.putData(
* "Tilt Down",
* new TiltDown(tiltSubsystem));
*/
// TODO: These commands do not REQUIRE the subsystem therefore cannot be used in// production
SmartDashboard.putData(
"Drive/Forward",
new DriveSwerve(drivebase, DriveDirection.FORWARD, 0.5, 0.2));
SmartDashboard.putData(
"Drive/Backward",
new DriveSwerve(drivebase, DriveDirection.BACKWARD, 0.5, 0.2));
SmartDashboard.putData(
"Drive/Left",
new DriveSwerve(drivebase, DriveDirection.LEFT, 0.5, 0.2));
SmartDashboard.putData(
"Drive/Right",
new DriveSwerve(drivebase, DriveDirection.RIGHT, 0.5, 0.2));
SmartDashboard.putData(
"Intake/Spin Forward",
new InstantCommand(() -> intakeSubsystem.setSpeed(1.0)));
SmartDashboard.putData(
"Intake/Spin Backward",
new InstantCommand(() -> intakeSubsystem.setSpeed(-1.0)));
SmartDashboard.putData(
"Intake/Stop",
new InstantCommand(intakeSubsystem::stopMotors));
SmartDashboard.putNumber(RunDashboardShotTest.ANGLER_TARGET_POSITION_KEY, 0.0);
SmartDashboard.putNumber(RunDashboardShotTest.TURRET_TARGET_POSITION_KEY, Constants.TURRET_HOME_ANGLE);
SmartDashboard.putNumber(RunDashboardShotTest.SHOOTER_TARGET_RPM_KEY, Constants.SHOOTER_SPEED);
SmartDashboard.putNumber("Target Angle",0);
SmartDashboard.putData("RunHoppperAndFeeder",
new RunHopperAndFeeder(hopperSubsystem, feederSubsystem));
SmartDashboard.putData("RunTurret",
new TestSetTurretAngle(turretSubsystem));
SmartDashboard.putData(
"test/Run Dashboard Shot Test (30s)",
new RunDashboardShotTest(anglerSubsystem, turretSubsystem, shooterSubsystem));
SmartDashboard.putData(
"angler/Go Home",
new InstantCommand(() -> anglerSubsystem
.setPosition(Constants.ANGLER_HOME_ROTATIONS)));
SmartDashboard.putData(
"angler/Go Low",
new InstantCommand(() -> anglerSubsystem
.setPosition(Constants.ANGLER_ENCODER_LOW)));
SmartDashboard.putData(
"angler/Go High",
new InstantCommand(() -> anglerSubsystem
.setPosition(Constants.ANGLER_ENCODER_HIGH)));
SmartDashboard.putData(
"angler/Run To Fwd Limit",
new RunCommand(anglerSubsystem::runForward, anglerSubsystem)
.until(anglerSubsystem::isAtForwardLimit));
SmartDashboard.putData(
"angler/Run To Rev Limit",
new RunCommand(anglerSubsystem::runReverse, anglerSubsystem)
.until(anglerSubsystem::isAtReverseLimit));
SmartDashboard.putData(
"angler/Reset Encoder",
new InstantCommand(anglerSubsystem::resetEncoderToZero));
SmartDashboard.putData(
"angler/Home Rev (Reset)",
new RunAnglerToReverseLimit(anglerSubsystem));
SmartDashboard.putData(
"reset All",
new ResetAll(anglerSubsystem, climberSubsystem, intakeDeployer, intakeSubsystem,
shooterSubsystem, turretSubsystem, shootState));
SmartDashboard.putData(
"turret/TurretTest/Turret Go 45",
new SetTurretAngle(turretSubsystem, 45));
SmartDashboard.putData(
"turret/TurretTest/Turret Go 0",
new SetTurretAngle(turretSubsystem, 0));
SmartDashboard.putData(
"turret/TurretTest/Turret Go -45",
new SetTurretAngle(turretSubsystem, -45));
SmartDashboard.putData(
"turret/TurretTest/Turret Go 40",
new SetTurretAngle(turretSubsystem, 40));
SmartDashboard.putData(
"turret/TurretTest/Turret Go -40",
new SetTurretAngle(turretSubsystem, -40));
SmartDashboard.putData(
"turret/TurretTest/Turret Go 35",
new SetTurretAngle(turretSubsystem, 35));
SmartDashboard.putData(
"turret/TurretTest/Turret Go -35",
new SetTurretAngle(turretSubsystem, -35));
SmartDashboard.putData(
"turret/Run Turret to Rev Limit",
new RunTurretToRevLimit(turretSubsystem));
SmartDashboard.putData(
"turret/Run Turret to Fwd Limit",
new RunTurretToFwdLimit(turretSubsystem));
SmartDashboard.putData(
"intakedeployer/InitlizeDeployer",
new ToggleDeployment(intakeDeployer));
SmartDashboard.putData(
"Spin Intake",
new SpinIntake(intakeSubsystem, intakeDeployer));
SmartDashboard.putData(
"Stop Intake",
new StopIntake(intakeSubsystem));
SmartDashboard.putData(
"Start Hopper",
new SpinHopper(hopperSubsystem));
SmartDashboard.putData(
"Climber Up",
new ClimberUp(climberSubsystem));
SmartDashboard.putData(
"Climber Down",
new ClimberDown(climberSubsystem));
SmartDashboard.putData(
"Spin Feeder",
new SpinFeeder(feederSubsystem));
SmartDashboard.putData(
"Spins Shooter",
new SpinShooter(shooterSubsystem, Constants.SHOOTER_SPEED));
SmartDashboard.putData(
"Shooting State: Stopped",
new SetShootingState(shootState, ShootState.STOPPED));
SmartDashboard.putData(
"Shooting State: Fixed",
new SetShootingState(shootState, ShootState.FIXED));
SmartDashboard.putData(
"Shooting State: Fixed 2",
new SetShootingState(shootState, ShootState.FIXED_2));
SmartDashboard.putData(
"Shooting State: Into Hub",
new SetShootingState(shootState, ShootState.SHOOTING_HUB));
SmartDashboard.putData(
"Shooting State: Shuttling",
new SetShootingState(shootState, ShootState.SHUTTLING));
SmartDashboard.putData(
"intakedeployer/Deployment State: UP",
new SetDeploymentState(intakeDeployer, DeploymentState.UP));
SmartDashboard.putData(
"intakedeployer/Deployment State: DOWN",
new SetDeploymentState(intakeDeployer, DeploymentState.DOWN));
SmartDashboard.putData(
"intakedeployer/Deployment State: STOPPED",
new SetDeploymentState(intakeDeployer, DeploymentState.STOPPED));
}
//basic drive command
if (!Constants.TESTBED) {
Command driveDirectionTime = new DriveDirectionTime(drivebase, 0.1, 0.1, true, 1);
SmartDashboard.putData("Drive Command", driveDirectionTime);
SmartDashboard.putData("Fake vision near trench", new FakeVision(drivebase, 4, 1));
SmartDashboard.putData("Fake vision away from trench", new FakeVision(drivebase, 1, 1));
SmartDashboard.putData("AddApriltagReading", new AddApriltagReading(apriltagSubsystem, new ApriltagReading(0, 0, 0, 0, 0, 0, 0, 0, 0)));
SmartDashboard.putData("AddGarbageReading", new AddGarbageReading(apriltagSubsystem));
SmartDashboard.putData("AddTunedApriltagReading", new AddTunableApriltagReading(apriltagSubsystem));
}
}
/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
public Command getAutonomousCommand() {
return autoChooser.getSelectedCommand();
// return straightRoutine.cmd(straightTrajectory.done());
// return new ExampleAuto(drivebase, autoFactory);
}
public ClimberSubsystem getClimberSubsystem() {
return climberSubsystem;
}
public RobotVisualizer getRobotVisualizer() {
return robotVisualizer;
}
public AutoChooser getAutoChooser() {
return autoChooser;
}
public IntakeSubsystem getIntakeSubsystem() {
return intakeSubsystem;
}
public SwerveSubsystem getDriveBase() {
return drivebase;
}
public ShootingState getShootingState() {
return shootState;
}
public IntakeDeployerSubsystem getDeployer(){
return intakeDeployer;
}
}