@@ -0,0 +1,1739 @@
+package org.robockets.stronghold.robot.highgoalshooter;%0A%0Aimport org.robockets.stronghold.robot.Robot;%0A%0Aimport edu.wpi.first.wpilibj.command.Command;%0Aimport edu.wpi.first.wpilibj.networktables.NetworkTable;%0Aimport edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;%0A%0A/**%0A *%0A */%0Apublic class HorizontalAlign extends Command %7B%0A%0A%09NetworkTable table;%0A%09boolean stop;%0A%09%0A    public HorizontalAlign(boolean stop) %7B%0A    %09requires(Robot.shooter);%0A    %09this.stop = stop;%0A    %09if (stop)%7B%0A    %09%09requires(Robot.driveTrain); // Make the drive train stop for a bit here.%0A    %09%7D%0A    %7D%0A%0A    protected void initialize() %7B%0A    %09table = NetworkTable.getTable(%22vision%22);%0A    %09if (stop)%7B%0A    %09%09double pixelError = table.getNumber(%22horiz_offset%22, 3);%0A    %09%09double distance = table.getNumber(%22distance%22, 10);%0A    %09%09double width = table.getNumber(%22width%22, 100);%0A    %09%09double actualWidthin = 20;%0A    %09%09Robot.shooter.setTurnTableAngle(Robot.shooter.turnTablePidController.getSetpoint() * Math.asin(pixelError * (actualWidthin / width) / distance));%0A    %09%7D else %7B%0A    %09%09Robot.shooter.disableTurnTablePID();%0A    %09%7D%0A    %7D%0A%0A    protected void execute() %7B%0A    %09double pixelError = table.getNumber(%22horiz_offset%22, 3);%0A%09%09%0A    %09if(!stop)%7B%0A    %09%09double factor = 0.5;%0A    %09%09if (pixelError %3E 0) %7B factor *= -1; %7D%0A    %09%09if (Math.abs(pixelError) %3E= 40) %7B factor *= 0.5; %7D %0A    %09%09Robot.shooter.spinTurnTable(factor);%0A    %09%7D%0A    %7D%0A%0A    protected boolean isFinished() %7B%0A    %09if (!stop) %7B return Math.abs(table.getNumber(%22horiz_offset%22, 21)) %3C 20; %7D%0A    %09return Robot.shooter.turnTablePidController.onTarget();%0A    %7D%0A%0A    protected void end() %7B%0A    %09Robot.shooter.spinTurnTable(0);%0A    %09Robot.shooter.enableTurnTablePID();%0A    %7D%0A%0A    protected void interrupted() %7B%0A    %09end();%0A    %7D%0A%7D

Align the shooter horizontally with vision data.