Mathematical Foundations for Robotics
Mathematical Foundations for Robotics
The language of robotics is mathematics. Whether we are describing the kinematic relationships between joint angles and end-effector positions, estimating a robot's pose from noisy sensor measurements, or computing trajectories that avoid obstacles, we rely on a foundation of linear algebra, probability theory, and optimization. This chapter establishes these mathematical prerequisites in sufficient depth to enable rigorous treatment of the advanced topics that follow: robot kinematics, dynamics, perception, planning, and control.
The material presented here is not abstract mathematics for its own sake but rather practical instruments with direct relevance to robotic applications. When we discuss eigenvalues, we emphasize their role in understanding system stability and dimensionality reduction. When we introduce quaternions, we highlight their advantages over Euler angles for representing orientations in three-dimensional space. When we present optimization algorithms, we connect them to trajectory planning and controller design. This connection between mathematical theory and robotic practice is the unifying theme of this chapter.
Linear Algebra Fundamentals
Linear algebra provides the framework for representing and manipulating the geometric transformations, coordinate systems, and relationships that underpin all robotic systems. From the $4 \times 4$ homogeneous transformation matrices that encode robot poses to the Jacobian matrices that relate joint velocities to end-effector velocities, linear algebra is the computational backbone of robotics.
Vector Spaces and Linear Transformations
A vector space (or linear space) $\mathcal{V}$ over a field $\mathbb{F}$ is a set equipped with two operations: vector addition and scalar multiplication. These operations must satisfy eight axioms: closure under addition and scalar multiplication, commutativity and associativity of addition, the existence of an additive identity (zero vector) and additive inverses, distributivity of scalar multiplication over vector addition and field addition, compatibility of scalar multiplication with field multiplication, and the existence of a multiplicative identity.
In robotics, we work primarily with the vector space $\mathbb{R}^n$, consisting of $n$-dimensional real vectors. The standard basis vectors $\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n$ span this space, meaning any vector $\mathbf{v} \in \mathbb{R}^n$ can be uniquely expressed as a linear combination $\mathbf{v} = \sum_{i=1}^n v_i \mathbf{e}_i$. This coordinate representation is what allows us to perform computations with vectors computationally.
A linear transformation $T: \mathcal{V} \to \mathcal{W}$ between two vector spaces satisfies two properties for all vectors $\mathbf{u}, \mathbf{v} \in \mathcal{V}$ and scalars $\alpha \in \mathbb{F}$:
$$T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) \quad \text{and} \quad T(\alpha \mathbf{v}) = \alpha T(\mathbf{v})$$
Every linear transformation $T: \mathbb{R}^n \to \mathbb{R}^m$ can be represented by an $m \times n$ matrix $\mathbf{A}$ such that $T(\mathbf{v}) = \mathbf{A}\mathbf{v}$ for all $\mathbf{v} \in \mathbb{R}^n$. This matrix representation is fundamental to robotics because it allows us to express coordinate transformations, projections, and other linear operations as matrix multiplications.
Consider the problem of transforming a point $\mathbf{p} = (p_x, p_y, p_z)^T$ expressed in a robot's body frame to world coordinates. If $\mathbf{R} \in \mathbb{R}^{3 \times 3}$ is the rotation matrix representing the body's orientation and $\mathbf{t} \in \mathbb{R}^3$ is the translation from world origin to body origin, this transformation is affine and can be expressed using homogeneous coordinates as:
$$\begin{pmatrix} \mathbf{p}_{world} \\ 1 \end{pmatrix} = \begin{pmatrix} \mathbf{R} & \mathbf{t} \\ \mathbf{0}^T & 1 \end{pmatrix} \begin{pmatrix} \mathbf{p}_{body} \\ 1 \end{pmatrix}$$
The $4 \times 4$ homogeneous transformation matrix $\mathbf{T}$ belongs to the special Euclidean group SE(3), which we study in detail in Chapter 2 on robot kinematics.
Matrix Operations and Properties
Matrices in robotics are rarely passive containers for data; they encode transformations, relationships, and constraints that define the robot's physical behavior. Understanding matrix properties is therefore essential for both analysis and computation.
The rank of a matrix $\mathbf{A} \in \mathbb{R}^{m \times n}$ is the dimension of its column space (or equivalently, its row space). For a robot's Jacobian matrix $\mathbf{J}(\mathbf{q})$, which maps joint velocities $\dot{\mathbf{q}}$ to end-effector velocities $\mathbf{v} = \mathbf{J}(\mathbf{q})\dot{\mathbf{q}}$, the rank reveals fundamental information about the robot's mobility. When $\text{rank}(\mathbf{J}) < 6$ for a 6-DOF manipulator, the robot is in a singular configuration where it cannot move freely in all directions—the Jacobian loses full rank, and certain end-effector velocities become unachievable regardless of joint velocities.
The condition number $\kappa(\mathbf{A}) = \|\mathbf{A}\|\|\mathbf{A}^{-1}\|$ (for invertible matrices) quantifies numerical sensitivity. A matrix with large condition number is "ill-conditioned," meaning small changes in input can produce large changes in output. This has direct implications for robot calibration and control: poorly conditioned matrices amplify measurement noise and can cause numerical instability in inverse kinematic computations.
The determinant $\det(\mathbf{A})$ reveals whether a matrix is invertible (nonzero determinant) and, for rotation matrices, whether orientation is preserved ($\det(\mathbf{R}) = +1$) or reflected ($\det(\mathbf{R}) = -1$). The sign of the determinant also indicates whether a coordinate transformation preserves or reverses handedness—a critical consideration when attaching sensors or tools to robotic systems.
Matrix decomposition techniques break complex matrices into simpler components that reveal structure and enable efficient computation. The LU decomposition $\mathbf{A} = \mathbf{L}\mathbf{U}$, where $\mathbf{L}$ is lower triangular and $\mathbf{U}$ is upper triangular, is fundamental to solving linear systems $\mathbf{A}\mathbf{x} = \mathbf{b}$. For symmetric positive definite matrices common in robot dynamics (mass matrices, inertia tensors), the Cholesky decomposition $\mathbf{A} = \mathbf{L}\mathbf{L}^T$ offers computational advantages, requiring roughly half the operations of LU decomposition.
Eigenvalues and Eigenvectors
For a square matrix $\mathbf{A} \in \mathbb{R}^{n \times n}$, an eigenvalue $\lambda \in \mathbb{C}$ and corresponding eigenvector $\mathbf{v} \neq \mathbf{0}$ satisfy the fundamental equation:
$$\mathbf{A}\mathbf{v} = \lambda \mathbf{v}$$
Rearranging yields $(\mathbf{A} - \lambda\mathbf{I})\mathbf{v} = \mathbf{0}$, which has nontrivial solutions only when $\det(\mathbf{A} - \lambda\mathbf{I}) = 0$. This characteristic polynomial has degree $n$ and yields exactly $n$ eigenvalues (counting multiplicities).
Eigenvalues appear throughout robotics for their physical significance. In rigid body dynamics, the inertia tensor $\mathbf{I}$ has three eigenvalues representing the principal moments of inertia—resistances to rotation about three orthogonal axes through the center of mass. These principal axes simplify dynamic equations and reveal fundamental properties of the body independent of coordinate system choice.
In control theory, the eigenvalues of the system matrix determine stability. A linear system $\dot{\mathbf{x}} = \mathbf{A}\mathbf{x}$ is stable (all state variables decay to zero) if and only if all eigenvalues of $\mathbf{A}$ have negative real parts. For robot control, this determines whether a PD controller will stabilize a manipulator or cause oscillatory or divergent behavior.