@@ -0,0 +1,2459 @@
+package edu.stuy.util;%0A%0Aimport java.util.Timer;%0Aimport java.util.TimerTask;%0Aimport java.util.Vector;%0A%0Aimport edu.wpi.first.wpilibj.AnalogInput;%0Aimport edu.wpi.first.wpilibj.Gyro;%0A%0Apublic class StuyGyro extends Gyro %7B%0A    %0A    private Vector%3CDouble%3E gyroMeasurements;%0A    private Timer updateMeasurements;%0A    %0A    private final int GYRO_MEASUREMENT_SIZE = 5;%0A    private final int GYRO_UPDATE_PERIOD = 10;%0A    %0A    public StuyGyro(AnalogInput channel) %7B%0A        super(channel);%0A        gyroMeasurements = new Vector%3CDouble%3E();%0A        startGyroUpdateThread();%0A    %7D%0A    %0A    public void startGyroUpdateThread() %7B%0A        stopGyroUpdateThread();%0A        updateMeasurements = new Timer();%0A        updateMeasurements.schedule(new TimerTask() %7B%0A            public void run() %7B%0A                synchronized (StuyGyro.this) %7B%0A                    gyroMeasurements.addElement(getInstantaneousGyroAngleInDegrees());%0A                    if (gyroMeasurements.size() %3E GYRO_MEASUREMENT_SIZE) %7B%0A                        gyroMeasurements.removeElementAt(0);%0A                    %7D%0A                %7D%0A            %7D%0A        %7D, 0, GYRO_UPDATE_PERIOD);%0A    %7D%0A    %0A    public void stopGyroUpdateThread() %7B%0A        if (updateMeasurements != null) %7B%0A            updateMeasurements.cancel();%0A        %7D%0A    %7D%0A    %0A    public void resetGyroMeasurements() %7B%0A        gyroMeasurements.removeAllElements();%0A    %7D%0A    %0A    public double getInstantaneousGyroAngleInDegrees() %7B%0A        return getAngle();%0A    %7D%0A    %0A    public double getInstantaneousGyroAngleInRadians() %7B%0A        return getAngle() * Math.PI / 180.0;%0A    %7D%0A    %0A    public double getAveragedGyroAngle() %7B%0A        if (gyroMeasurements.isEmpty()) %7B%0A            return 0;%0A        %7D%0A        double sum = 0;%0A        double min = gyroMeasurements.elementAt(0);%0A        double max = min;%0A        synchronized (this) %7B%0A            for (int i = 0; i %3C gyroMeasurements.size(); i++) %7B%0A                double measure = gyroMeasurements.elementAt(i);%0A                sum += measure;%0A                if (measure %3C min) %7B%0A                    min = measure;%0A                %7D%0A                else if (measure %3E max) %7B%0A                    max = measure;%0A                %7D%0A            %7D%0A            if (gyroMeasurements.size() %3E= 3) %7B%0A                return (sum - min - max) / (gyroMeasurements.size() - 2);%0A            %7D%0A            else %7B%0A                return sum / gyroMeasurements.size();%0A            %7D%0A        %7D%0A    %7D%0A    %0A    %0A    %0A%7D%0A

Add Gyro wrapper class