Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Evaluate whether other PigeonIMU methods should be used #72

Open
auscompgeek opened this issue Jan 1, 2020 · 3 comments
Open

Evaluate whether other PigeonIMU methods should be used #72

auscompgeek opened this issue Jan 1, 2020 · 3 comments

Comments

@auscompgeek
Copy link
Member

I suspect getFusedHeading() would be better for getting the current heading, for example.

@pietroglyph
Copy link
Contributor

If I remember correctly (this is not mentioned on the Phoenix javadoc), getFusedHeading() returns an angle modded by 360. We need a continuous angle, because we need to know how many revolutions have been made when we determine track width.

We could detect rollovers from 360 deg to 0 deg if you think that the additional accuracy is important, but I didn't have any issues last year using getRawHeading() to get the track width for trajectory following on our competition robot.

@auscompgeek
Copy link
Member Author

Ah, fair enough. Just that currently the generated project allocates a 3-array and reads the Z angle from that…

What other methods does the PigeonIMU have that returns the yaw?

@pietroglyph
Copy link
Contributor

There's getYawPitchRoll and get6dQuaternion. The latter will be normalized on [-180, 180] when you convert to Euler angles, because you have an atan2 in that process. I don't know if getYawPitchRoll returns a non-modded angle. I vaguely recall it being modded from when we used it last year.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants