Quote:
Originally Posted by Richard100
Note that if one is streaming readings from an angular position sensor (such as a gyro or IMU), one would need to add an accumulator to this shortest_angle function to continually maintain angular position.
|
It's not clear what you're saying here.
You don't need an accumulator when using a gyro if all you care about is your heading.
The desired heading and the gyro angle do not have a range constraint in this case.
For example, the gyro angle could be 721 degrees and the desired heading could be -1 degree. The function would return -2 degrees as the shortest angle, which is the value you want.