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

tf.transformations.quaternion_from_matrix() is misleading #64

Closed
jbohren opened this issue May 20, 2014 · 4 comments
Closed

tf.transformations.quaternion_from_matrix() is misleading #64

jbohren opened this issue May 20, 2014 · 4 comments

Comments

@jbohren
Copy link
Member

jbohren commented May 20, 2014

The tf.transformations.quaternion_from_matrix() function says it returns a quaternion from a rotation matrix, but it fails if you give it an actual rotation matrix (element of SO(3)). Instead it requires that the input "rotation matrix" is a 4x4 matrix (element of SE(3)).

If you try passing it a 3x3 rotation matrix, you get the following error:

  File "/opt/ros/hydro/lib/python2.7/dist-packages/tf/transformations.py", line 1206, in quaternion_from_matrix
    M = numpy.array(matrix, dtype=numpy.float64, copy=False)[:4, :4]
IndexError: too many indices

I understand the utility of extracting a quaternion directly from a rigid transform, but it should also accept an actual rotation matrix as input.

https://github.com/ros/geometry/blob/indigo-devel/tf/src/tf/transformations.py#L1196
Related to #49

@tfoote
Copy link
Member

tfoote commented May 20, 2014

This is an external library pulled in for convenience. I don't want to diverge from it's API. We've had bad experiences with that in the past.

@jbohren
Copy link
Member Author

jbohren commented May 20, 2014

This is an external library pulled in for convenience. I don't want to diverge from it's API. We've had bad experiences with that in the past.

Alright, would a PR that fixes the documentation be welcomed?

@tfoote
Copy link
Member

tfoote commented May 20, 2014

Definitely.

On Tue, May 20, 2014 at 2:36 PM, Jonathan Bohren
[email protected]:

This is an external library pulled in for convenience. I don't want to
diverge from it's API. We've had bad experiences with that in the past.

Alright, would a PR that fixes the documentation be welcomed?


Reply to this email directly or view it on GitHubhttps://github.com//issues/64#issuecomment-43686489
.

@tfoote
Copy link
Member

tfoote commented Dec 7, 2014

Closing this as #49 would be adequate.

@tfoote tfoote closed this as completed Dec 7, 2014
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

No branches or pull requests

2 participants