Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gimbal lock condition computing jacobian from quaternion to rpy #1289

Closed
giafranchini opened this issue Sep 25, 2023 · 1 comment · Fixed by #1290
Closed

gimbal lock condition computing jacobian from quaternion to rpy #1289

giafranchini opened this issue Sep 25, 2023 · 1 comment · Fixed by #1290

Comments

@giafranchini
Copy link

In rpy_and_jacobian the implementation of the jacobian components when gimbal lock occurs appears to be wrong to me.
For example, in the case of pitch=90°, if I symbolically derived the yaw expression yaw = -2 * atan2(x(), r()) wrt the 4 quaternion components, I obtain the following:

  • dyaw/dx() = -2*r() / (r()^2 + x()^2)
  • dyaw/dr() = 2*x() / (r()^2 + x()^2)

while the other two components should be zeros. Instead, in the current implementation I found:

  • dyaw/dr() = +2 / x()
  • dyaw/dy() = -2 * r() / (x() * x())

and the other two components equal to zero. This leads to NaN results when trying to convert quaternions when x() goes to zero.

@jlblancoc
Copy link
Member

Wow, can't find an explanation for it! Thanks a lot for investigating it and reporting.
It's now covered by unit tests and fixed in #1290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants