The solution to the 0-360 degree jump when filtering the angle

In the process of filtering the angle, it will be found that the visual direction will jump from 0 to 360. In order to solve this problem, it is necessary to change the discontinuous point between 0 and 360 degrees into a continuously derivable function.

When you rotate more than 360 degrees, it's 0 degrees not 361 degrees. However, there is a trick that can be used to convert the angle data from non-continuous to continuous.
When you rotate more than 360 degrees, we add 360 degrees to the read Euler angles, which gives you a virtual "361 degrees". Likewise, if you rotate from 0 degrees to 360 degrees, you can subtract 360 from the Euler angles you read. After the virtual angle is filtered, the virtual angle is modulo 360 to obtain a real estimated value.

Guess you like

Origin blog.csdn.net/Aaron9489/article/details/128965621