src/main/java/frc/robot/subsystems/ShooterVision.java
/**Returns distance to target in inches */
Returns distance to target in inches
Returns distance to target in inches
public double distanceToTargetinMeter(){
    double cameraAngle = ShooterVisionConstants.CAMERA_ANGLE; 
    double angleToTarget = this.tx.getDouble(0.0);
    double camHeight = ShooterVisionConstants.CAMERA_HEIGHT;
    double targetHeight = ShooterVisionConstants.TARGET_HEIGHT;
    double distance =  ((targetHeight-camHeight) / Math.tan(cameraAngle+angleToTarget));
    return distance;
  }
public double distanceToTargetinMeter ( ) { double cameraAngle = ShooterVisionConstants . CAMERA_ANGLE ; double angleToTarget = this . tx . getDouble ( 0.0 ) ; double camHeight = ShooterVisionConstants . CAMERA_HEIGHT ; double targetHeight = ShooterVisionConstants . TARGET_HEIGHT ; double distance = ( ( targetHeight - camHeight ) / Math . tan ( cameraAngle + angleToTarget ) ) ; return distance ; }
Returns distance to target in inches
Returns distance to target in inches