Skip to content

Commit 23bbb8a

Browse files
committed
added photon back into fault logger
1 parent 4175f61 commit 23bbb8a

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

src/main/java/frc/lib/FaultLogger.java

+10-20
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.util.function.BooleanSupplier;
2121
import java.util.function.Supplier;
2222

23+
import org.photonvision.PhotonCamera;
24+
2325
// (from team 1155 but slightly modified)
2426

2527
/**
@@ -238,24 +240,12 @@ public static void register(Pigeon2 pigeon) {
238240
FaultType.WARNING);
239241
}
240242

241-
// /**
242-
// * Registers a new NavX.
243-
// *
244-
// * @param navx The NavX.
245-
// */
246-
// public static void register(AHRS navx) {
247-
// register(() -> !navx.isConnected(), "NavX: Disconnected", FaultType.ERROR);
248-
// }
249-
250-
// /**
251-
// * Registers a new PhotonCamera. Detailed PhotonVision logs are located on the web UI, so
252-
// this is just for very basic
253-
// * telemetry to have in a dashboard when testing.
254-
// *
255-
// * @param photonCamera The PhotonCamera.
256-
// */
257-
// public static void register(PhotonCamera photonCamera) {
258-
// register(() -> !photonCamera.isConnected(), photonCamera.getName() + ": Disconnected.",
259-
// FaultType.ERROR);
260-
// }
243+
/**
244+
* Registers a new PhotonCamera (more detailed logs on the web ui).
245+
*
246+
* @param photonCamera The PhotonCamera.
247+
*/
248+
public static void register(PhotonCamera photonCamera) {
249+
register(() -> !photonCamera.isConnected(), photonCamera.getName() + ": Disconnected.", FaultType.ERROR);
250+
}
261251
}

src/main/java/frc/robot/utils/VisionPoseEstimator.java

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import edu.wpi.first.networktables.NetworkTableInstance;
1515
import frc.robot.Constants.FieldConstants;
1616
import frc.robot.Constants.VisionConstants;
17+
import frc.lib.FaultLogger;
1718
import frc.robot.Robot;
1819
import java.util.ArrayList;
1920
import java.util.Comparator;
@@ -204,6 +205,8 @@ public VisionPoseEstimator(
204205

205206
_logPath = "Swerve/" + camName + "/Estimate/";
206207

208+
FaultLogger.register(_camera);
209+
207210
if (Robot.isSimulation()) {
208211
var cameraProps = new SimCameraProperties();
209212

0 commit comments

Comments
 (0)