Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit 6c05455

Browse files
committed
refactor: Improve robot container.
1 parent f9f4422 commit 6c05455

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

src/main/java/frc/robot/RobotContainer.java

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,43 @@
1717
import frc.robot.superstructure.SuperstructureState;
1818
import frc.robot.swerve.Swerve;
1919

20-
/** Initializes subsystems and commands. */
20+
/** Robot container. */
2121
public class RobotContainer {
2222

23-
/** Instance variable for the robot container singleton. */
23+
/** Robot container singleton. */
2424
public static RobotContainer instance = null;
2525

26+
/** Arm subsystem reference. */
2627
private final Arm arm;
28+
29+
/** Auto subsystem reference. */
2730
private final Auto auto;
31+
32+
/** Intake subsystem reference. */
2833
private final Intake intake;
34+
35+
/** Odometry subsystem reference. */
2936
private final Odometry odometry;
37+
38+
/** Shooter subsystem reference. */
3039
private final Shooter shooter;
40+
41+
/** Superstructure subsystem reference. */
3142
private final Superstructure superstructure;
43+
44+
/** Swerve subsystem reference. */
3245
private final Swerve swerve;
3346

34-
private final CommandXboxController driverController, operatorController;
47+
/** Driver controller. */
48+
private final CommandXboxController driverController;
49+
50+
/** Operator controller. */
51+
private final CommandXboxController operatorController;
3552

53+
/** Rumble controller. Use the same port as the operator controller to vibrate the operator controller. */
3654
private final XboxController rumbleController;
3755

38-
/** Creates a new instance of the robot container. */
56+
/** Initializes the robot container. */
3957
private RobotContainer() {
4058
arm = Arm.getInstance();
4159
auto = Auto.getInstance();
@@ -46,6 +64,7 @@ private RobotContainer() {
4664
swerve = Swerve.getInstance();
4765

4866
driverController = new CommandXboxController(0);
67+
4968
operatorController = new CommandXboxController(1);
5069
rumbleController = new XboxController(1);
5170

@@ -55,9 +74,9 @@ private RobotContainer() {
5574
}
5675

5776
/**
58-
* Gets the instance of the robot container.
77+
* Returns the robot container.
5978
*
60-
* @return the instance of the robot container.
79+
* @return the robot container.
6180
*/
6281
public static RobotContainer getInstance() {
6382
if (instance == null) {
@@ -101,6 +120,12 @@ private void configureBindings() {
101120
shooter.serializedNote().whileTrue(rumble(RumbleType.kRightRumble));
102121
}
103122

123+
/**
124+
* Rumbles the controller.
125+
*
126+
* @param side the side of the controller to rumble.
127+
* @return a command that rumbles the controller.
128+
*/
104129
public Command rumble(RumbleType side) {
105130
return Commands.startEnd(
106131
() -> rumbleController.setRumble(side, 1), () -> rumbleController.setRumble(side, 0));

0 commit comments

Comments
 (0)