diff --git a/photon-lib/src/main/java/org/photonvision/SimVisionSystem.java b/photon-lib/src/main/java/org/photonvision/SimVisionSystem.java index b7fc2ebf5..e183257f2 100644 --- a/photon-lib/src/main/java/org/photonvision/SimVisionSystem.java +++ b/photon-lib/src/main/java/org/photonvision/SimVisionSystem.java @@ -119,7 +119,6 @@ public class SimVisionSystem { dbgField .getObject("Target " + Integer.toString(target.targetID)) .setPose(target.targetPose.toPose2d()); - ; } /** @@ -139,6 +138,15 @@ public class SimVisionSystem { } } + /** + * Clears all sim vision targets. This is useful for switching alliances and needing to repopulate + * the sim targets. NOTE: Old targets will still show on the Field2d unless overwritten by new + * targets with the same ID + */ + public void clearVisionTargets() { + tgtList.clear(); + } + /** * Adjust the camera position relative to the robot. Use this if your camera is on a gimbal or * turret or some other mobile platform. diff --git a/photon-lib/src/main/native/include/photonlib/SimVisionSystem.h b/photon-lib/src/main/native/include/photonlib/SimVisionSystem.h index 64284a74b..98e523343 100644 --- a/photon-lib/src/main/native/include/photonlib/SimVisionSystem.h +++ b/photon-lib/src/main/native/include/photonlib/SimVisionSystem.h @@ -108,6 +108,14 @@ class SimVisionSystem { ->SetPose(target.targetPose.ToPose2d()); } + /** + * Clears all sim vision targets. + * This is useful for switching alliances and needing to repopulate the sim + * targets. NOTE: Old targets will still show on the Field2d unless + * overwritten by new targets with the same ID + */ + void ClearVisionTargets() { targetList.clear(); } + /** * Adjust the camera position relative to the robot. Use this if your camera * is on a gimbal or turret or some other mobile platform.