So a usual unit circle is 0 to 2pi. Does this circle range from -2 to 2 in a single rotation? So typically I would assume it goes from 1.999pi to 0. Does that mean this goes to 1.999 to -2? I am just really confused by these units.
v2024.0.1-beta-3 supposedly has getRotation2d() and getRotation3d() functions, so you shouldn’t have to deal with quaternions directly if you don’t want to.
Those docs make no sense though. 3D rotations use unit quaternions, so the (w, x, y, z) 4-vector’s components must have values between -1 and 1, and the 4-vector’s magnitude must be 1. I also have no idea what they’re talking about with unit circles having 4pi radians, because they don’t.
That comment block has been there for more than eight years.
I looked around the code and didn’t see any reference to it being -2 to 2 or 4PI radians. I can update the comment in the next release. However, I am unsure if the data is correct then. I will start testing to verify it is between the proper unit circle 0 - 2PI. If others who are more experienced with Quaternions could help to test and verify as well, that would be appreciated.
So the reason this came to my attention is that we are using YAGSL and PathPlanner. Teleop seems to work fine, but whatever rotation is requested in pathplanner is doubled which would seem to agree that it’s -2 to 2 instead of -1 to 1
Rotation2d and Rotation3d use North-West-Up axes convention, which means a positive yaw is counterclockwise (I think that’s what your video shows?). If Rotation2d had a positive yaw as clockwise before, that was a bug in NavX’s vendordep.
I also was looking at the weirdness of jumping between 0.9 to 2 radians with extremely tiny robot rotations. The gyro widget uses a different value that doesn’t depend on the 3D rotation
Yea, no problem. I have been trying to test internally, but I do not currently have a robot to test on.
It may sound weird, but can you test with the 2023.0.4 vendor lib and the old firmware on the navx? Then, test 2023.0.3 with new navx firmware. I am curious to see if one creates a solution and the other breaks it again when used together.