Skip to content

Commit e258157

Browse files
authored
Merge pull request #3 from team5675/GVSULeds
Gvsu leds
2 parents 8712c67 + c7022e6 commit e258157

36 files changed

+3183
-66
lines changed

src/main/deploy/pathplanner/autos/LB 3 Coral.auto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@
168168
]
169169
}
170170
},
171+
{
172+
"type": "wait",
173+
"data": {
174+
"waitTime": 0.25
175+
}
176+
},
171177
{
172178
"type": "parallel",
173179
"data": {

src/main/deploy/pathplanner/autos/RB 3 Coral.auto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@
168168
]
169169
}
170170
},
171+
{
172+
"type": "wait",
173+
"data": {
174+
"waitTime": 0.25
175+
}
176+
},
171177
{
172178
"type": "parallel",
173179
"data": {

src/main/java/frc/robot/Robot.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import edu.wpi.first.cameraserver.CameraServer;
1111
import edu.wpi.first.wpilibj.DataLogManager;
1212
import edu.wpi.first.wpilibj.TimedRobot;
13+
import edu.wpi.first.wpilibj.Timer;
14+
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
1315
import edu.wpi.first.wpilibj2.command.Command;
1416
import edu.wpi.first.wpilibj2.command.CommandScheduler;
1517

@@ -20,7 +22,7 @@ public class Robot extends TimedRobot {
2022

2123
public Robot() {
2224
m_robotContainer = new RobotContainer();
23-
CameraServer.startAutomaticCapture();
25+
// CameraServer.startAutomaticCapture();
2426
PathfindingCommand.warmupCommand().schedule();
2527

2628
//SignalLogger.start();
@@ -35,10 +37,13 @@ public Robot() {
3537
@Override
3638
public void robotPeriodic() {
3739
CommandScheduler.getInstance().run();
40+
SmartDashboard.putNumber("Game Timer", Timer.getFPGATimestamp());
3841
}
3942

4043
@Override
41-
public void disabledInit() {}
44+
public void disabledInit() {
45+
46+
}
4247

4348
@Override
4449
public void disabledPeriodic() {}
@@ -53,13 +58,17 @@ public void autonomousInit() {
5358
if (m_autonomousCommand != null) {
5459
m_autonomousCommand.schedule();
5560
}
61+
62+
5663
}
5764

5865
@Override
5966
public void autonomousPeriodic() {}
6067

6168
@Override
62-
public void autonomousExit() {}
69+
public void autonomousExit() {
70+
71+
}
6372

6473
@Override
6574
public void teleopInit() {

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// Copyright (c) FIRST and other WPILib contributors.
2-
// Open Source Software; you can modify and/or share it under the terms of
3-
// the WPILib BSD license file in the root directory of this project.
4-
51
package frc.robot;
62

73
import static edu.wpi.first.units.Units.*;
@@ -21,6 +17,9 @@
2117
import frc.robot.subsystems.Algae.AlgaeInCommand;
2218
import frc.robot.subsystems.Algae.AlgaeOutCommand;
2319
import frc.robot.subsystems.Elevator.RunElevatorCommand;
20+
import frc.robot.subsystems.LED.LEDStateManager;
21+
import frc.robot.subsystems.LED.SetLEDAnimationCommand;
22+
import frc.robot.subsystems.LED.CustomAnimations.RainbowShootingLines;
2423
import frc.robot.subsystems.Climber.SetClimbCommand;
2524
import frc.robot.subsystems.Coral.Coral;
2625
import frc.robot.subsystems.Coral.IntakeCommand;
@@ -91,6 +90,7 @@ public static CommandXboxController getDriverController() {
9190
public Command pathfindingCommand;
9291

9392
public RobotContainer() {
93+
// LEDStateManager.getInstance().setDefault();
9494

9595
NamedCommands.registerCommand("IntakeCommand", new AutoIntakeCommand());
9696
NamedCommands.registerCommand("PlaceCommand", new PlaceCommand());
@@ -197,6 +197,20 @@ private void configureBindings() {
197197
level4.onTrue(new RunElevatorCommand(ElevatorLevel.L4_HEIGHT));
198198
ElevatorReset.onTrue(new RunElevatorCommand(ElevatorLevel.RESET_HEIGHT));
199199

200+
// getDriverController().a().onTrue(new SetLEDAnimationCommand(
201+
// new RainbowShootingLines(
202+
// RainbowShootingLines.RainbowType.PASTEL_RAINBOW,
203+
// RainbowShootingLines.ColorDistribution.PER_LINE,
204+
// RainbowShootingLines.DirectionType.FORWARD,
205+
// 10,
206+
// 0,
207+
// 0,
208+
// 1,
209+
// 0,
210+
// true
211+
// )
212+
// ));
213+
200214
drivetrain.registerTelemetry(logger::telemeterize);
201215
}
202216

src/main/java/frc/robot/subsystems/Algae/Algae.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void setAxisPosition(double position) {
116116

117117
//spins the wheels based on input speed
118118
public void setFlywheelSpeed(double speed) {
119-
System.out.println("Spinning Wheel!");
119+
// System.out.println("Spinning Wheel!");
120120
wheelsMotor.set(speed);
121121
}
122122

src/main/java/frc/robot/subsystems/Algae/AlgaeInCommand.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
package frc.robot.subsystems.Algae;
66

7+
import edu.wpi.first.wpilibj.util.Color;
78
import edu.wpi.first.wpilibj2.command.Command;
9+
import frc.robot.subsystems.LED.RGB;
10+
import frc.robot.subsystems.LED.SetLEDAnimationCommand;
11+
import frc.robot.subsystems.LED.CustomAnimations.Pulse;
12+
import frc.robot.subsystems.LED.CustomAnimations.SolidColor;
813

914
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
1015
public class AlgaeInCommand extends Command {
@@ -21,12 +26,20 @@ public AlgaeInCommand() {
2126
// Called when the command is initially scheduled.
2227
@Override
2328
public void initialize() {
29+
new SetLEDAnimationCommand(
30+
new Pulse(
31+
new RGB(Color.kSeaGreen),
32+
0.5,
33+
1,
34+
0.2
35+
)
36+
).schedule();
2437
}
2538

2639
// Called every time the scheduler runs while the command is scheduled.
2740
@Override
2841
public void execute() {
29-
System.out.println("Algae in");
42+
// System.out.println("Algae in");
3043
algae.setIntake(true);
3144
if (-algae.axisTicks.getPosition() < AlgaeConstants.AxisOutTicks) {
3245
algae.setAxisPosition(AlgaeConstants.AxisOutTicks);
@@ -43,6 +56,12 @@ public void execute() {
4356
public void end(boolean interrupted) {
4457
algae.setFlywheelSpeed(0);
4558
algae.setIntake(false);
59+
60+
new SetLEDAnimationCommand(
61+
new SolidColor(
62+
new RGB(Color.kSeaGreen)
63+
)
64+
).schedule();
4665
}
4766

4867
// Returns true when the command should end.

src/main/java/frc/robot/subsystems/Algae/AlgaeOutCommand.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
package frc.robot.subsystems.Algae;
66

7+
import edu.wpi.first.wpilibj.util.Color;
78
import edu.wpi.first.wpilibj2.command.Command;
9+
import frc.robot.subsystems.LED.LEDStateManager;
10+
import frc.robot.subsystems.LED.RGB;
11+
import frc.robot.subsystems.LED.SetLEDAnimationCommand;
12+
import frc.robot.subsystems.LED.CustomAnimations.Pulse;
13+
import frc.robot.subsystems.LED.CustomAnimations.ShootingLines;
14+
import frc.robot.subsystems.LED.CustomAnimations.SolidColor;
815

916
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
1017
public class AlgaeOutCommand extends Command {
@@ -21,12 +28,21 @@ public AlgaeOutCommand() {
2128
@Override
2229
public void initialize() {
2330
algae.setIntake(true);
31+
32+
new SetLEDAnimationCommand(
33+
new Pulse(
34+
new RGB(Color.kSeaGreen),
35+
0.5,
36+
1,
37+
0.2
38+
)
39+
).schedule();
2440
}
2541

2642
// Called every time the scheduler runs while the command is scheduled.
2743
@Override
2844
public void execute() {
29-
System.out.println("Algae out");
45+
// System.out.println("Algae out");
3046
algae.setFlywheelSpeed(-1);
3147
}
3248

@@ -35,6 +51,8 @@ public void execute() {
3551
public void end(boolean interrupted) {
3652
algae.setIntake(false);
3753
algae.setFlywheelSpeed(0);
54+
55+
LEDStateManager.getInstance().setDefault();
3856
}
3957

4058
// Returns true when the command should end.

src/main/java/frc/robot/subsystems/Climber/ClimbCommand.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
package frc.robot.subsystems.Climber;
22

3+
import edu.wpi.first.wpilibj.util.Color;
34
import edu.wpi.first.wpilibj2.command.Command;
5+
import frc.robot.subsystems.LED.LEDStateManager;
6+
import frc.robot.subsystems.LED.RGB;
7+
import frc.robot.subsystems.LED.SetLEDAnimationCommand;
8+
import frc.robot.subsystems.LED.CustomAnimations.Glitch;
9+
import frc.robot.subsystems.LED.CustomAnimations.RainbowPulse;
410

511
public class ClimbCommand extends Command {
612
private final Climber climber;
@@ -12,7 +18,7 @@ public ClimbCommand(Climber climber) {
1218

1319
@Override
1420
public void initialize() {
15-
System.out.println("Climbing Up...");
21+
// System.out.println("Climbing Up...");
1622
climber.climberMotor.set(0.6);
1723
}
1824

@@ -31,7 +37,12 @@ public boolean isFinished() {
3137
@Override
3238
public void end(boolean interrupted) {
3339
climber.climberMotor.set(0);
34-
System.out.println("Climb Complete.");
40+
// System.out.println("Climb Complete.");
41+
42+
new SetLEDAnimationCommand(
43+
LEDStateManager.getInstance().STARTING_SHOOTING_LINES
44+
).schedule();
45+
3546
//To Stay up in the air if needed
3647
//climber.climberMotor.set(0.1);
3748
}

src/main/java/frc/robot/subsystems/Climber/Climber.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Climber() {
5151

5252
ClimberForwardlimit = new DigitalInput(ClimberConstants.ClimbLimitChannel);
5353
SetLimitSwitch = new DigitalInput(ClimberConstants.SetClimbLimitChannel);
54-
isClimbLimitSwitchTripped = new Trigger(SetLimitSwitch::get);
54+
isClimbLimitSwitchTripped = new Trigger(SetLimitSwitch::get);
5555
isSetLimitSwitchTripped = new Trigger(ClimberForwardlimit::get);
5656
}
5757

src/main/java/frc/robot/subsystems/Climber/CloseClawCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public CloseClawCommand(Climber climber) {
1111

1212
@Override
1313
public void initialize() {
14-
System.out.println("Closing Claw...");
14+
// System.out.println("Closing Claw...");
1515
climber.clawMotor.setVoltage(ClimberConstants.closeClaw);
1616
}
1717

@@ -22,6 +22,6 @@ public boolean isFinished() {
2222

2323
@Override
2424
public void end(boolean interrupted) {
25-
System.out.println("Claw Closed.");
25+
// System.out.println("Claw Closed.");
2626
}
2727
}

0 commit comments

Comments
 (0)