Skip to content

Commit

Permalink
actually update the pose
Browse files Browse the repository at this point in the history
  • Loading branch information
j5155 committed Jul 2, 2024
1 parent 5a39761 commit 4cf4292
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void runOpMode() throws InterruptedException {
telemetry.update();
waitForStart();
while (opModeIsActive()) {
drive.updatePoseEstimate();
radsTurned += drive.pose.heading.minus(lastHeading);
lastHeading = drive.pose.heading;
telemetry.addData("Uncorrected Degrees Turned", Math.toDegrees(radsTurned));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public void runOpMode() throws InterruptedException {
telemetry.update();
waitForStart();
while (opModeIsActive()) {
telemetry.addData("Heading Offset (radians, enter this one into SparkFunOTOSDrive!)",Math.atan2(drive.pose.position.x,drive.pose.position.y));
telemetry.addData("Heading Offset (degrees)",Math.toRadians(Math.atan2(drive.pose.position.x,drive.pose.position.y)));
drive.updatePoseEstimate();
telemetry.addData("Heading Offset (radians, enter this one into SparkFunOTOSDrive!)",Math.atan2(drive.pose.position.y,drive.pose.position.x));
telemetry.addData("Heading Offset (degrees)",Math.toDegrees(Math.atan2(drive.pose.position.y,drive.pose.position.x)));
telemetry.update();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void runOpMode() throws InterruptedException {
telemetry.update();
waitForStart();
while (opModeIsActive()) {
drive.updatePoseEstimate();
telemetry.addData("Heading (deg)",Math.toDegrees(drive.pose.heading.toDouble()));
if (Math.abs(Math.toDegrees(drive.pose.heading.toDouble())) > 175) {
telemetry.addData("X Offset", drive.pose.position.x / 2);
Expand Down

0 comments on commit 4cf4292

Please sign in to comment.