You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does 364 have support for wrapping the gyro angle so it fits within the range of [-180, 180)? If not, any recommendations on how to implement this? Would using something from the IEEE library work? @dirtbikerxz
The text was updated successfully, but these errors were encountered:
Not sure if this is the best solution, but here's how our team wraps the gryo angle within [0, 360]:
yawFixed = Math.abs((360-gyro.getAngle())% 360);
The "360 - " part might not be necessary for what you want, but it works on our robot so it shouldn't be a problem.
If you want to wrap the angle within [-180, 180], you could just subtract 180 from the equation above. yawFixed = 180 - Math.abs((360-gyro.getAngle())% 360);
I've never tried it so I'm not sure if the subtracting 180 part works, but I'd definitely recommend you try it.
Does 364 have support for wrapping the gyro angle so it fits within the range of [-180, 180)? If not, any recommendations on how to implement this? Would using something from the IEEE library work? @dirtbikerxz
The text was updated successfully, but these errors were encountered: