88import edu .wpi .first .math .geometry .Rotation3d ;
99import edu .wpi .first .math .geometry .Transform3d ;
1010import edu .wpi .first .math .geometry .Translation3d ;
11+ import edu .wpi .first .networktables .BooleanSubscriber ;
1112import edu .wpi .first .networktables .DoubleArraySubscriber ;
1213import edu .wpi .first .networktables .IntegerSubscriber ;
1314import edu .wpi .first .networktables .NetworkTable ;
2122 */
2223public class WallEyeCam {
2324 private DoubleArraySubscriber dsub ;
25+ private BooleanSubscriber connectSub ;
2426 private int curUpdateNum = 0 ;
2527 private IntegerSubscriber updateSub ;
2628 private Transform3d camToCenter ;
@@ -61,6 +63,7 @@ public WallEyeCam(String tableName, int camIndex, int dioPort)
6163 double [] def = {2767.0 , 2767.0 , 2767.0 , 2767.0 , 2767.0 , 2767.0 , 2767.0 };
6264 dsub = table .getDoubleArrayTopic ("Result" + camIndex ).subscribe (def );
6365 updateSub = table .getIntegerTopic ("Update" + camIndex ).subscribe (0 );
66+ connectSub = table .getBooleanTopic ("Connected" + camIndex ).subscribe (false );
6467 }
6568
6669 /**
@@ -78,6 +81,16 @@ private void grabGyro() {
7881
7982 }
8083
84+ /**
85+ * TESTME TESTME
86+ * Check if the camera is still supplying images
87+ * TESTME TESTME
88+ *
89+ * @return Returns a boolean (True : if and only if the Pi's supplied images are new)
90+ */
91+ public boolean isCameraConnected () {
92+ return connectSub .get ();
93+ }
8194
8295 /**
8396 * Getter for the number of Cameras
0 commit comments