Skip to content

Commit feae225

Browse files
committed
Fill LEDs for "X" (VisionShooter) shot.
1 parent 4ce7eef commit feae225

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/frc/robot/shooter/commands/VisionShooter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import frc.lib.control.DCMotor;
88
import frc.lib.control.PIDController;
99
import frc.robot.shooter.Shooter;
10+
import frc.robot.status.Status;
1011
import frc.robot.vision.Limelight;
1112

1213
public class VisionShooter extends CommandBase {
@@ -70,6 +71,16 @@ void controller() {
7071
lastTime = time;
7172
}
7273

74+
@Override
75+
public void execute() {
76+
double targetDelta = rpm - velocity;
77+
78+
if ((Math.abs(targetDelta) < 20) && !closeToTarget) {
79+
closeToTarget = true;
80+
Status.getInstance().fillLEDs();
81+
}
82+
}
83+
7384
@Override
7485
public void end(boolean interrupted) {
7586
controller.stop();

0 commit comments

Comments
 (0)