Python ( robot module): conversion hom. transformation (rotation) matrix and Euler or RPY angles
I'm using in the robotics toolbox (c.q. robot module) in Python http://code.google.com/p/robotics-toolbox-python/) and I'm utterly confused how to interpret the following conversion results (I've done things like this in the p开发者_Python百科ast could always work them out...).
A simple phi=PI/10 rotation about the x-axes produces the following (3x3) rotation matrix:
R =
[ 1. 0. 0. ]
[ 0. 0.99609879 -0.08824514]
[-0. 0.08824514 0.99609879]]
( where 0.996..=cos(phi) and 0.0882..=sin(phi) )
with corresponding (4x4) homogeneous transformation matrix:
T = | R 0 | =
| 0 1 |
[[ 1. 0. 0. 0. ]
[ 0. 0.99609879 -0.08824514 0. ]
[-0. 0.08824514 0.99609879 0. ]
[ 0. 0. 0. 1. ]]
Conversion of T into angle representation produces the following:
RPY (Roll, pitch, yaw) angles (around z, y and x axes, respectively, ... I presume):
print robot.tr2rpy(T)
[[ 0. 0. 0.08836007]]
Problem: How can the x-rotation be the last element (rather than the first)....?
Further:
Euler angles (around x, y and z axes, respectively, ... I presume):
print robot.tr2eul(T)
[[-1.57079633 0.08836007 1.57079633]]
( = [[ -PI/4, sin(phi), PI/4 ]] ))
Problem: My interpretation (sequential rotation around x,y,z axes) tells me the result is dead wrong...?
What am I missing? Thanks.
-- Henk
Solved:
With successive angles, a[0],a[1],a[2],
1) For Euler angles these are successive rotations around Z-Y-Z axes;
2) For RPY angles these are successive Y(aw)-P(itch)-R(roll) rotations (i.e around Z-Y-X axes).
精彩评论