]> git.taranathan.com Git - FRC2026.git/commitdiff
added camera detection
authoriefomit <timofei.stem@gmail.com>
Tue, 27 Jan 2026 01:53:58 +0000 (17:53 -0800)
committeriefomit <timofei.stem@gmail.com>
Tue, 27 Jan 2026 01:53:58 +0000 (17:53 -0800)
src/main/java/frc/robot/commands/led_comm/LEDDefaultCommand.java
src/main/java/frc/robot/util/Vision/Vision.java

index 8f52e0031f4ec8ef0de6430c6906f9f85bb2ad7c..4475a8002c7daad4d85e79042e781f3d8b081391 100644 (file)
@@ -18,7 +18,7 @@ public class LEDDefaultCommand extends Command {
 
     public LEDDefaultCommand(LED led, Drivetrain drivetrain, Vision vision) {
         this.led = led;
-        // this.outtake = outtake; // TODO: Outtake subsystem not yet implemented
+        // this.outtake = outtake;
         this.drivetrain = drivetrain;
         this.vision = vision;
 
index 08bdab2c4b3e495117d17165838853794cdf182a..c380935c31d8718735d0fc1d52c14c9b9f12abe2 100644 (file)
@@ -396,6 +396,19 @@ public class Vision {
     onlyUse = ids;
   }
 
+  /**
+   * Checks if one or more cameras are disconnected
+   * @return true if at least one camera is disconnected, false otherwise
+   */
+  public boolean oneCameraDisconnected(){
+    for(VisionCamera camera : cameras){
+      if(!camera.inputs.connected){
+        return true;
+      }
+    }
+    return false;
+  }
+
   /**
    * Checks if a pose is on the field
    * @param pose The pose to check