3636import frc .robot .utils .led .SlidePattern ;
3737import frc .robot .utils .led .SolidPattern ;
3838import java .util .List ;
39+ import java .util .concurrent .atomic .AtomicBoolean ;
3940import java .util .function .DoubleSupplier ;
4041
4142/**
@@ -75,6 +76,8 @@ public class RobotContainer {
7576 private final ListenableSendableChooser <Command > driveCommandChooser =
7677 new ListenableSendableChooser <>();
7778
79+ private final AtomicBoolean signalHumanPlayer = new AtomicBoolean (false );
80+
7881 public RobotContainer () {
7982 configureDriverBindings ();
8083 configureOperatorBindings ();
@@ -87,16 +90,44 @@ public RobotContainer() {
8790 }
8891
8992 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+
90117 List <LEDState > ledStates =
91118 List .of (
119+ new LEDState (
120+ signalHumanPlayer ::get ,
121+ new AlternatePattern (0.5 , Color .kOrange , Color .kBlack )),
92122 // Red blink if we have any faults
93123 new LEDState (
94124 () -> Alert .getDefaultGroup ().hasAnyErrors (),
95125 new AlternatePattern (2.0 , Color .kRed , Color .kBlack )),
126+ // Green if we can go under the stage
96127 new LEDState (
97128 () ->
98129 DriverStation .isTeleopEnabled ()
99- && elevatorSubsystem .atBottomLimit ()
130+ && elevatorSubsystem .atBottom ()
100131 && wristSubsystem .atBottom (),
101132 new SolidPattern (Color .kGreen )),
102133 // Default disabled pattern
@@ -129,9 +160,14 @@ private void configureDriverBindings() {
129160 .whileTrue (
130161 Commands .parallel (
131162 IntakingCommands .intakeUntilDetected (
132- intakeSubsystem , slapdownSuperstructure , transportSubsystem )));
133- driverController .rightTrigger ().onFalse (slapdownSuperstructure .setUpCommand ());
163+ intakeSubsystem , slapdownSuperstructure , transportSubsystem ))).onFalse (
164+ slapdownSuperstructure .setUpCommand ()
165+ );
134166 driverController .circle ().whileTrue (new LockModulesCommand (driveSubsystem ).repeatedly ());
167+
168+ driverController .a ().onTrue (Commands .runOnce (() -> signalHumanPlayer .set (true ))).onFalse (
169+ Commands .sequence (Commands .waitSeconds (1.5 ), Commands .runOnce (() -> signalHumanPlayer .set (false )))
170+ );
135171 }
136172
137173 private void configureOperatorBindings () {
@@ -140,7 +176,7 @@ private void configureOperatorBindings() {
140176 .onTrue (
141177 Commands .parallel (
142178 ScoringCommands .shootSetpointAmpCommand (shooterSubsystem ),
143- transportSubsystem .setVoltageCommand (12 )));
179+ transportSubsystem .setVoltageCommand (10 )));
144180 operatorController
145181 .triangle ()
146182 .onTrue (
0 commit comments