Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit d34d56d

Browse files
authored
Merge pull request #20 from junkjunk123/master
Patches to the PinpointLocalizer
2 parents bdc0de4 + 9330c22 commit d34d56d

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/follower/Follower.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ public DashboardPoseTracker getDashboardPoseTracker() {
10191019
/**
10201020
* This resets the IMU, if applicable.
10211021
*/
1022-
public void resetIMU() {
1022+
private void resetIMU() throws InterruptedException {
10231023
poseUpdater.resetIMU();
10241024
}
10251025
}

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/localization/Localizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public abstract class Localizer {
9292
/**
9393
* This resets the IMU of the localizer, if applicable.
9494
*/
95-
public abstract void resetIMU();
95+
public abstract void resetIMU() throws InterruptedException;
9696

9797
/**
9898
* This is overridden to return the IMU, if there is one.

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/localization/PoseUpdater.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public Localizer getLocalizer() {
351351
/**
352352
*
353353
*/
354-
public void resetIMU() {
354+
public void resetIMU() throws InterruptedException {
355355
localizer.resetIMU();
356356
}
357357
}

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/pedroPathing/localization/localizers/PinpointLocalizer.java

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@
7979
// //TODO: Set encoder directions
8080
// odo.setEncoderDirections(GoBildaPinpointDriver.EncoderDirection.FORWARD, GoBildaPinpointDriver.EncoderDirection.FORWARD);
8181
//
82-
// odo.resetPosAndIMU();
83-
//
82+
// resetPinpoint();;
83+
8484
// setStartPose(setStartPose);
8585
// totalHeading = 0;
8686
// previousHeading = setStartPose.getHeading();
87-
//
88-
// resetPinpoint();
8987
// }
9088
//
9189
// /**
@@ -107,7 +105,7 @@
107105
// @Override
108106
// public Pose getVelocity() {
109107
// Pose2D pose = odo.getVelocity();
110-
// return new Pose(pose.getX(DistanceUnit.INCH), pose.getY(DistanceUnit.INCH), pose.getHeading(AngleUnit.RADIANS));
108+
// return new Pose(pose.getX(DistanceUnit.INCH), pose.getY(DistanceUnit.INCH), odo.getHeadingVelocity());
111109
// }
112110
//
113111
// /**
@@ -142,7 +140,6 @@
142140
// */
143141
// @Override
144142
// public void setPose(Pose setPose) {
145-
// resetPinpoint();
146143
// odo.setPosition(new Pose2D(DistanceUnit.INCH, setPose.getX(), setPose.getY(), AngleUnit.RADIANS, setPose.getHeading()));
147144
// }
148145
//
@@ -195,17 +192,29 @@
195192
// }
196193
//
197194
// /**
198-
// * This resets the IMU.
195+
// * This resets the IMU. Note: This does not change the estimated heading orientation.
199196
// */
200197
// @Override
201-
// public void resetIMU() {
202-
// odo.recalibrateIMU();
198+
// public void resetIMU() throws InterruptedException {
199+
// odo.recalibrateIMU();
200+
//
201+
// try {
202+
// Thread.sleep(300);
203+
// } catch (InterruptedException e) {
204+
// throw new RuntimeException(e);
205+
// }
203206
// }
204207
//
205208
// /**
206-
// * This resets the OTOS.
209+
// * This resets the pinpoint.
207210
// */
208-
// public void resetPinpoint(){
211+
// private void resetPinpoint() {
209212
// odo.resetPosAndIMU();
213+
//
214+
// try {
215+
// Thread.sleep(300);
216+
// } catch (InterruptedException e) {
217+
// throw new RuntimeException(e);
218+
// }
210219
// }
211220
//}

0 commit comments

Comments
 (0)