From 42ebd635206afce2dea4ff059caf94acdd4aeab9 Mon Sep 17 00:00:00 2001 From: Lunerwalker2 <55162022+Lunerwalker2@users.noreply.github.com> Date: Tue, 20 Sep 2022 18:30:43 -0400 Subject: [PATCH] Revert IMU angular velocity bug mitigation (#173) * fix: corrected the angular velocity axes See SDK issue https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/251 * Update TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java - better description Co-authored-by: Ryan Brott * fix: changed tank class comment to match mecanum * fix: remove ang velo bug note - Fixed in SDK 8.0 Co-authored-by: Ryan Brott --- .../ftc/teamcode/drive/SampleMecanumDrive.java | 7 +------ .../firstinspires/ftc/teamcode/drive/SampleTankDrive.java | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java index 12d4a680..f9fad087 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java @@ -298,12 +298,7 @@ public double getRawExternalHeading() { @Override public Double getExternalHeadingVelocity() { - // To work around an SDK bug, use -zRotationRate in place of xRotationRate - // and -xRotationRate in place of zRotationRate (yRotationRate behaves as - // expected). This bug does NOT affect orientation. - // - // See https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/251 for details. - return (double) -imu.getAngularVelocity().xRotationRate; + return (double) imu.getAngularVelocity().zRotationRate; } public static TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleTankDrive.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleTankDrive.java index 188aa3a1..3ff79f1a 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleTankDrive.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleTankDrive.java @@ -302,12 +302,7 @@ public double getRawExternalHeading() { @Override public Double getExternalHeadingVelocity() { - // To work around an SDK bug, use -zRotationRate in place of xRotationRate - // and -xRotationRate in place of zRotationRate (yRotationRate behaves as - // expected). This bug does NOT affect orientation. - // - // See https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/251 for details. - return (double) -imu.getAngularVelocity().xRotationRate; + return (double) imu.getAngularVelocity().zRotationRate; } public static TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) {