ahrs
ahrs copied to clipboard
Quaternion transformation to Roll-Pitch-Yaw angles
When you see the gyroscope integration, you can see that the Y-axis spins 1 negative turn then 1 positive turn. When you see the estimated and reference orientation, the Yaw simply doesn't follow that. I agree reference Yaw and reconstructed Yaw are similar because their quaternions are very very close. the problem isn't about +-2pi. The problem comes that the to_angles()
conversion doesn't get you the real movement.
Originally posted by @anisghaoui in https://github.com/Mayitzin/ahrs/discussions/20#discussioncomment-371173
@Mayitzin is this issue confirmed? I am facing a kinda similar issue with Kalman and Mahony. If this issue is confirmed, is there a workaround for this?
This issue is confirmed to me. I also used Mahony. I got the same observation. My only workaround is to use my phone flat on my hand face up to the ceiling, usb towards my chest. And consider the Z axis as the Yaw. The Yaw is then correct.
The problem is that I checked the current implementation of to_angles() and it seems correct but doesn't have singularities management (which in my case doesn't change a thing).
You can go on an adventure and try to find the quaternion conversion. Gl Hf
do we have any update on this weirdness?
No, I switched to a different approach due to the approaching deadlines. This is still unsolved.
do we have any update on this weirdness?
Taking code sample from the documentation
attitude = ahrs.filters.Madgwick(acc=acc_data, gyr=gyro_data)
attitude.Q
How to convert from quaternion into yaw/pitch/roll angles?
How to convert from quaternion into yaw/pitch/roll angles?
- Convert from quaternion to DCM (Rotation Matrix)
- Considering a rotation order of Euler Angles, convert DCM to EA.