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
I built a box running the serial YPR example.
Everything looks ok if roll is kept <90 degrees. But as soon as the box is tilted to have a roll >90 degrees, the pitch abruptly changes to >179 degrees.
Why is roll affecting the pitch and viceversa ? Did anybody see this problem or did I something wrong?
Is there anything to correct this problem ?
The text was updated successfully, but these errors were encountered:
Hello altomare23 , its Dis encouraging when questions go ignored, I know.
well, I decided to be the change I'd like to see,. Yes, I too noticed the same thing. I am working on a UAV, and I knew I would have to deal with this as well, so I decided to make an attempt.
the following only works with the roll angle from what I observed in testing. Feel free to apply the same to pitch just to experience it yourself. In theory this may allow for barrel rolls .
However, its not perfect you would have to create conditions: what I mean is, if I roll 360 degrees
there are two separate regions where pitch is affected and increments to 360 degrees, additional restrictions would need to be placed. This is just a snippet to hopefully get you started.
Thanks a lot Aarpp, you were so kind to confirm that the same problem is observed by others. Now, in order to bypass this problem, I implemented a mixed (interim) solution. YAW is evaluated as ypr[0]*180/M_PI; but pitch and roll are computed in agreement with https://wiki.dfrobot.com/How_to_Use_a_Three-Axis_Accelerometer_for_Tilt_Sensing. So:
ROLL = atan2(AY , AZ) * 180.0 /M_PI;
PITCH = atan2(-AX , sqrt(AY * AY + AZ * AZ)) * 180.0 /M_PI;
This works much better minimizing interactions.
In any case I will experiment your solution to improve all measurements. My special thanks !!!
I built a box running the serial YPR example.
Everything looks ok if roll is kept <90 degrees. But as soon as the box is tilted to have a roll >90 degrees, the pitch abruptly changes to >179 degrees.
Why is roll affecting the pitch and viceversa ? Did anybody see this problem or did I something wrong?
Is there anything to correct this problem ?
The text was updated successfully, but these errors were encountered: