Update TwoWheelPinpointIMULocalizer.java
This commit is contained in:
@ -103,6 +103,7 @@ public class TwoWheelPinpointIMULocalizer extends Localizer {
|
||||
deltaTimeNano = 1;
|
||||
displacementPose = new Pose();
|
||||
currentVelocity = new Pose();
|
||||
previousHeading = startPose.getHeading();
|
||||
deltaRadians = 0;
|
||||
}
|
||||
|
||||
@ -293,8 +294,28 @@ public class TwoWheelPinpointIMULocalizer extends Localizer {
|
||||
* 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() {
|
||||
pinpoint.resetPosAndIMU();
|
||||
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user