ros / geometry

Packages for common geometric calculations including the ROS transform library, "tf". Also includes ROS bindings for "bullet" physics engine and "kdl" kinematics/dynamics package.
173 stars 274 forks source link

Bug in rotation_from_matrix in tf/src/tf/transformation.py? #168

Closed ichumuh closed 6 years ago

ichumuh commented 6 years ago
In[49]: rotation_from_matrix(euler_matrix(1e-4, 0, 1e-5))
Out[49]: 
(-1.5358054854723877,
 array([ -3.50052870e-06,   7.07106781e-01,  -3.50051290e-07]),
 array([ 0.,  0.,  0.,  1.]))

Shouldn't the result be approx. (0.0, array([ 0., 0., 1.]), array([ 0., 0., 0., 1.]))? Also the axis does not have a norm of 1.

tfoote commented 6 years ago

That does look like it's not quite right. However, this is an embedded copy of transformations.py from Christoph Gohlke: https://www.lfd.uci.edu/~gohlke/

Comparing to his current implementation there is no functional change to rotation_from_matrix. We don't want to diverge our copy from upstream. If there's a change necessary please submit it upstream and we can embed an updated copy if there's an important fix.

For isolating this it would be helpful to create some tests that can be independently verified, and to isolate down to the smallest unit of problem, for example which function call specifically not working. And are there more than one value that's problematic?

I don't know how to submit bugs against transformations.py I guess you email Christof

There is a successor library Transforms3d as well: https://matthew-brett.github.io/transforms3d/