File tree Expand file tree Collapse file tree 7 files changed +22
-7
lines changed
src/main/java/org/carlmontrobotics Expand file tree Collapse file tree 7 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public abstract class Config implements Sendable {
2424 protected boolean exampleFlagEnabled = false ;
2525 protected boolean swimShady = false ;
2626 protected boolean setupSysId = false ;
27+ protected boolean limelightDisabled = false ;
2728 protected boolean useSmartDashboardControl = false ; // whether to control arm position + rpm of
2829 // outtake through SmartDashboard
2930 // Note: disables joystick control of arm and
@@ -49,7 +50,11 @@ public boolean useSmartDashboardControl() {
4950 return useSmartDashboardControl ;
5051 }
5152
52- // --- For clarity, place additional config settings ^above^ this line ---
53+ public boolean isLimelightDisabled () {
54+ return limelightDisabled ;
55+ }
56+
57+ // --- Place additional config settings ^above^ this line ---
5358
5459 private static class MethodResult {
5560 String methodName = null ;
Original file line number Diff line number Diff line change 1111
1212import edu .wpi .first .wpilibj2 .command .Command ;
1313
14+ import static org .carlmontrobotics .Config .CONFIG ;
15+
1416public class AimArmSpeaker extends Command {
1517 private final Arm arm ;
1618 private final Limelight ll ;
@@ -45,6 +47,6 @@ public void end(boolean interrupted) {}
4547 // Returns true when the command should end.
4648 @ Override
4749 public boolean isFinished () {
48- return arm .armAtSetpoint ();
50+ return arm .armAtSetpoint () || CONFIG . isLimelightDisabled () ;
4951 }
5052}
Original file line number Diff line number Diff line change 1616import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
1717import edu .wpi .first .wpilibj2 .command .Command ;
1818
19+ import static org .carlmontrobotics .Config .CONFIG ;
20+
1921public class AlignToApriltag extends Command {
2022
2123 public final TeleopDrive teleopDrive ;
@@ -106,6 +108,6 @@ public boolean isFinished() {
106108 // return false;
107109 // SmartDashboard.putBoolean("At Setpoint", rotationPID.atSetpoint());
108110 // SmartDashboard.putNumber("Error", rotationPID.getPositionError());
109- return rotationPID .atSetpoint ();
111+ return rotationPID .atSetpoint () || CONFIG . isLimelightDisabled () ;
110112 }
111113}
Original file line number Diff line number Diff line change 1616import edu .wpi .first .util .sendable .SendableRegistry ;
1717import edu .wpi .first .wpilibj2 .command .Command ;
1818
19+ import static org .carlmontrobotics .Config .CONFIG ;
20+
1921public class AlignToNote extends Command {
2022
2123 public final TeleopDrive teleopDrive ;
@@ -54,7 +56,7 @@ public void execute() {
5456
5557 @ Override
5658 public boolean isFinished () {
57- return false ;
59+ return CONFIG . isLimelightDisabled () ;
5860 // SmartDashboard.putBoolean("At Setpoint", rotationPID.atSetpoint());
5961 // SmartDashboard.putNumber("Error", rotationPID.getPositionError());
6062 // return rotationPID.atSetpoint();
Original file line number Diff line number Diff line change 1818import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
1919import edu .wpi .first .wpilibj2 .command .Command ;
2020
21+ import static org .carlmontrobotics .Config .CONFIG ;
22+
2123public class AutoMATICALLYGetNote extends Command {
2224 /** Creates a new AutoMATICALLYGetNote. */
2325 private Drivetrain dt ;
@@ -125,6 +127,6 @@ public void end(boolean interrupted) {
125127 // Returns true when the command should end.
126128 @ Override
127129 public boolean isFinished () {
128- return intake .outtakeDetectsNote ();
130+ return intake .outtakeDetectsNote () || CONFIG . isLimelightDisabled () ;
129131 }
130132}
Original file line number Diff line number Diff line change 99import org .carlmontrobotics .subsystems .Limelight ;
1010import org .carlmontrobotics .subsystems .LimelightHelpers ;
1111
12+ import static org .carlmontrobotics .Config .CONFIG ;
13+
1214import edu .wpi .first .math .util .Units ;
1315import edu .wpi .first .wpilibj .Timer ;
1416import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
@@ -54,6 +56,6 @@ public void end(boolean interrupted) {
5456 // Returns true when the command should end.
5557 @ Override
5658 public boolean isFinished () {
57- return timer .get () >= 0.5 ;
59+ return timer .get () >= 0.5 || CONFIG . isLimelightDisabled () ;
5860 }
5961}
Original file line number Diff line number Diff line change @@ -136,4 +136,4 @@ public double getOptimizedArmAngleRadsMT2() {
136136 public boolean seesTag () {
137137 return LimelightHelpers .getTV (SHOOTER_LL_NAME );
138138 }
139- }
139+ }
You can’t perform that action at this time.
0 commit comments