Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the IMU angular velocity axes #159

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

Lunerwalker2
Copy link
Contributor

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

In essence, as of SDK <v7.0, the X and Z axes from getAngularVelocity() in the BNO055IMU class are flipped. This has affected users who use these two axes when running the MaxAngVeloTuner for the last few months, where the maximum angular velocity is reported to be very low, in the 0-5 degree range. The general advice in places like the FTC Discord since the issues were first noticed with this tuner was to use an approximate value for the maximum angular velocity and acceleration such as toRadians(180);.

Recently, with the increase in people using the LearnRoadRunner guide (which instructs to use the MaxAngVeloTuner), many people have used the incorrect values, and experience issues when their track width tuning does not work due to it. Last week, I started trying to figure out the cause of these problems, and my search eventually led to the main SDK issue that I linked above. This fix would be a temporary one until a larger main SDK version comes out which fixes it, but as there is no known time estimate for that, it might be good to go ahead and act on it.

My fix includes a comment on the getExternalHeadingVelocity() function describing the changes and changes the default Z axis to the inverse X axis (the inverse is necessary because the BNO055IMU inverses the X axis since it expects it to be the Z axis).

I can realize that such a change may not be desirable when it will break upon the next SDK release, so if it is wanted I can edit the PR to instead just include an instructional comment about the necessary changes to the angular velocity axis when using an SDK version <7.0.

Hope this is helpful.

Copy link
Member

@rbrott rbrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough investigation. Hopefully the automated tuners can regain some lost dignity! I just proposed some small changes to the wording.

…mpleMecanumDrive.java


- better description

Co-authored-by: Ryan Brott <rcbrott@gmail.com>
@Lunerwalker2
Copy link
Contributor Author

That's a much better description; I'll change both of them to that. I was struggling to find words to describe the issue and the solution originally.

@rbrott rbrott merged commit ae15647 into acmerobotics:master Dec 9, 2021
DV0405 pushed a commit to TWHS-Pastabots/freight-frenzy that referenced this pull request Dec 11, 2021
…5-141025-release-candidate

FtcRobotController v7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants