Foundations of Robotics and Mathematical Prerequisites
The field of robotics represents one of the most ambitious undertakings in the history of engineering, combining insights from mechanical design, electrical systems, computer science, and applied mathematics to create machines capable of interacting meaningfully with the physical world. Unlike software that executes purely within the abstraction of computation, robots must bridge the gap between digital decision-making and physical action, sensing their environment, reasoning about their surroundings, and executing motions that affect the real world. This chapter establishes the conceptual and mathematical foundations necessary for understanding how robotic systems function, laying the groundwork for the sophisticated perception, planning, and control algorithms explored throughout this book.
The journey toward understanding robotic intelligence begins with recognizing that a robot is fundamentally an agent—a system that perceives its environment through sensors, processes information to decide on courses of action, and executes those decisions through actuators that modify its state or affect the world around it. This perceive-plan-act cycle forms the conceptual backbone of virtually all robotic systems, from the simplest industrial manipulators to the most advanced autonomous vehicles navigating complex urban environments. The elegance of this framework lies in its universality: whether we are discussing a robot arm assembling components on a factory floor or a humanoid robot navigating a disaster site, the underlying architectural principles remain remarkably consistent.
Understanding robotics requires fluency in several mathematical domains that may initially seem distinct but prove deeply interconnected in practice. Linear algebra provides the language for describing spatial relationships, robot configurations, and the transformations that map between different coordinate frames. Probability theory addresses the fundamental reality that sensors are noisy, environments are uncertain, and perfect knowledge is never available. Together, these mathematical tools enable the design of systems that can function robustly despite the inherent unpredictability of the physical world.
Vectors and Matrices: The Language of Robotic Mathematics
Vectors and matrices form the algebraic foundation upon which virtually all robotic computation rests. A vector represents an ordered collection of numbers that can describe quantities with multiple components—robot joint angles, spatial positions, velocities, or forces. In this book, we adopt the convention that vectors are column vectors by default, written as:
$$\mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix}$$
Row vectors, when needed, are expressed as the transpose of column vectors: $\mathbf{v}^T = [v_1, v_2, \ldots, v_n]$. This distinction matters significantly in matrix multiplication, where the dimensions must align appropriately: an $m \times n$ matrix can multiply an $n$-dimensional column vector to produce an $m$-dimensional result.
Matrices extend these concepts to represent linear transformations and systems of equations. A rotation matrix, for instance, is a special orthogonal matrix $\mathbf{R} \in \mathbb{R}^{3 \times 3}$ that satisfies the conditions $\mathbf{R}^T \mathbf{R} = \mathbf{I}$ and $\det(\mathbf{R}) = 1$. These constraints ensure that rotation matrices preserve distances and orientations, making them ideal for describing how points transform when a robot moves through space. Consider a point with coordinates $\mathbf{p} = [x, y, z]^T$ in some reference frame. After a rotation by angle $\theta$ about the z-axis, the point's coordinates in the rotated frame are given by:
$$\mathbf{p}' = \mathbf{R}_z(\theta) \mathbf{p} = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix}$$
The matrix operations essential for robotics include matrix addition, scalar multiplication, matrix multiplication, transposition, and inversion. Matrix addition requires matrices of identical dimensions, combining corresponding elements. Scalar multiplication multiplies every element by a constant value. Matrix multiplication, however, follows the rule that an $(m \times n)$ matrix multiplying an $(n \times p)$ matrix produces an $(m \times p)$ result, with each element computed as the dot product of a row from the first matrix with a column from the second:
$$[\mathbf{A}\mathbf{B}]_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}$$
This operation is not commutative—generally $\mathbf{A}\mathbf{B} \neq \mathbf{B}\mathbf{A}$—a fact that becomes critically important when working with sequential transformations, where the order of operations fundamentally affects the result.
The transpose of a matrix, denoted $\mathbf{A}^T$, swaps rows and columns such that element $(i, j)$ becomes element $(j, i)$. For rotation matrices, the transpose equals the inverse, a property that follows from orthogonality: $\mathbf{R}^T = \mathbf{R}^{-1}$. This means that to reverse a rotation, we simply multiply by the transpose rather than computing a potentially expensive inverse.
Matrix inversion, when applicable, produces the unique matrix $\mathbf{A}^{-1}$ such that $\mathbf{A}\mathbf{A}^{-1} = \mathbf{A}^{-1}\mathbf{A} = \mathbf{I}$. Not all matrices are invertible; a matrix must be square and have full rank (linearly independent rows and columns) to possess an inverse. In robotics, we frequently encounter matrices that are nearly singular—having determinants close to zero—which can cause numerical instability in inversion. These situations often arise near singular configurations of robot arms, where small movements in joint space can produce large movements in the workspace, presenting challenges for both analysis and control.
Beyond these basic operations, robotics requires familiarity with several specialized matrix types and concepts. Symmetric matrices, where $\mathbf{A} = \mathbf{A}^T$, appear naturally when representing inertias and quadratic cost functions. Positive definite matrices, which satisfy $\mathbf{x}^T \mathbf{A} \mathbf{x} > 0$ for all nonzero vectors $\mathbf{x}$, characterize physical systems where energy must be positive. Skew-symmetric matrices, where $\mathbf{A}^T = -\mathbf{A}$, provide a compact representation for cross products through the hat operator: given a vector $\boldsymbol{\omega} = [\omega_x, \omega_y, \omega_z]^T$, its skew-symmetric form is:
$$\hat{\boldsymbol{\omega}} = \begin{bmatrix} 0 & -\omega_z & \omega_y \\ \omega_z & 0 & -\omega_x \\ -\omega_y & \omega_x & 0 \end{bmatrix}$$
This representation proves invaluable when working with angular velocities and the derivatives of rotation matrices.
Probability Theory for Robotics
The physical world is fundamentally uncertain. Sensors introduce noise into measurements, actuators exhibit imperfect repeatability, and environments change in unpredictable ways. Probability theory provides the mathematical framework for reasoning about these uncertainties, enabling robots to make sensible decisions even when information is incomplete or noisy.
A random variable represents a quantity whose value is determined by a random process. Discrete random variables take values from a countable set, described by a probability mass function (PMF) that assigns probabilities to each possible outcome. Continuous random variables, by contrast, can take any value within a range and are described by a probability density function (PDF) such that the probability of the variable falling within any interval equals the integral of the density over that interval.
The Gaussian distribution, also called the normal distribution, plays a particularly prominent role in robotics due to both its mathematical tractability and its empirical relevance to many physical phenomena. A univariate Gaussian distribution with mean $\mu$ and variance $\sigma^2$ has the probabil