Skip to content

Commit

Permalink
Revert IMU angular velocity bug mitigation (#173)
Browse files Browse the repository at this point in the history
* fix: corrected the angular velocity axes

See SDK issue FIRST-Tech-Challenge/FtcRobotController#251

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

- better description

Co-authored-by: Ryan Brott <rcbrott@gmail.com>

* fix: changed tank class comment to match mecanum

* fix: remove ang velo bug note

- Fixed in SDK 8.0

Co-authored-by: Ryan Brott <rcbrott@gmail.com>
  • Loading branch information
Lunerwalker2 and rbrott committed Sep 20, 2022
1 parent 519a12b commit e3b7b98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e3b7b98

Please sign in to comment.