diff --git a/src/main/java/frc4388/robot/commands/ShooterCommands/TrackTarget.java b/src/main/java/frc4388/robot/commands/ShooterCommands/TrackTarget.java index 3c83331..1ec7f17 100644 --- a/src/main/java/frc4388/robot/commands/ShooterCommands/TrackTarget.java +++ b/src/main/java/frc4388/robot/commands/ShooterCommands/TrackTarget.java @@ -67,6 +67,7 @@ public class TrackTarget extends CommandBase { @Override public void execute() { try { + m_visionOdometry.setDriverMode(false); m_visionOdometry.setLEDs(true); points = m_visionOdometry.getTargetPoints(); @@ -153,6 +154,8 @@ public class TrackTarget extends CommandBase { // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { + m_visionOdometry.setLEDs(false); + m_visionOdometry.setDriverMode(true); } // Returns true when the command should end. diff --git a/src/main/java/frc4388/robot/subsystems/VisionOdometry.java b/src/main/java/frc4388/robot/subsystems/VisionOdometry.java index 315623d..0f8f0bd 100644 --- a/src/main/java/frc4388/robot/subsystems/VisionOdometry.java +++ b/src/main/java/frc4388/robot/subsystems/VisionOdometry.java @@ -47,6 +47,9 @@ public class VisionOdometry extends SubsystemBase { m_camera = new PhotonCamera(VisionConstants.NAME); m_drive = drive; m_shooter = shooter; + + setLEDs(false); + setDriverMode(true); } /** Gets the vision points from the limelight @@ -93,6 +96,10 @@ public class VisionOdometry extends SubsystemBase { m_camera.setLED(on ? VisionLEDMode.kOn : VisionLEDMode.kOff); } + public void setDriverMode(boolean driverMode) { + m_camera.setDriverMode(driverMode); + } + public Point getTargetOffset() throws VisionObscuredException { ArrayList screenPoints = getTargetPoints();