@@ -0,0 +1,2500 @@
+package com.thegongoliers.input;%0A%0A/**%0A * A class for calculating the odometry of a robot from wheel encoders.%0A */%0Apublic class Odometry %7B%0A%0A    /**%0A     * Get the distance traveled by the center of the robot.%0A     *%0A     * @param left  The distance traveled by the left wheels.%0A     * @param right The distance traveled by the right wheels.%0A     * @return The distance traveled by the center of the robot.%0A     */%0A    public static double getDistance(double left, double right) %7B%0A        return (left + right) / 2.0;%0A    %7D%0A%0A    /**%0A     * Get the angle traveled by the center of the robot.%0A     *%0A     * @param left      The distance traveled by the left wheels.%0A     * @param right     The distance traveled by the right wheels.%0A     * @param wheelBase The distance between the center of the left and right wheels.%0A     * @return The angle traveled by the center of the robot in radians.%0A     */%0A    public static double getAngle(double left, double right, double wheelBase) %7B%0A        return (right - left) / wheelBase;%0A    %7D%0A%0A    /**%0A     * Get the distance traveled along the x axis by the center of the robot.%0A     *%0A     * @param left  The distance traveled by the left wheels.%0A     * @param right The distance traveled by the right wheels.%0A     * @param angle The initial angle of the robot in radians.%0A     * @return The distance traveled in the direction of the x axis.%0A     */%0A    public static double getX(double left, double right, double angle) %7B%0A        return getDistance(left, right) * Math.cos(angle);%0A    %7D%0A%0A    /**%0A     * Get the distance traveled along the y axis by the center of the robot.%0A     *%0A     * @param left  The distance traveled by the left wheels.%0A     * @param right The distance traveled by the right wheels.%0A     * @param angle The initial angle of the robot in radians.%0A     * @return The distance traveled in the direction of the y axis.%0A     */%0A    public static double getY(double left, double right, double angle) %7B%0A        return getDistance(left, right) * Math.sin(angle);%0A    %7D%0A%0A    /**%0A     * Convert encoder ticks to a distance.%0A     *%0A     * @param ticks            The ticks of the encoder.%0A     * @param ticksPerRotation The ticks per complete rotation of the encoder.%0A     * @param radius           The radius of the wheel.%0A     * @return The distance traveled by the wheel.%0A     */%0A    public static double ticksToDistance(double ticks, double ticksPerRotation, double radius) %7B%0A        return 2 * Math.PI * radius * ticks / ticksPerRotation;%0A    %7D%0A%7D%0A

Add Odometry class