Say you want to design a localization system for a ground robot equipped with wheel encoders, an IMU, and a Lidar. The goal of the navigation system is to estimate the robot's pose (i.e., displacement and orientation) resolved in the world frame (i.e., as seen by an observer in the world looking at the robot). To do that, the navigation system would need to resolve the sensor measurements (e.g., lidar measurements) in the robot frame. In other words, the system should transform the measurements from the sensor frame to the robot frame. This requires using transformations, which can be parametrized as transformation matrices, which in turn are a relation between two coordinate systems.
This blog serves as a very lightweight intro to the notion of reference frames and transformations that link frames and displacements together.
I've been talking about reference frames and transforms without giving them a proper introduction. So, I'll try to give a clearer intro to these concepts, and I'll use visuals to help me with this intro. Refer to [1][2] for more info on frames and transforms.
A reference frame, denoted , is a set of orthogonal physical unit vectors. The frame can be attached to a rigid body such that it rotates with the rigid body. However, the reference frame does not have a notion of "position" or "displacement", which could be a confusing concept, especially that it's common to refer to a frame's "origin" (e.g., ROS' tf library). What's usually meant to be communicated is "the displacement of some point with respect to another point , resolved in frame ".
For example, the vector from point to point is represented using a physical vector .
To make sense of the physical vector , a reference frame needs to be defined in which the physical vector can be resolved. Let's define an arbitrary frame and resolve the physical vector. The physical vector resolved in frame is denoted by , as seen below.
As mentioned previously a frame does not have a position. For example, let's define another frame that is aligned (i.e., the arrows are in the same direction) with frame but is visualized as if it was displaced. Then the vector resolved in frame , has the same value as .
However, if the two frames are misaligned (i.e., the vectors are pointing in different directions), then the resolved values (i.e., the coordinates are different). For example, defining a frame that has its x-axis aligned with the physical vector will have different coordinates than .
The frames and are related to one another through a rotation matrix, also known as a direction cosine matrix (DCM)[3]. The rotation matrix consists of the vectors of the frame resolved in the frame . For the given example above, the matrix is given by
where is the angle from frame to frame . For the example above, the angle is .
The rotation matrix is useful because it can be used to relate the coordinates of a physical vector resolved in different frames. For example,
The rotation matrices are useful to relate vector coordinates resolved in different frames. However, sometimes we're interested in more than just resolving the vector in a different frame. Specifically, we're sometimes interested in having the displacement be with respect to another point, resolved in a different frame.
For example, say we have the coordinates .
Furthermore, say we're interested in having the coordinates of . That is, the displacement of the point with respect to point , resolved in frame (i.e., the green arrow in the gray blow). Then, what is the relation between and ?
The relationship is given by
which can be written compactly as
where is known as a transformation matrix, and is known as a homogenous coordinate. The notation is summarized in the following figure.
Transformation matrices, and transformations in general are quite important in many fields that use kinematics such as aerospace, robotics, vehicles, and many others. The reason they are important is because there are often multiple important frames on a robot.
For example, sensor data (e.g., lidar) are resolved in the sensor frame. However, robotic systems, such as the navigation system, would require the sensor data be resolved in the body frame. As such, the transformation matrices between these frames are important for such a system.
These transformation matrices are often estimated using calibration processes, often referred to as extrinsic calibration.
This blog was intended to be a light-weight introduction to the applications of reference frames and transformation matrices. Transformations are an important part of any robotic system with multiple frames, so it's important to have a good understanding of it. This blog lacks the depth for deep understanding of these concepts. As such, I've provided some references for further readings for the interested readers.
The rotation matrices and transformation matrices fall under a special mathematical structure known as a matrix Lie group. Specifically, the rotation matrices fall under the special orthogonal group, whereas the transformation matrices fall under the special Euclidean group. A very good introduction to Lie groups for robotics is presented by Sola[4].
For a more thorough and a more solid intro to reference frames, Lie groups, and robotics in general, Barfoot's book is quite something[3].
[1] | Representing Robot Pose: The good, the bad, and the ugly |
[2] | Reducing the uncertainty about the uncertainties, part 2: Frames and manifolds |
[3] | State Estimation for Robotics |
[4] | A micro Lie theory for state estimation in robotics |