@@ -76,6 +76,8 @@ public class RobotContainer {
76
76
private final ListenableSendableChooser <Command > driveCommandChooser =
77
77
new ListenableSendableChooser <>();
78
78
79
+ private final AtomicBoolean signalHumanPlayer = new AtomicBoolean (false );
80
+
79
81
public RobotContainer () {
80
82
configureDriverBindings ();
81
83
configureOperatorBindings ();
@@ -88,6 +90,30 @@ public RobotContainer() {
88
90
}
89
91
90
92
private void configureLEDs () {
93
+ // Default state for homing lights
94
+ ledSubsystem .setStatusLight (0 , Color .kRed );
95
+ ledSubsystem .setStatusLight (1 , Color .kRed );
96
+
97
+ // Set homing lights to state
98
+ new Trigger (slapdownSuperstructure .getSlapdownRotationSubsystem ()::isHomed ).onFalse (
99
+ Commands .runOnce (() -> {
100
+ ledSubsystem .setStatusLight (0 , Color .kRed );
101
+ }).ignoringDisable (true ).withName ("SlapdownLEDStatusFalse" )
102
+ ).onTrue (
103
+ Commands .runOnce (() -> {
104
+ ledSubsystem .setStatusLight (0 , Color .kGreen );
105
+ }).ignoringDisable (true ).withName ("SlapdownLEDStatusTrue" )
106
+ );
107
+ new Trigger (elevatorSubsystem ::isHomed ).onFalse (
108
+ Commands .runOnce (() -> {
109
+ ledSubsystem .setStatusLight (1 , Color .kRed );
110
+ }).ignoringDisable (true ).withName ("ElevatorLEDStatusFalse" )
111
+ ).onTrue (
112
+ Commands .runOnce (() -> {
113
+ ledSubsystem .setStatusLight (1 , Color .kGreen );
114
+ }).ignoringDisable (true ).withName ("ElevatorLEDStatusTrue" )
115
+ );
116
+
91
117
AtomicBoolean shouldBlink = new AtomicBoolean ();
92
118
new Trigger (transportSubsystem ::atSensor )
93
119
.onTrue (
@@ -98,16 +124,20 @@ private void configureLEDs() {
98
124
99
125
List <LEDState > ledStates =
100
126
List .of (
127
+ new LEDState (
128
+ signalHumanPlayer ::get ,
129
+ new AlternatePattern (0.5 , Color .kOrange , Color .kBlack )),
101
130
// Red blink if we have any faults
102
131
new LEDState (
103
132
() -> Alert .getDefaultGroup ().hasAnyErrors (),
104
133
new AlternatePattern (2.0 , Color .kRed , Color .kBlack )),
134
+ // Green if we can go under the stage
105
135
new LEDState (
106
136
shouldBlink ::get , new AlternatePattern (0.5 , Color .kAliceBlue , Color .kBlack )),
107
137
new LEDState (
108
138
() ->
109
139
DriverStation .isTeleopEnabled ()
110
- && elevatorSubsystem .atBottomLimit ()
140
+ && elevatorSubsystem .atBottom ()
111
141
&& wristSubsystem .atBottom (),
112
142
new SolidPattern (Color .kGreen )),
113
143
// Default disabled pattern
@@ -140,9 +170,14 @@ private void configureDriverBindings() {
140
170
.whileTrue (
141
171
Commands .parallel (
142
172
IntakingCommands .intakeUntilDetected (
143
- intakeSubsystem , slapdownSuperstructure , transportSubsystem )));
144
- driverController .rightTrigger ().onFalse (slapdownSuperstructure .setUpCommand ());
173
+ intakeSubsystem , slapdownSuperstructure , transportSubsystem ))).onFalse (
174
+ slapdownSuperstructure .setUpCommand ()
175
+ );
145
176
driverController .circle ().whileTrue (new LockModulesCommand (driveSubsystem ).repeatedly ());
177
+
178
+ driverController .a ().onTrue (Commands .runOnce (() -> signalHumanPlayer .set (true ))).onFalse (
179
+ Commands .sequence (Commands .waitSeconds (1.5 ), Commands .runOnce (() -> signalHumanPlayer .set (false )))
180
+ );
146
181
}
147
182
148
183
private void configureOperatorBindings () {
@@ -151,7 +186,7 @@ private void configureOperatorBindings() {
151
186
.onTrue (
152
187
Commands .parallel (
153
188
ScoringCommands .shootSetpointAmpCommand (shooterSubsystem ),
154
- transportSubsystem .setVoltageCommand (12 )));
189
+ transportSubsystem .setVoltageCommand (10 )));
155
190
operatorController
156
191
.triangle ()
157
192
.onTrue (
0 commit comments