@@ -74,15 +74,16 @@ private void configureButtonBindings() {
74
74
.onTrue (
75
75
setDriveSpeed (DriveConstants .MAX_TELEOP_SPEED_METERS_PER_SECOND ));
76
76
77
- Make a trigger so then when the current GAME_MODE
77
+ ( DONE ) Make a trigger so then when the current GAME_MODE
78
78
is equal to AUTONOMOUS then set the drive speed to MAX_SPEED_METERS_PER_SECOND
79
79
80
- Create a trigger like the one above so that
80
+ ( DONE ) Create a trigger like the one above so that
81
81
while the "a" button is been pressed ,
82
82
set the drive speed to ALIGNMENT_SPEED
83
83
and when the "a" button has not been pressed ,
84
84
set the drive speed to MAX_TELEOP_SPEED_METERS_PER_SECOND
85
85
86
+
86
87
driver .y ().or (driver .x ()).onTrue (
87
88
Commands .runOnce (() -> swerve .resetOdometry (
88
89
new Pose2d (
@@ -97,18 +98,44 @@ private void configureButtonBindings() {
97
98
swerve .getSetWheelsXCommand ()
98
99
);
99
100
100
- Create a trigger so while the leftBumper is pressed,
101
+ driver .a ().onTrue (
102
+ setDriveSpeed (ALIGNMENT_SPEED )
103
+ );
104
+
105
+ driver .a ().onFalse (
106
+ setDriveSpeed (MAX_TELEOP_SPEED_METERS_PER_SECOND )
107
+ );
108
+
109
+ driver .leftBumper ().onTrue (
110
+ swerve .getSetWheelsXCommand ()
111
+ );
112
+
113
+ driver .leftStick ().toggleOnTrue (
114
+ swerve .toggleSpeed ()
115
+ );
116
+
117
+ driver .leftStick ().onTrue (
118
+ claw .setSpeed (driver .getLeftTriggerAxis )
119
+ );
120
+
121
+ driver .rightStick .onTrue (
122
+ claw .setSpeed (driver .getRightTriggerAxis )
123
+ );
124
+
125
+ (DONE )Create a trigger so while the leftBumper is pressed ,
101
126
run the command in swerve , getSetWheelsX
102
127
103
- Create another trigger so
128
+ ( DONE ) Create another trigger so
104
129
the swerve runs the toggleSpeed command in swerve
105
130
when the leftStick toggles to true
106
131
hint (use the toggleOnTrue method )
132
+
107
133
108
- Create two triggers so while the left and right triggers are true,
134
+ ( Done ) Create two triggers so while the left and right triggers are true ,
109
135
set the desired claw speed
110
136
to their respective left and right trigger axies
111
137
138
+
112
139
}
113
140
114
141
private CommandBase setDriveSpeed (double desiredSpeedMetersPerSecond ) {
0 commit comments