Robotics, Vision and Control - 2
2 Representing Position and Orientation
A fundamental requirement in robotics and computer vision is to represent
the position and orientation of objects in an environment. Such objects include robots, cameras, workpieces, obstacles and paths.
Instead of describing the individual points we describe the position and orientation of the object by the position and orientation of its coordinate frame.
The position and orientation of a coordinate frame is known as its pose and is shown graphically as a set of coordinate axes. The relative pose of a frame with respect to a reference coordinate frame is denoted by the symbol ξ.
The point P in Fig. 2.2 can be described with respect to either coordinate frame. Formally we express this as
An important characteristic of relative poses is that they can be composed or compounded. Consider the case shown in Fig. 2.3. If one frame can be described in terms of another by a relative pose then they can be applied sequentially
So what is ξ? It can be any mathematical object that supports the algebra described above and is suited to the problem at hand. It will depend on whether we are considering a 2- or 3-dimensional problem. Some of the objects that we will discuss in the rest of this chapter include vectors as well as more exotic mathematical objects such as homogeneous transformations, orthonormal rotation matrices and quaternions.
To recap:
- A point is described by a coordinate vector that represents its displacement from a
reference coordinate system;- A set of points that represent a rigid object can be described by a single coordinate
frame, and its constituent points are described by displacements from that coordinate
frame;- The position and orientation of an object’s coordinate frame is referred to as its
pose;- A relative pose describes the pose of one coordinate frame with respect to another
and is denoted by an algebraic variable ξ;- A coordinate vector describing a point can be represented with respect to a different
coordinate frame by applying the relative pose to the vector using the · operator;- We can perform algebraic manipulation of expressions written in terms of relative
poses.
2.1 lRepresenting Pose in 2-Dimensions
A 2-dimensional world, or plane, is familiar to us from high-school Euclidean geometry. We use a Cartesian coordinate system or coordinate frame with orthogonal axes denoted x and y and typically drawn with the x-axis horizontal and the y-axis vertical. The point of intersection is called the origin. Unit-vectors parallel to the axes are denoted ’ and (. A point is represented by its x- and y-coordinates (x, y) or as a bound vector
Figure 2.6 shows a coordinate frame {B} that we wish to describe with respect to the reference frame {A}. We can see clearly that the origin of {B} has been displaced by the vector t = (x, y) and then rotated counter-clockwise by an angle θ. A concrete representation of pose is therefore the 3-vector AξB∼ (x, y, θ), and we use the symbol ∼ to denote that the two representations are equivalent. Unfortunately this representation is not convenient for compounding since
is a complex trigonometric function of both poses. Instead we will use a different way of representing rotation.
The matrix has a very specific structure and belongs to the special Euclidean group of dimension 2 or
.
2.2 Representing Pose in 3-Dimensions
A point P is represented by its x-, y- and z-coordinates (x, y, z) or as a bound vector
2.2.1 Representing Orientation in 3-Dimensions
Any two independent orthonormal coordinate frames can be related by a sequence of rotations (not more than three) about coordinate axes, where no two successive rotations may be about the same axis. Euler’s rotation theorem (Kuipers 1999).
The implication for the pose algebra we have used in this chapter is that the ⊕ operator is not commutative – the order in which rotations are applied is very important.
Mathematicians have developed many ways to represent rotation and we will discuss several of them in the remainder of this section: orthonormal rotation matrices, Euler and Cardan angles, rotation axis and angle, and unit quaternions.
2.2.1.1 Orthonormal Rotation Matrix
The matrix R belongs to the special orthogonal group of dimension 3 or . It has the properties of an orthonormal matrix that were mentioned on page 16 such as and .
The orthonormal rotation matrices for rotation of θ about the x-, y- and z-axes are
The orthonormal matrix has nine elements but they are not independent. The columns have unit magnitude which provides three constraints. The columns are orthogonal to each other which provides another three constraints. Nine elements and six constraints is effectively three independent values.
2.2.1.2 Three-Angle Representations
Euler’s rotation theorem requires successive rotation about three axes such that no two successive rotations are about the same axis. There are two classes of rotation sequence: Eulerian and Cardanian, named after Euler and Cardano respectively.
The Eulerian type involves repetition, but not successive, of rotations about one particular axis: XYX, XZX, YXY, YZY, ZXZ, or ZYZ. The Cardanian type is characterized by rotations about all three axes: XYZ, XZY, YZX, YXZ, ZXY, or ZYX. In common usage all these sequences are called Euler angles and there are a total of twelve to choose from.
The ZYZ sequence
is commonly used in aeronautics and mechanical dynamics, and is used in the Toolbox.
The Euler angles are the 3-vector
.
The two different sets of Euler angles correspond to the one rotation matrix. The mapping from rotation matrix to Euler angles is not unique and always returns a positive angle for θ.
Another widely used convention is the roll-pitch-yaw angle sequence angle
which are intuitive when describing the attitude of vehicles such as ships, aircraft and cars. Roll, pitch and yaw (also called bank, attitude and heading) refer to rotations about the x-,y-,z-axes, respectively. This XYZ angle sequence, technically Cardan angles, are also known as Tait-Bryan angles or nautical angles. For aerospace and ground vehicles the x-axis is commonly defined in the forward direction, z-axis downward and the y-axis to the right-hand side.
The roll-pitch-yaw sequence allows all angles to have arbitrary sign and it has a singularity when which is fortunately outside the range of feasible attitudes for most vehicles.
2.2.1.3 Singularities and Gimbal Lock
A fundamental problem with the three-angle representations just described is singularity. This occurs when the rotational axis of the middle term in the sequence becomes parallel to the rotation axis of the first or third term. This is the same problem as gimbal lock, a term made famous in the movie Apollo 13.
In mathematical, rather than mechanical, terms this problem can be seen using the definition of the Lunar module’s coordinate system where the rotation of the spacecraft’s body-fixed frame {B} with respect to the stable platform frame {S} is