A pose consists of a translation and rotation. The translation defines the shift along the \(x\), \(y\) and \(z\) axes. The rotation can be defined in many different ways. The rc_cube uses quaternions to define rotations and translations are given in meters. This is called the XYZ+quaternion format. This chapter explains the conversion between different common conventions and the XYZ+quaternion format.
It is quite common to define rotations in 3D by three angles that define rotations around the three coordinate axes. Unfortunately, there are many different ways to do that. The most common conventions are Euler and Cardan angles (also called Tait-Bryan angles). In both conventions, the rotations can be applied to the previously rotated axis (intrinsic rotation) or to the axis of a fixed coordinate system (extrinsic rotation).
We use \(x\), \(y\) and \(z\) to denote the three coordinate axes. \(x'\), \(y'\) and \(z'\) refer to the axes that have been rotated one time. Similarly, \(x''\), \(y''\) and \(z''\) are the axes after two rotations.
In the (original) Euler angle convention, the first and the third axis are always the same. The rotation order \(z\)-\(x'\)-\(z''\) means rotating around the \(z\)-axis, then around the already rotated \(x\)-axis and finally around the (two times) rotated \(z\)-axis. In the Cardan angle convention, three different rotation axes are used, e.g. \(z\)-\(y'\)-\(x''\). Cardan angles are often also just called Euler angles.
For each intrinsic rotation order, there is an equivalent extrinsic rotation order, which is inverted, e.g. the intrinsic rotation order \(z\)-\(y'\)-\(x''\) is equivalent to the extrinsic rotation order \(x\)-\(y\)-\(z\).
Rotations around the \(x\), \(y\) and \(z\) axes can be defined by quaternions as
or by rotation matrices as
The extrinsic rotation order \(x\)-\(y\)-\(z\) can be computed by multiplying the individual rotations in inverse order, i.e. \(r_z(\gamma) r_y(\beta) r_x(\alpha)\).
Based on these definitions, the following sections explain the conversion between common conventions and the XYZ+quaternion format.
Please be aware of units for positions and orientations. rc_cube devices always specify positions in meters, while most robot manufacturers use millimeters or inches. Angles are typically specified in degrees, but may sometimes also be given in radians.