Hi everyone!
This is our first year using SwervePoseEstimator, and I am not sure how the heading works for it (relative to the gyro). I think that the gyro is from 0-360 degrees(although I have seen higher than 500 degrees), but when I return the rotation in degrees from the SwervePoseEstimator (we combine the latency compensated vision measurements from the LL with our odometry), it is from -180 to 180 (I just haven’t seen higher or lower, maybe I’m wrong).
I tried to make it so that during the initialization of the swerve subsystem, the gyro is set to 180 and so is the initial pose rotation in the initial pose part of the constructor. This makes it so that the robot understands that it is facing the blue speaker (where 0 degrees I think should be a vector going from blue speaker to red).
In any case, I’m not exactly sure how gyro heading translates with the vision heading to the heading given by the swerveposeestimator.
Also, how do I need to define the heading for PathPlanner if I want to use the localization during auto?
For some extra information: our getGyro method calls 360 - getYaw() from our NAVX2.
I can link our github if necessary.
Any help would be greatly appreciated!