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