Python ( robot module): conversion hom. transformation (rotation) matrix and Euler or RPY angles
<p>I'm using in the robotics toolbox (c.q. robot module) in Python <a href="http://code.google.com/p/robotics-toolbox-python/" rel="nofollow">http://code.google.com/p/robotics-toolbox-python/</a>) and I'm utterly confused how to interpret the following conversion results (I've done things like this in the past could always work them out...).</p>

<p>A simple phi=PI/10 rotation about the x-axes produces the following (3x3) rotation matrix:</p>

<pre><code>R = 
 [ 1.          0.          0.        ]
 [ 0.          0.99609879 -0.08824514]   
 [-0.          0.08824514  0.99609879]]
</code></pre>

<p>( where 0.996..=cos(phi) and 0.0882..=sin(phi) )</p>

<p>with corresponding (4x4) homogeneous transformation matrix:</p>

<pre><code>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.        ]]
</code></pre>

<p>Conversion of T into angle representation produces the following:</p>

<p>RPY (Roll, pitch, yaw) angles (around z, y and x axes, <strong><em>respectively</em></strong>, ... I presume):</p>

<pre><code>print robot.tr2rpy(T)

[[ 0.          0.          0.08836007]]
</code></pre>

<p>Problem: How can the x-rotation be the last element (rather than the first)....?</p>

<p>Further:</p>

<p>Euler angles (around x, y and z axes, <strong><em>respectively</em></strong>, ... I presume):</p>

<pre><code>print robot.tr2eul(T)

[[-1.57079633  0.08836007  1.57079633]]
</code></pre>

<p>( = [[ -PI/4, sin(phi), PI/4 ]] ))</p>

<p>Problem: My interpretation (sequential rotation around x,y,z axes) tells me the result is dead wrong...?</p>

<p>What am I missing? Thanks.</p>

<p>-- Henk</p>
