-
Notifications
You must be signed in to change notification settings - Fork 56
Problem with precision in Euler Angles. #8
Comments
Try defining a more exact constant for 180.0/pi rather than using M_PI. You will improve by about 4e-6 each time you convert to radians, and then subsequently propagate/compound that error through motor arithmetic.
|
Can you try angles away from the 90 degree poles out of curiosity? Euler angles have an endemic precision issue around there so I'm wondering if there's some case I need to handle with branching. |
Thank you for your answers! @Orbots It doesn't seem to be a precision problem with PI. I'm using 36 decimals. Now on a float, but earlier on a double. Plus I'm not doing any iterative operations that would accumulate error (only two radians<->degrees operations). .And yet the error is significant. What values would you use? @jeremyong. Yes, indeed!. INPUT: roll: 90 pitch: 90 yaw: 0 INPUT: roll: 89 pitch: 89 yaw: 0 INPUT: roll: 88 pitch: 88 yaw: 0 INPUT: roll: 87 pitch: 87 yaw: 0 INPUT: roll: 86 pitch: 86 yaw: 0 INPUT: roll: 85 pitch: 85 yaw: 0 INPUT: roll: 84 pitch: 84 yaw: 0 INPUT: roll: 180 pitch: 180 yaw: 0 INPUT: roll: 179 pitch: 179 yaw: 0 INPUT: roll: 270 pitch: 270 yaw: 0 INPUT: roll: 360 pitch: 360 yaw: 0 DJuego |
Your value of PI only is only precise out to 7 or 8 decimal places.
I'm assuming the error is accumulating in
Cheers. |
Hello, I decided to step through this. It seems like the issue is in creating the rotor. The calculation before the normalize() call sets the internal quaternion coefficients to: I'm not sure if this is a limitation of float precision, or the normalization technique. -Frank |
Hello again! Long time no see! Any news regarding this problem? 😔 DJuego |
You are correct. The problem occurs when computing 1/sqrt(0.999999881) = 1.0000000595, which can not be represented in single point precision. |
I am working with Microsoft Visual Studio 2019 16.6.1 in Windows 10 x64 environment.
Well. There seems to be some problem in the numerical accuracy of Euler's new angle conversion feature.
For instance; When I convert, for example, roll=90º ,pitch=90º, yaw=0º to rotor, I get in rotor: roll=0º, pitch=89.972º, yaw=0º.I find a noticeable difference between 90º and 89,972º (0.028º) that can build up too quickly.
I get:
DJuego
The text was updated successfully, but these errors were encountered: