diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ThreeDeadWheelLocalizer.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ThreeDeadWheelLocalizer.java index 18f0de23922d..cbef30cf604e 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ThreeDeadWheelLocalizer.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ThreeDeadWheelLocalizer.java @@ -7,6 +7,7 @@ import com.acmerobotics.roadrunner.Vector2dDual; import com.acmerobotics.roadrunner.ftc.Encoder; import com.acmerobotics.roadrunner.ftc.FlightRecorder; +import com.acmerobotics.roadrunner.ftc.OverflowEncoder; import com.acmerobotics.roadrunner.ftc.PositionVelocityPair; import com.acmerobotics.roadrunner.ftc.RawEncoder; import com.qualcomm.robotcore.hardware.DcMotorEx; @@ -29,9 +30,9 @@ public static class Params { private int lastPar0Pos, lastPar1Pos, lastPerpPos; public ThreeDeadWheelLocalizer(HardwareMap hardwareMap, double inPerTick) { - par0 = new RawEncoder(hardwareMap.get(DcMotorEx.class, "par0")); - par1 = new RawEncoder(hardwareMap.get(DcMotorEx.class, "par1")); - perp = new RawEncoder(hardwareMap.get(DcMotorEx.class, "perp")); + par0 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par0"))); + par1 = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par1"))); + perp = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "perp"))); lastPar0Pos = par0.getPositionAndVelocity().position; lastPar1Pos = par1.getPositionAndVelocity().position; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TwoDeadWheelLocalizer.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TwoDeadWheelLocalizer.java index 59b4cef29f16..e394377f4141 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TwoDeadWheelLocalizer.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TwoDeadWheelLocalizer.java @@ -8,6 +8,7 @@ import com.acmerobotics.roadrunner.Vector2dDual; import com.acmerobotics.roadrunner.ftc.Encoder; import com.acmerobotics.roadrunner.ftc.FlightRecorder; +import com.acmerobotics.roadrunner.ftc.OverflowEncoder; import com.acmerobotics.roadrunner.ftc.PositionVelocityPair; import com.acmerobotics.roadrunner.ftc.RawEncoder; import com.qualcomm.robotcore.hardware.DcMotorEx; @@ -34,8 +35,8 @@ public static class Params { private final double inPerTick; public TwoDeadWheelLocalizer(HardwareMap hardwareMap, IMU imu, double inPerTick) { - par = new RawEncoder(hardwareMap.get(DcMotorEx.class, "par")); - perp = new RawEncoder(hardwareMap.get(DcMotorEx.class, "perp")); + par = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "par"))); + perp = new OverflowEncoder(new RawEncoder(hardwareMap.get(DcMotorEx.class, "perp"))); this.imu = imu; lastParPos = par.getPositionAndVelocity().position;