Skip to content

Commit

Permalink
Merge pull request #26 from junkjunk123/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
BaronClaps authored Dec 19, 2024
2 parents e4f0447 + db79dc3 commit a2cb798
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public TwoWheelPinpointIMULocalizer(HardwareMap map, Pose setStartPose) {
deltaTimeNano = 1;
displacementPose = new Pose();
currentVelocity = new Pose();
previousHeading = startPose.getHeading();
deltaRadians = 0;
}

Expand Down Expand Up @@ -293,8 +294,28 @@ public double getTurningMultiplier() {
* This resets the IMU.
*/

public void resetIMU() {
@Override
public void resetIMU() throws InterruptedException {
pinpoint.recalibrateIMU();

try {
Thread.sleep(300);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}

/**
* This resets the pinpoint.
*/
private void resetPinpoint() throws InterruptedException{
pinpoint.resetPosAndIMU();

try {
Thread.sleep(300);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}

0 comments on commit a2cb798

Please sign in to comment.