Skip to content

Commit

Permalink
Replace log() with toDouble()
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Nov 26, 2023
1 parent 79d6297 commit 7ad781b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ public boolean run(@NonNull TelemetryPacket p) {

p.put("x", pose.position.x);
p.put("y", pose.position.y);
p.put("heading (deg)", Math.toDegrees(pose.heading.log()));
p.put("heading (deg)", Math.toDegrees(pose.heading.toDouble()));

Pose2d error = txWorldTarget.value().minusExp(pose);
p.put("xError", error.position.x);
p.put("yError", error.position.y);
p.put("headingError (deg)", Math.toDegrees(error.heading.log()));
p.put("headingError (deg)", Math.toDegrees(error.heading.toDouble()));

// only draw when active; only one drive action should be active at a time
Canvas c = p.fieldOverlay();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ public boolean run(@NonNull TelemetryPacket p) {

p.put("x", pose.position.x);
p.put("y", pose.position.y);
p.put("heading (deg)", Math.toDegrees(pose.heading.log()));
p.put("heading (deg)", Math.toDegrees(pose.heading.toDouble()));

Pose2d error = txWorldTarget.value().minusExp(pose);
p.put("xError", error.position.x);
p.put("yError", error.position.y);
p.put("headingError (deg)", Math.toDegrees(error.heading.log()));
p.put("headingError (deg)", Math.toDegrees(error.heading.toDouble()));

targetPoseWriter.write(new PoseMessage(txWorldTarget.value()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public PoseMessage(Pose2d pose) {
this.timestamp = System.nanoTime();
this.x = pose.position.x;
this.y = pose.position.y;
this.heading = pose.heading.log();
this.heading = pose.heading.toDouble();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void runOpMode() throws InterruptedException {

telemetry.addData("x", drive.pose.position.x);
telemetry.addData("y", drive.pose.position.y);
telemetry.addData("heading (deg)", Math.toDegrees(drive.pose.heading.log()));
telemetry.addData("heading (deg)", Math.toDegrees(drive.pose.heading.toDouble()));
telemetry.update();
}
} else if (TuningOpModes.DRIVE_CLASS.equals(TankDrive.class)) {
Expand All @@ -51,7 +51,7 @@ public void runOpMode() throws InterruptedException {

telemetry.addData("x", drive.pose.position.x);
telemetry.addData("y", drive.pose.position.y);
telemetry.addData("heading (deg)", Math.toDegrees(drive.pose.heading.log()));
telemetry.addData("heading (deg)", Math.toDegrees(drive.pose.heading.toDouble()));
telemetry.update();
}
} else {
Expand Down

0 comments on commit 7ad781b

Please sign in to comment.