Franka Emika Pose Format¶
Franka Emika robots use a transformation matrix \(T\) to define a pose. A transformation matrix combines a rotation matrix \(R\) and a translation vector \(t=(\begin{array}{cccc}x & y & z\end{array})^T\).
The pose given by Franka Emika’s “Measure Pose” App consists of a translation \(x, y, z\) in millimeters and a rotation \(x, y, z\) in degrees. The rotation convention is \(z\)-\(y'\)-\(x''\) (i.e. \(x\)-\(y\)-\(z\)) and is computed by \(r_z(z) r_y(y) r_x(x).\)
Conversion from transformation matrix to quaternion¶
The conversion from a rotation matrix (with \(det(R)=1\)) to a quaternion \(q=(\begin{array}{cccc}q_x & q_y & q_z & q_w \end{array})\) can be done as follows:
The \(\text{sign}\) operator returns -1 if the argument is negative. Otherwise, 1 is returned. It is used to recover the sign for the square root. The \(\text{max}\) function ensures that the argument of the square root function is not negative, which can happen in practice due to round-off errors.
Conversion from Rotation-XYZ to quaternion¶
The conversion from the \(x, y, z\) angles in degrees to a quaternion \(q=(\begin{array}{cccc}q_x & q_y & q_z & q_w\end{array})\) can be done by first converting all angles to radians
and then calculating the quaternion with
Conversion from quaternion and translation to transformation¶
The conversion from a quaternion \(q=(\begin{array}{cccc}q_x & q_y & q_z & q_w\end{array})\) and a translation vector \(t=(\begin{array}{cccc}x & y & z\end{array})^T\) to a transformation matrix \(T\) can be done as follows:
where \(s=||q||^{-2}=\frac{1}{q_x^2+q_y^2+q_z^2+q_w^2}\) and \(s=1\) if \(q\) is a unit quaternion.
Conversion from quaternion to Rotation-XYZ¶
The conversion from a quaternion \(q=(\begin{array}{cccc}q_x & q_y & q_z & q_w\end{array})\) with \(||q||=1\) to the \(x, y, z\) angles in degrees can be done as follows.
Pose representation in RaceCom messages and state machines¶
In RaceCom messages and in state machines a pose is usually defined as one-dimensional array of 16 float values, representing the transformation matrix in column-major order. The indices of the matrix entries below correspond to the array indices