Properly handle obscured vision

This commit is contained in:
nathanrsxtn
2022-04-04 17:15:36 -06:00
parent 2c75485018
commit a3602b2004
4 changed files with 54 additions and 95 deletions
@@ -9,7 +9,6 @@ import javax.swing.plaf.basic.BasicTreeUI.TreeCancelEditingAction;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.SwerveDrive;
import frc4388.robot.subsystems.VisionOdometry;
import frc4388.utility.VisionObscuredException;
public class RotateUntilTarget extends CommandBase {
@@ -50,10 +49,7 @@ public class RotateUntilTarget extends CommandBase {
// Returns true when the command should end.
@Override
public boolean isFinished() {
try { this.visionOdometry.getTargetPoints(); } catch (VisionObscuredException voe) { return false; }
return true;
return this.visionOdometry.getTargetPoints() == null;
// return this.visionOdometry.m_camera.getLatestResult().hasTargets();
}
}