- }
- }
-
- public static double lidarCalculateAngleToTurn(int position,
- double horizontalDistToGoal) {
- double leftDist = Robot.driveTrain.getLeftLidarDistance();
- double rightDist = Robot.driveTrain.getRightLidarDistance();
-
- double errorAngle = Math.atan(Math.abs(leftDist - rightDist) / 2);
- double distToTower;
- // TODO: figure out if we do want to shoot into the side goal if we are
- // in position 1 or 2, or if we want to change that
- if (position == 1 || position == 2) {
- distToTower = Math
- .cos(CENTER_OF_MASS_TO_ROBOT_FRONT + (leftDist - rightDist) / 2)
- - DIST_CASTLE_WALL_TO_SIDE_GOAL;
- }