@@ -37,6 +37,7 @@ public class RobotContainer {
3737 true ,
3838 drivetrain );
3939 private int lastButtonPressed ;
40+ // slows down robot durring pickup
4041 private Command pickup =
4142 coral
4243 .pickUpCoral ()
@@ -46,6 +47,7 @@ public class RobotContainer {
4647 speedMultiplier = 1.0 ;
4748 fieldRelative = true ;
4849 }));
50+ // changes speed when picking up from source
4951 private Command pickupSource =
5052 coral .pickUpCoralSource ().andThen (Commands .runOnce (() -> speedMultiplier = 1.0 ));
5153 private Command safeState = coral .safeState ();
@@ -56,6 +58,7 @@ public class RobotContainer {
5658 private Field2d selectedSpot = new Field2d ();
5759
5860 public RobotContainer () {
61+ // how we selected where we were going to score
5962 DataLogManager .start ();
6063 configureBindings ();
6164 SmartDashboard .putData ("scheduler" , CommandScheduler .getInstance ());
@@ -73,6 +76,7 @@ public RobotContainer() {
7376 SmartDashboard .putData ("Selected Score Locationn" , selectedSpot );
7477 }
7578
79+ // all controller bindings
7680 private void configureBindings () {
7781 CommandScheduler .getInstance ()
7882 .schedule (
@@ -85,6 +89,7 @@ private void configureBindings() {
8589 }
8690 })
8791 .ignoringDisable (true ));
92+ // coral pickup
8893 controller
8994 .a ()
9095 .onTrue (
@@ -101,6 +106,7 @@ private void configureBindings() {
101106 fieldRelative = false ;
102107 }
103108 }));
109+ // cancel coral pickup
104110 controller
105111 .b ()
106112 .onTrue (
@@ -116,6 +122,7 @@ private void configureBindings() {
116122 speedMultiplier = 0.4 ;
117123 }
118124 }));
125+ // enabling the safe state
119126 controller
120127 .x ()
121128 .onTrue (
@@ -129,6 +136,7 @@ private void configureBindings() {
129136 }
130137 }));
131138
139+ // picking up algae
132140 controller
133141 .rightTrigger ()
134142 .onTrue (
@@ -137,8 +145,10 @@ private void configureBindings() {
137145 .until (() -> !controller .rightTrigger ().getAsBoolean ())
138146 .andThen (algae .storeAlgae ()));
139147
148+ // releasing the algae
140149 controller .y ().onTrue (algae .releaseAlgae ().andThen (algae .returnToUp ()));
141150
151+ // scoring on all levels
142152 totalController
143153 .button (15 )
144154 .whileTrue (
@@ -192,9 +202,11 @@ private void configureBindings() {
192202 }
193203 }));
194204
205+ // clearing algae off reef
195206 totalController .button (14 ).onTrue (coral .l1ReefClear (controller .leftTrigger ()));
196207 totalController .button (13 ).onTrue (coral .l2ReefClear (controller .leftTrigger ()));
197208
209+ // driving the robot
198210 drivetrain .setDefaultCommand (
199211 Commands .run (
200212 () ->
@@ -206,6 +218,7 @@ private void configureBindings() {
206218 true ),
207219 drivetrain ));
208220
221+ // deploy climber, releases algae too
209222 controller .povUp ().whileTrue (climb .pivotClimb ());
210223 controller
211224 .povDown ()
@@ -217,14 +230,17 @@ private void configureBindings() {
217230 controller .povRight ().onTrue (Commands .runOnce (() -> autoDisabled = true ));
218231 }
219232
233+ // deadbands for driving
220234 private double applyDeadband (double value ) {
221235 return MathUtil .applyDeadband (value , ControllerConfig .DEADBAND );
222236 }
223237
238+ // sets the pose for auto-align
224239 public void periodic () {
225240 selectedSpot .setRobotPose (Positions .getIndividualReef (lastButtonPressed ));
226241 }
227242
243+ // autonomous command
228244 public Command getAutonomousCommand () {
229245 return Commands .sequence (
230246 Commands .waitSeconds (2 ), coral .goToReef (drivetrain , () -> lastButtonPressed , () -> 3 ));
0 commit comments