Skip to content

Commit 9e96b62

Browse files
Lunerwalker2rbrott
andcommitted
Revert IMU angular velocity bug mitigation (FIRST-Tech-Challenge#173)
* fix: corrected the angular velocity axes See SDK issue FIRST-Tech-Challenge#251 * Update TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java - better description Co-authored-by: Ryan Brott <[email protected]> * fix: changed tank class comment to match mecanum * fix: remove ang velo bug note - Fixed in SDK 8.0 Co-authored-by: Ryan Brott <[email protected]>
1 parent 519a12b commit 9e96b62

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,7 @@ public double getRawExternalHeading() {
298298

299299
@Override
300300
public Double getExternalHeadingVelocity() {
301-
// To work around an SDK bug, use -zRotationRate in place of xRotationRate
302-
// and -xRotationRate in place of zRotationRate (yRotationRate behaves as
303-
// expected). This bug does NOT affect orientation.
304-
//
305-
// See https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/251 for details.
306-
return (double) -imu.getAngularVelocity().xRotationRate;
301+
return (double) imu.getAngularVelocity().zRotationRate;
307302
}
308303

309304
public static TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) {

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/SampleTankDrive.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,7 @@ public double getRawExternalHeading() {
302302

303303
@Override
304304
public Double getExternalHeadingVelocity() {
305-
// To work around an SDK bug, use -zRotationRate in place of xRotationRate
306-
// and -xRotationRate in place of zRotationRate (yRotationRate behaves as
307-
// expected). This bug does NOT affect orientation.
308-
//
309-
// See https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/251 for details.
310-
return (double) -imu.getAngularVelocity().xRotationRate;
305+
return (double) imu.getAngularVelocity().zRotationRate;
311306
}
312307

313308
public static TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) {

0 commit comments

Comments
 (0)