Robots can take on a wide variety of forms: they may have rigid or flexible structures, rely on different types of actuators for control, perceive their surroundings through diverse sensing modalities, or even exist as purely virtual agents. Despite this variety of embodiments, nearly all robotic systems share a fundamental characteristic—they are dynamic agents whose states evolve over time. The most immediate example of robot dynamics is physical motion, encompassing changes in position, velocity, joint configurations, and sensor orientations. A deep understanding of the dynamical properties of a robotic system is essential to its effective design and control. For instance, building a bipedal robot capable of walking or running requires detailed modeling of its motion to ensure that the mechanical structure and actuators can withstand the forces and torques involved. Accurate dynamic models are also critical for designing control strategies that achieve stable, efficient, and responsive locomotion.
This chapter introduces several foundational topics in modeling robotic systems. We will start with Section 1.1 by introducing the concept of a state space model, which provides a mathematical framework to describe the behavior of a robot’s state over time. Next, in Section 1.2, we will detail how a robot’s kinematics and dynamics are used to derive these state space models, focusing on the principles that govern physical motion and constraints. We will then explore specific motion models for wheeled robots in Section 1.3, including the unicycle and differential drive models, to illustrate practical applications of these concepts. Finally, in Section 1.4, we will discuss computational techniques for simulating robot dynamics, emphasizing numerical integration methods such as the Euler and Runge-Kutta methods to approximate and analyze the time evolution of robotic systems.
1.1 State Space Models
A state space model is a mathematical framework for describing the behavior of a dynamical system. Every state space model consists of two key components: a state and a model.
Definition 1.1 (State).
The state of a dynamical system at time is a minimal set of variables such that, given the control input for all , the future evolution of the system’s state for all is uniquely determined, independently of the system’s behavior for .
Formally, the state is a sufficient statistic of the system’s history: given the current state and the external inputs to the system, the system’s future behavior is fully determined, independently of how that state was reached. The state of a robotic system can be finite or infinite-dimensional. For example, a simple mobile robot with a rigid body can be represented by a finite and low-dimensional state (e.g., the position and velocity of its center of mass), whereas a flexible robot might require an infinite-dimensional state to describe the continuous deformation of its body (e.g., a deflection function that describes the displacement at every point along the robot’s length).
When modeling the dynamics of a robot, it is important to define the state in a way that aligns with the specific goals and requirements of the application. In practice, the complexity of the state representation can often be reduced by omitting parts of the robot’s dynamics that are irrelevant to the problem at hand. For instance, in developing software to enable an autonomous car to navigate urban environments, it may be sufficient to model only its position, orientation, and velocity, while abstracting away the internal mechanics of the engine, tires, or suspension. Conversely, if the car is being designed for high-performance racing, these specifics become critical to accurately capture and optimize its behavior. Throughout this book, we focus on applications where the state is finite-dimensional and represent it as a vector , referred to as the state vector.
The second key component of a state space model is the model itself, which defines the rules and equations governing the evolution of the state over time by relating it to a set of inputs and outputs.
The inputs to a model refer to external factors or control signals that influence the behavior of the system.††margin: The term input is used interchangeably with control and action in different domains of robotics. These can include forces, torques, voltages, commands, or any other external stimuli that drive the system’s dynamics. As with the state, the dimensionality of the input may vary, but throughout this book we assume the input is represented by a finite-dimensional vector, .
The outputs of a model are the observable variables or measurements derived from the system. These typically come from sensors or other measurement devices that capture data reflecting the system’s state and behavior. For example, a robot equipped with a global navigation satellite system (GNSS) sensor may directly measure its position but not its heading. In some cases, the relationship between the state and the output is complex—for example, the connection between a robot’s inertial pose and a red-green-blue-depth (RGB-D) camera image. The process of inferring the state from the outputs is referred to as state estimation, and it will be explored in detail in Chapters Chapter 11 - Chapter 15. We assume the output is finite-dimensional and denote it by the vector .
Definition 1.2 (Model).
A model describes the evolution of a dynamical system through two types of equations: state equations and observation equations. The state equations specify how the state evolves as a function of the current state and inputs, while the observation equations define how the state influences the measurable outputs.
State equations are typically modeled as differential equations††margin: Ordinary differential equations are most commonly used to model robotic systems. However, partial differential equations may be needed for more complex cases, such as systems with flexible or deformable structures, where dynamics vary over both space and time. describing the changes in the state with respect to an independent variable, usually time:
| (1.1) |
where is the time derivative of the state vector , and is the dynamics function of the system.
Observation equations take the form:
| (1.2) |
where denotes the output at time , and is a function that relates the state and inputs to the system’s output.
Together, the definitions of the state , input , output , and Equations (Equation 1.1) and (Equation 1.2), form the state space model††margin: In some contexts, it may be convenient to represent the evolution of a system using discrete-time difference equations. As we will discuss in Chapter 2, discrete-time models are particularly well-suited for systems that naturally evolve in discrete steps, or for approximating continuous-time systems within computational frameworks. .
Throughout this book, we assume that time is the independent variable and simplify our notation by writing in place of for time-dependent variables. Accordingly, we use to represent time derivatives, for second derivatives, and for higher-order derivatives.
In summary, state space models provide a powerful formalism for modeling, analyzing, and controlling robotic systems. Mastering and effectively utilizing state space models is crucial for advancing robotic capabilities, enabling systems to autonomously navigate, interact, and adapt in dynamic and complex environments.
1.1.1 Types of State Space Models
State space models, as represented in Equation 1.1 and Equation 1.2, can be classified based on two key properties: linearity and time-invariance.
A model is said to be time-invariant if the functions and do not explicitly depend on time ; otherwise, it is time-varying. A model is said to be linear††margin: Often referred to as a linear system. if the functions and are linear functions of both the state and control . More generally, a system is linear if it satisfies the superposition principle, which states that the response to a linear combination of inputs is the corresponding linear combination of the individual responses. Formally, if and are solutions corresponding to inputs and , respectively, then for any scalars , the trajectory is a solution corresponding to the input . If this property does not hold, the system is said to be nonlinear.
Example 1.1.1 (Linear time-invariant model).
Consider the system:
This model is linear and time-invariant because the functions describing the system depend linearly on and and there is no explicit time dependence.
Example 1.1.2 (Nonlinear time-varying model).
Consider the system:
This model is nonlinear due to the quadratic output term , and it is also time-varying because the state equation explicitly depends on time through the term . Note, however, that the state equation is linear, as it satisfies the superposition principle with respect to and . Therefore, the nonlinearity in this system arises solely from the output equation, not from the state dynamics.
Linear models and their standard form.
Linear models are particularly important due to their analytical tractability and widespread applicability. They are commonly expressed in a standard matrix form:
| (1.3) |
where the matrices are of appropriate dimensions and define the linear relationships for the state dynamics and the output. We refer to the matrix as the dynamics matrix, as the control matrix, as the output or sensor matrix, and as the direct or feed-forward matrix††margin: If the matrices and are time-invariant, we have a Linear Time-Invariant (LTI) system, which is a cornerstone of control theory. .
Despite the inherent nonlinear nature of many real-world systems, linear models are often employed due to their simplicity and ease of manipulation. A common practice is to approximate nonlinear systems with linear models around specific operating points using a technique known as linearization. As we will discuss in Chapter 3, this approach simplifies analysis and control design, making linear models a fundamental tool in engineering and control theory.
1.1.2 Converting Higher-Order Models Into State Space Form
The state space model, as described by Equation 1.1, is represented by first-order differential equations. However, many robotics applications involve higher-order differential equation models, such as those governing the dynamics of robotic arms or wheeled robots. To analyze and control these systems in a unified framework, we can convert higher-order models into first-order state space form by introducing additional state variables.
Consider a linear -th order differential equation:
| (1.4) |
where are constants and is the state variable. To convert this differential equation into state space form, that is, a set of first-order differential equations, we can define an -dimensional state vector:
Given that , , and so on, we can express the higher-order differential equation as a system of first-order state space equations:
In this particular case, the model is linear, so it can be represented in matrix form:
Let us consider a practical example of this technique:
Example 1.1.3 (Converting Newton’s second law to state space form).
Many robotic systems, such as robotic arms and wheeled robots, involve dynamics that can be described by Newton’s second law. Understanding how to convert these higher-order dynamics into state space form is crucial for controlling and analyzing numerous robotics systems.
Newton’s second law describes the acceleration response of a mass resulting from a force :
where represents the one-dimensional positional displacement of the mass. Newton’s second law, in this form, is a classic example of a double integrator system††margin: In control theory, a double integrator describes a system in which the output (here, the position ) is obtained by integrating the input (acceleration) twice. .
To convert this second-order differential equation into state space form, we first define the state vector:
Then, we represent the dynamics in state space form:
where represents the applied force . By defining the state vector and expressing the original second-order differential equation in this manner, we have effectively transformed it into a set of first-order differential equations.
1.2 Kinematics and Dynamics
Understanding a robot’s physical motion is essential for enabling its autonomous operation. For instance, it is crucial to determine how an autonomous vehicle’s actions, such as adjusting throttle and steering, affect its state and interaction with the environment. Similarly, it is important to understand how a robot manipulator’s movements impact its ability to manipulate objects. A crucial aspect of this understanding involves the concepts of kinematics and dynamics, which govern the robot’s physical motion and the constraints it must adhere to.
Definition 1.1 (Kinematics).
Kinematics is the study of the motion of physical systems, concerned with describing positions, velocities, and accelerations over time, without reference to the forces or torques that produce the motion.
A robot’s kinematics outline limitations on its motion that are determined by its physical state or geometry. These constraints arise from the physical structure of the system, such as joint limits, actuator placement, linkage geometry, and the ways in which different components are mechanically connected. They determine how the system can move, independent of any external forces. For example, consider a wheeled robot. Static friction restricts the wheels from sliding laterally, meaning they cannot move in the direction parallel to the rotation axis. This kinematic constraint significantly limits the robot’s ability to navigate and affects its overall maneuverability. By understanding these constraints, one can better grasp the feasible movements of the robot within its environment, which in turn informs how it can effectively interact with the world around it.
Definition 1.2 (Dynamics).
Dynamics is the study of the motion of physical systems as determined by the forces and torques acting upon them. It seeks to relate a system’s motion to the underlying physical causes of that motion, such as gravity, friction, or applied inputs.
In the context of robotic or mechanical systems, dynamics are typically governed by Newton’s Second Law, which states that the acceleration of a body is proportional to the net force acting on it. For example, the dynamics of an autonomous vehicle are described by the relationship between its acceleration and the external forces acting on it, including tire-road interaction, gravitational effects on slopes, and aerodynamic drag.
From the definitions above, kinematics describe constraints that arise from the robot’s physical state or geometry, whereas dynamics explain how forces or inputs influence the robot’s motion. In this section, we first introduce the concept of generalized coordinates for defining the physical configuration of a robot and discuss how the robot’s kinematics and dynamics can be expressed in terms of these coordinates. Then, we will demonstrate how to use the system’s kinematics and dynamics to define a state space model for the robot’s physical motion. In the following chapters, we will explore how these models are applied to develop robust and high-performing algorithms for motion planning and control.
1.2.1 Generalized Coordinates
A robot’s physical state, also referred to as its configuration, provides a complete specification of the position of every point on the robot at a given instant 44. Lozano Perez, T. “Spatial planning: a configuration space approach.” In Autonomous Robot Vehicles, 1990.. A configuration can be represented using a set of variables known as generalized coordinates, denoted by . Generalized coordinates form a set of parameters that uniquely describe the robot’s configuration relative to a reference frame. Depending on the system, they may include joint angles, Cartesian positions, orientations, or other parameters defining the robot’s physical arrangement††margin: The terms “configuration” and “generalized coordinates” are often used interchangeably. However, while the configuration refers to the robot’s physical arrangement in space, generalized coordinates are a specific mathematical representation of that arrangement. Multiple choices of generalized coordinates may represent the same configuration. .
Importantly, the configuration, namely the generalized coordinates, typically constitutes only a part of the full system state . As discussed in previous sections, in a state-space model, the state is a complete set of variables sufficient to determine the system’s future evolution, given an external input. This usually includes both the generalized coordinates and their time derivatives, called generalized velocities, denoted as . In some systems, the state may also include additional internal variables such as actuator dynamics, sensor states, or environmental parameters.
Example 1.2.1 (Rolling Wheel).
The configuration of a wheel rolling on a plane, as illustrated in Figure 1.1, can be represented by three parameters: the contact point position coordinates and the heading angle relative to a fixed reference frame. This set of parameters, , constitutes just one possible choice of generalized coordinates to define the wheel’s configuration. Alternatively, the configuration could also be represented using the heading angle along with a polar coordinate representation of the contact point position.
1.2.2 Kinematic Constraints
Once a specific set of generalized coordinates, , is chosen to represent a robot’s configuration, we can identify the relevant kinematic constraints for the robot. These kinematic constraints establish relationships between the generalized coordinates and the generalized velocities, thereby describing the limitations on the robot’s motion. We refer the reader to Siciliano et al. (2008)11. Siciliano, Bruno, Sciavicco, Lorenzo, Villani, Luigi, Oriolo, Giuseppe. Robotics: Modelling, Planning and Control. Springer Publishing Company, Incorporated, 2008. for a comprehensive treatment of robotic kinematics and the formulation of the associated constraint equations.
Definition 1.3 (Kinematic Constraints).
Kinematic constraints are a set of constraints imposed on the generalized coordinates, , and generalized velocities, . We express kinematic constraints mathematically as:
| (1.5) |
where is the number of constraints and is the number of generalized coordinates.
In many robotics applications, kinematic constraints are linear with respect to the generalized velocities. These are known as Pfaffian constraints, and can be mathematically expressed as:
| (1.6) |
where . Pfaffian constraints can also be compactly represented in matrix form as:
| (1.7) |
where .
Example 1.2.2 (Pendulum).
Figure 1.2 shows a simple pendulum with a point mass and a rigid, massless, rod that rotates about a fixed pivot point. We can choose to represent the configuration of the pendulum by the Cartesian coordinate position of the mass, assuming the pivot point is the reference frame origin. The generalized coordinate vector for this choice is , and the generalized velocity vector is . The fact that the rod connecting the pivot point to the mass is rigid introduces a restriction on the motion of this system, which we represent by the kinematic constraint:
| (1.8) |
where is the length of the rod. While this constraint is not in Pfaffian form, we can equivalently express it as a Pfaffian constraint by noting that:
For the pendulum kinematic constraint in Equation 1.8, we have:
and therefore we can write the constraint in the Pfaffian form of Equation 1.6 with:
| (1.9) |
The Pfaffian constraint in Equation 1.9 implies that Equation 1.8 holds as long as the pendulum starts in a state satisfying .
An alternative choice of generalized coordinates to represent the pendulum’s configuration is to consider the angle between the vertical and the pendulum’s rod orientation, . This choice fully specifies the configuration without requiring us to define any kinematic constraints, making it a more natural choice for this system. Note that since and the kinematic constraint in Equation 1.8 is trivially satisfied for all .
Example 1.2.3 (Rolling Wheel).
Consider the wheel illustrated in Figure 1.1, which we can represent with the generalized coordinates . For this system, we can assume that the friction at the contact point between the wheel and the surface induces a no-slip condition. This no-slip condition is a constraint on the motion of the wheel that restricts the velocity component of the wheel in the lateral direction to always be zero. Since the unit vector describes the heading of the wheel, the lateral direction is given by the perpendicular unit vector . We can compute the lateral velocity from the dot product of the lateral direction unit vector and the velocity vector, , which gives the no-slip kinematic constraint:
| (1.10) |
This constraint is linear in the generalized velocities, , and therefore is a Pfaffian constraint.
1.2.3 Holonomic and Nonholonomic Constraints
Kinematic constraints often fall into two categories: holonomic or nonholonomic, depending on how they restrict the motion of the system. Holonomic constraints can be expressed solely as functions of the generalized coordinates, without involving generalized velocities. In contrast, nonholonomic constraints involve the generalized velocities and cannot be expressed solely in terms of the generalized coordinates.
Definition 1.4 (Holonomic Constraints).
Kinematic constraints that can be expressed in the form:
| (1.11) |
are called holonomic.
In robotics applications, holonomic constraints generally arise due to mechanical interconnections, such as rigid links and joints of a robotic arm. We refer to a system that is only subject to holonomic constraints as a holonomic system. These constraints are a unique subclass of kinematic constraints that restrict the accessible configurations of the system. Specifically, for a system with generalized coordinates under holonomic constraints, the dimension of the space of accessible configurations is . Holonomic constraints can always be equivalently expressed as Pfaffian constraints of the form Equation 1.6. This is because:
and by differentiating the expression:
| (1.12) |
as we demonstrated in Example 1.2.2. However, it is important to note that not all Pfaffian constraints are holonomic. For a Pfaffian constraint to be holonomic, it must be integrable to the form in Equation 1.11. Specifically, there must exist a scalar function such that:
| (1.13) |
This implies that the Pfaffian constraint, when integrated, yields a constraint solely dependent on the generalized coordinates , without any explicit dependence on their time derivatives .
Example 1.2.4 (Pendulum).
Consider the pendulum from Example 1.2.2. The kinematic constraint in Equation 1.8 restricts the pendulum mass to lie on a circle of radius , which is a subset of all possible generalized coordinates. This constraint is holonomic since we can express it as a function of only the generalized coordinates.
Example 1.2.5 (Rolling Wheel).
Consider the wheel from Example 1.2.3, where the kinematic constraint in Equation 1.10 restricts the direction of motion. In contrast to the pendulum, this constraint does not limit the wheel’s ability to reach any configuration of generalized coordinates, namely the position and heading. Mathematically, we cannot integrate the constraint in Equation 1.10 to yield a constraint of the form , and thus this constraint is not holonomic.
While holonomic constraints restrict the system’s accessible configurations, kinematic constraints can also limit the motion between configurations. We refer to these constraints as nonholonomic constraints. A system that is subject to at least one nonholonomic constraint is referred to as a nonholonomic system.
Definition 1.5 (Nonholonomic Constraints).
Constraints that can be described in Pfaffian form, , but cannot be integrated to the form are called nonholonomic.
That is, the Pfaffian expressions cannot be written as the total time derivative of any scalar function that depends only on the generalized coordinates. In other words, there exists no scalar function such that . Geometrically, nonholonomic constraints restrict the instantaneous generalized velocities to lie in the null space of , where is the matrix whose rows are the vectors corresponding to each nonholonomic constraint.
Example 1.2.6 (Rolling Wheel).
Consider the wheel example from Example 1.2.3, which has a nonholonomic constraint:
The null space of in this case is spanned by the vectors and , which suggests that all motion must be made up of a linear combination of these vectors. Intuitively, we expect this because is the rolling direction and is the axis the wheel rotates about.
In summary, holonomic constraints restrict a system’s motion by confining its configurations to lower-dimensional manifolds—specifically, level sets defined by scalar equations of the form . For a system with generalized coordinates and independent holonomic constraints, the configuration space is effectively reduced to a manifold of dimension . This reduction reflects a true loss of accessibility in the configuration space: the system can only evolve along a restricted subset of configurations determined by the initial conditions and the constraint equations. In contrast, nonholonomic constraints act directly on the system’s instantaneous velocities, typically expressed in Pfaffian form as , where is a full-rank matrix of dimension . These constraints restrict the allowed directions of motion at each configuration by confining to lie in an -dimensional subspace. However, since nonholonomic constraints are not integrable, they do not reduce the dimensionality of the configuration space itself. That is, although motion is constrained at each instant, the system may still be able to reach any configuration in the configuration space through admissible trajectories that respect the velocity constraints. Thus, while holonomic constraints reduce the number of independent configuration variables and confine the system to a lower-dimensional subset of the configuration space, nonholonomic constraints preserve full accessibility of the configuration space but restrict how that space can be traversed.
1.2.4 Kinematic Models
Once we have chosen an appropriate set of generalized coordinates and have identified the relevant kinematic constraints, we can convert the kinematic constraints into a state space model of the form in Equation 1.1, which we refer to as a kinematic model.
Definition 1.6 (Kinematic Model).
Given a generalized coordinate vector , and Pfaffian constraints††margin: These Pfaffian constraints can come from a combination of holonomic and non-holonomic constraints. , , a kinematic model is a state space model of the form:
| (1.14) |
where is the input and where the column space of spans the null space of .
Each input in corresponds to one degree of freedom of the system, and for any initial condition and sequence of inputs the solutions to the kinematic model are guaranteed to satisfy the Pfaffian constraints. We can prove that the trajectories of the kinematic model will satisfy the Pfaffian constraints by writing the model in the equivalent form:
where is the -th column of and is the -th input. In this form, we can more easily see that each input acts on the generalized velocity through a particular mode that is defined by the vector . Since we have specified in Definition 1.6 that the column space of spans the null space of , we know that by definition:
for any input and for all coordinates . Therefore, by definition each component of the input vector can only influence the generalized velocity in a way that satisfies the Pfaffian constraints. Another way to see this mathematically is by substituting the kinematic model into the Pfaffian constraint equation:
Example 1.2.7 (Rolling Wheel).
Consider the rolling wheel example from Example 1.2.3, which has a single nonholonomic constraint:
where . The null space of is spanned by the vectors and and therefore the kinematic model is given by:
| (1.15) |
In this case, the inputs and have an intuitive physical meaning: is the speed at which the wheel is moving, and is the wheel’s angular rotation rate.
1.2.5 Dynamics Models
Kinematic models describe the geometric constraints that limit a robot’s motion—for example, the fact that a robotic arm can only rotate about its joints. However, kinematics alone does not explain how motion is generated or resisted. For that, we turn to dynamics, which describe how forces and torques influence motion by producing accelerations.
Newton’s second law of motion is the foundation of robot dynamics, relating the net force acting on a body to its acceleration. Applied to a single point mass, the law takes the form:
| (1.16) |
where is the mass of the particle, is its position vector, and is the total force acting on the particle.
Example 1.2.8 (Mass-spring-damper system).
A fundamental example in the study of dynamics is the one-dimensional mass-spring-damper system. The system consists of a mass attached to a spring and a damper, constrained to move along a line. The total force acting on the mass is typically composed of three terms:
-
1.
an external input force ,
-
2.
a spring force that resists displacement from the equilibrium position, and
-
3.
a damping force that resists velocity.
The net force on the mass is:
where and are the spring and damping coefficients, respectively, and is the displacement from equilibrium. Substituting this expression into Newton’s second law yields the following second-order differential equation:
This equation models oscillatory motion with damping, and it arises in many robotics applications—for example, when analyzing joint compliance, actuator dynamics, or contact interactions.
While the mass-spring-damper system illustrates the dynamics of a single particle in one dimension, real-world robotic systems are often more complex. To capture their behavior, we extend Newton’s second law to systems of interconnected particles, typically modeled in robotics as rigid bodies. A rigid body is an idealized object in which the relative positions of all constituent particles remain fixed over time, regardless of external forces. This assumption implies that the body does not deform and allows us to reduce a complex system of interacting particles to a simpler model governed by the motion of a finite set of parameters, for example, position and orientation of a frame fixed to the body. As a result, rigid body dynamics provide a powerful and tractable framework for analyzing and simulating robotic systems††margin: Interesting examples in robotics where the rigid body assumption may not hold include soft robots, robots with compliant end-effectors, or robots with lightweight flexible structures. .
The motion of a rigid body in three-dimensional space can be described in terms of its translational and rotational dynamics. Translational dynamics govern the motion of the body’s center of mass and are described by Newton’s second law, as expressed in Equation 1.16, where the position variable refers specifically to the center of mass. In three-dimensional space, a rigid body has three translational degrees of freedom, corresponding to movement along each of the Cartesian axes. Rotational dynamics, on the other hand, describe how the body’s orientation evolves over time. A rigid body also has three degrees of freedom associated with its orientation in three-dimensional space, corresponding to rotation about each of its principal axes. Unlike translation, orientation cannot be represented by a single vector, and several parameterizations are commonly used. Notable examples include rotation matrices, which provide a full and unambiguous representation at the cost of redundancy; Euler angles, which use a sequence of three rotations to represent orientation, and quaternions, which offer a compact and singularity-free alternative well-suited for numerical applications.
The rotational dynamics††margin: We refer the reader to Shuster (1993)22. Shuster, M. D. “Survey of attitude representations.” Journal of the Astronautical Sciences 41(4), 439-517, 1993. for an in-depth treatment of rotational dynamics and attitude representations. of a rigid body are governed by the time evolution of its angular momentum. Specifically, they are described by:
| (1.17) |
where denotes the total external moment (or torque) acting on the body, and is the angular momentum, typically computed about the center of mass. This relationship is commonly referred to as Euler’s equation for rotational dynamics and captures how applied torques influence changes in the body’s rotational motion.
An alternative to the Newton-Euler method—defined by Equations (Equation 1.16)-(Equation 1.17)—for deriving the equations of motion for a rigid body is the Lagrange Method. This approach is closely tied to the notion of generalized coordinates, generalized velocities, and kinematic constraints, and takes an energy-based approach. In the Lagrange method, the dynamics of a rigid body are derived from a scalar quantity called the Lagrangian, defined as the difference between the kinetic and potential energies:
| (1.18) |
where and denote the kinetic and potential energies of the system, respectively. The evolution of the system is governed by Lagrange’s equations 55. Siciliano, B., Sciavicco, L., Villani, L., Oriolo, G. Robotics: Modelling, Planning and Control. Springer Publishing Company, Incorporated, 2008.66. Lynch, K. M., Park, K. C. Modern Robotics: Mechanics, Planning, and Control. Cambridge University Press, 2017., which incorporate both external influences and kinematic constraints. In the absence of constraints, the equations of motion are given by:
| (1.19) |
where is a non-conservative generalized force associated with the generalized coordinate ††margin: Generalized forces are projections of physical forces and torques into the generalized coordinate space. Forces not derived from a potential—such as friction—are termed non-conservative. In contrast, forces like gravity are conservative. , and corresponds to the system’s degrees of freedom. Equations (Equation 1.19) describe how the generalized forces acting on the system relate to its position, velocity, and acceleration, providing a systematic way to derive the system’s dynamic model from its kinetic and potential energies.
In the presence of Pfaffian constraints††margin: While Lagrange’s method can accommodate general constraints, we focus here on Pfaffian constraints for simplicity. , Lagrange’s equations take the form:
| (1.20) |
where is the -th component of the -th Pfaffian constraint vector and is a Lagrange multiplier. The first equations describe the dynamics of the generalized coordinates under the influence of both external and constraint forces, while the remaining equations represent the kinematic constraints themselves. The complete system thus comprises equations in unknowns (the generalized coordinates and the Lagrange multipliers), and is commonly referred to as the standard non-holonomic form. If the system is holonomic and the generalized coordinates are chosen to be independent, the constraints are implicitly satisfied, and Lagrange’s equations reduce to the simpler, unconstrained form introduced in Equation 1.19.
Example 1.2.9 (Pendulum).
Consider again the pendulum depicted in Figure 1.2. To model its dynamics, we analyze how gravity drives the motion of the mass. Specifically, we will demonstrate four distinct approaches for deriving the equations of motion—using both Cartesian and polar coordinates, and applying both the Newton-Euler and Lagrange methods. This comparison will highlight how the choice of generalized coordinates can influence the complexity of the derivation.
We begin by using Newton’s second law to derive the dynamics of the pendulum, focusing on the two forces acting on the mass: gravity and the force from the rod. We assume that the rod’s force acts purely along its axis. Since the pendulum’s length is fixed, this force must counteract the component of gravity along the rod and generate the required centripetal acceleration. The axial force exerted by the rod is given by:
where is the mass of the pendulum, is gravitational acceleration, is the length of the rod, and is the speed of the mass. The gravitational force is:
acting along the negative -direction. To compute the net force in Cartesian coordinates, we project both the rod’s force and the gravitational force onto the - and -axes:
Applying Newton’s second law as defined in Equation 1.16 yields the equations of motion:
To express these equations purely in terms of Cartesian coordinates, we substitute and , leading to:
| (1.21) |
with . This method requires careful force analysis, as the kinematic constraint (fixed-length rod) is handled implicitly through the projected components of the rod’s force.
As a second approach to deriving the equations of motion using Cartesian coordinates, we now apply the Lagrange method, which yields a slightly simpler formulation. We begin by defining the kinetic and potential energies:
and observe that there are no external non-conservative generalized forces††margin: Gravity is a conservative force, so no generalized non-conservative forces appear. . As discussed in Example 1.2.2, we recall the system’s single Pfaffian constraint:
Thus, using Lagrange’s equations introduced in Equation 1.20, we obtain:
| (1.22) |
We can solve for the Lagrange multiplier by differentiating the constraint with respect to time:
and by substituting the expressions for and from the first two Lagrange’s equations in (Equation 1.22) to obtain:
Solving for yields:
where we used and . Finally, substituting the expression for back into the equations of motion and simplifying, we find:
| (1.23) |
which matches the result previously obtained using Newton’s method in Equation 1.21.
After applying both the Newton-Euler and Lagrange methods in Cartesian coordinates, we now replicate the derivation in polar coordinates. To apply Euler’s equation for rotational dynamics as given in Equation 1.17, we adopt a coordinate frame fixed at the pivot point. The gravitational force acting on the mass generates a moment about the pivot:
while the angular momentum of the system about the same point is:
where is the moment of inertia††margin: In Euler’s equation, the moment of inertia plays a role analogous to mass in Newton’s second law. about the pivot. Substituting into Euler’s equation yields the system dynamics:
| (1.24) |
which are considerably more compact than the corresponding equations derived in Cartesian coordinates.
The Lagrange method also becomes significantly simpler when using the polar coordinate , as there is no need to handle Pfaffian constraints explicitly. In this formulation, the kinetic and potential energies of the system are:
Applying Equation 1.20, and noting the absence of non-conservative generalized forces or constraints, we obtain the following equation of motion:
| (1.25) |
which, as expected, matches the result derived using Euler’s equation in Equation 1.24.
1.3 Wheeled Robot Motion Models
Robots are developed in diverse forms, sizes, and configurations, each featuring distinct mobility solutions tailored to specific applications. Among these, wheeled robots are particularly common because of their excellent mobility and simple design. In this section, we demonstrate how the concepts from the preceding sections can be applied to two classic and widely used motion models for simple wheeled robots: the unicycle model and the differential drive model.
1.3.1 Unicycle Model
The unicycle model is one of the simplest kinematic models used for modeling robot motion. This model leverages the kinematics of the rolling wheel discussed in Example 1.2.3, essentially assuming the robot is constrained only by a no-slip constraint from a single wheel. Figure 1.3 illustrates a simplified diagram of the generalized coordinates for the unicycle model.
The kinematic model is identical to the one presented in Equation 1.15, namely:
| (1.26) |
where represents the forward speed and denotes the rotational rate.
While the unicycle model may be a simplified representation of the robot’s true kinematics, it remains valuable in many contexts where detailed dynamics are unnecessary. Its main advantage lies in its simplicity, which often enables more computationally efficient algorithms. In practice, such lower-fidelity models are often used in the early stages of a system’s design or decision-making process, and are later refined or supplemented with more accurate models when higher precision is required.
1.3.2 Differential Drive Model
The differential drive model is a variation on the unicycle model from the previous section, with two wheels fixed on a shared rear axle and a passive front wheel that induces no additional kinematic constraints. This model uses the same generalized coordinates as the unicycle model, , but also requires the definition of certain geometric parameters: the width of the rear axle, denoted by , and the radius of the wheels, denoted by , as illustrated in Figure 1.4.
The differential drive model assumes the wheels roll without slipping, making the derivation of its kinematic constraints similar to that of a single rolling wheel, as discussed in Example 1.2.3. The heading vector of each wheel is given by , and the lateral direction is . Using the lateral direction vector, we define the no-slip kinematic constraints for the wheels as:
where and are the velocity vectors of the left and right wheels, respectively. Next, we express the wheel velocity vectors and as functions of the generalized coordinates and velocities by leveraging the robot’s geometry. The positions of the left and right wheel centers, denoted as and , respectively, can be computed from the generalized coordinates by:
Taking the time derivative of these positions yields the velocity vectors:
After some algebraic manipulation, we find that the no-slip kinematic constraints for each wheel are equivalent:
indicating that the no-slip constraint for both wheels is redundant, and thus the constraint matches the single wheel constraint from Example 1.2.3. This is intuitive because the wheels are rigidly connected; hence, if one wheel cannot move laterally, neither can the other. The kinematic model for the differential drive model is also identical to the single wheel model in Equation 1.26, but the inputs can now be expressed in a more realistic form relative to the actual geometry of the robot.
In particular, instead of using the forward speed and body rotation rate as inputs, as in Equation 1.26, the differential drive model uses the rotation rates of the left and right wheels, and . We can derive a relationship between these sets of inputs by considering the geometry of the robot and the no-slip wheel assumption. First, denote the position in terms of the wheel center positions by , thus the velocity vector is . By the no-slip wheel assumption, the velocity can be expressed as , leading to:
where is the radius of the wheel and and are the speeds of the left and right wheels, respectively. Additionally, the no-slip condition on each wheel is given by and , expanded as:
Since , we simplify these expressions to:
Combining these gives:
establishing the relationship between the generalized velocity and the wheel rotational speeds.
In summary, the mapping between the inputs can be defined as:
which allows us to define the differential drive model:
| (1.27) |
Despite the slight increase in complexity over the unicycle model, this model leverages the geometry of the robot to make the inputs more intuitive. This enhancement makes the differential drive model more suitable for certain motion planning and control tasks, as the robot’s actuation typically originates from motors attached to the wheels’ axles.
More generally, a kinematic state-space model should be interpreted only as a subsystem of a more comprehensive dynamical model. In particular, kinematic models typically assume direct control over certain motion variables—such as velocity or angular rate—without accounting for how these quantities are generated or constrained by the physical system. For more realistic modeling, it is often necessary to extend the kinematic model to include additional integrators in front of the control inputs.
Example 1.3.1 (Dynamic extension of the unicycle model).
The unicycle model introduced in Equation 1.26 assumes direct control over the forward velocity and angular velocity , with the state defined by the variables . To reflect the fact that velocity is itself the result of integrating an acceleration input , the model can be extended by treating as an additional state, yielding the augmented state and input . The dynamics become:
| (1.28) |
This dynamic extension accounts for acceleration as a control input and enables the modeling of more realistic scenarios, such as those involving actuation limits.
1.3.3 Bicycle/Simple Car Model
The bicycle model is a simplified kinematic model commonly used to approximate the motion of vehicles with two front-steered wheels and two rear-driven wheels, such as cars or mobile robots with similar geometry. The model captures key steering dynamics while assuming no slip at the contact points of the wheels. It is called a “bicycle” model because the two front wheels and two rear wheels are collapsed into a single front and rear wheel aligned on a common axis, forming a virtual two-wheeled vehicle. Compared to the unicycle and differential drive models introduced earlier, the bicycle model enforces more realistic kinematic constraints on how the system can turn. In particular, it captures the fact that the vehicle must steer to follow curved paths, and cannot rotate in place. As such, it provides a better approximation for many wheeled systems while still remaining relatively simple.
Figure 1.5 shows the simplified geometry of the bicycle model. This model can be derived by enforcing nonholonomic constraints on the rolling direction of each wheel and assuming ideal no-slip contact, following the discussion in previous sections. Figure 1.6 illustrates how the same kinematic model can be interpreted in the context of a four-wheeled vehicle. The key idea is that both front wheels steer with a common angle , and the vehicle moves forward with velocity , subject to the no-slip constraints. These assumptions lead to the following differential equations characterizing the car model:
| (1.29) |
where is the position of the rear axle center, is the heading angle, is the forward speed, is the steering angle, and is the length of the wheelbase (the distance between the front and rear axles). Therefore, we define the state as and the control input as .
1.4 Simulating Robot Dynamics
In Section 1.1, we introduced the concept of a state space model to mathematically describe the evolution of a robot’s state over time. In Section 1.2 we demonstrated how a robot’s kinematics and dynamics are used to derive a state space model that represents its physical motion. In this section, we present several computational techniques for simulating the changes in a robot’s state over time.
The state space model in Equation 1.1 is a general system of ordinary differential equations, which in most cases cannot be solved analytically. Numerical simulation provides a practical approach to obtaining approximate solutions, allowing us to better understand a robot’s dynamics and to test and validate algorithms for robot autonomy. Typically, when we refer to simulating a system, we mean approximately solving an initial value problem (IVP) for a system of differential equations, as defined in Equation 1.1:
where , and the input may either be explicitly defined as a known function of time (e.g., a predefined control sequence), or computed at each time step based on the current state.
The objective of this initial value problem is to find the trajectory , starting from , that satisfies the differential equation††margin: If is Lipschitz continuous in and continuous in , the trajectory exists and is unique. . By the Fundamental Theorem of Calculus††margin: This expresses the inverse relationship between differentiation and integration: integrating the derivative over time recovers the original function . , the solution at time can be written as:
In general, evaluating this integral analytically for arbitrary functions is intractable. Therefore, we typically resort to numerical integration methods that involve a discretization in time:
| (1.30) |
where define a time grid, and each interval has width . This decomposition breaks the continuous integration problem into a sum of smaller integrals over short intervals. Within each interval , we can then approximate the integral using various numerical quadrature rules—such as the Euler method, the Midpoint method, or higher-order Runge-Kutta schemes—which trade off computational cost and accuracy. In this section, we provide a concise introduction to some of the most widely used methods.
Example 1.4.1 (Simple IVP).
To illustrate the different numerical integration methods, we will consider the initial value problem defined below and presented in Algorithm 1.1 as an example:
Our goal is to approximate the trajectory over the interval using various integration methods.
Concretely, we will explore different techniques to approximate the following analytical solution:
which, for our specific initial conditions and , simplifies to:
1.4.1 Euler Method
One of the simplest techniques for approximating the integral within each time interval of the discretized problem, as shown in Equation 1.30, is the Euler method††margin: Named after the Swiss mathematician Leonhard Euler and often referred to as the forward Euler method. . This method approximates the integral over a short interval by evaluating the integrand at the beginning of the interval.
Given that the trajectory satisfies:
the Euler method approximates this integral by assuming is constant within the interval, yielding:
where is the time step.
This approximation corresponds to a first-order Taylor series expansion:
| (1.31) |
which treats the rate of change as constant across the interval.
Alternatively, the Euler method can be interpreted as a finite difference approximation of the time derivative:
While computationally inexpensive, the Euler method has limited accuracy due to its reliance on information from the beginning of each interval. The local truncation error††margin: That is, the error introduced in a single time step. is of order , and errors can accumulate significantly over long trajectories unless small time steps are used.
As a concrete illustration, consider the running example introduced in the referenced algorithm. A simple implementation of Euler’s method is presented in Algorithm 1.2.
1.4.2 Midpoint Method
The Midpoint method is a refinement of the Euler method that improves accuracy by evaluating the derivative at the midpoint of the time interval, rather than at its beginning. Recall that Euler’s method approximates the next state using the derivative evaluated at time :
In contrast, the Midpoint method approximates the integral by using the value of the derivative at :
| (1.32) |
While this yields a more accurate estimate, it is not yet explicit, since the value is not known in advance.
To resolve this, we approximate the midpoint using a single Euler step of size :
| (1.33) |
Substituting this estimate into Equation 1.32, we arrive at the explicit form of the Midpoint method:
The Midpoint method improves the local truncation error with respect to the Euler method from to , providing significantly better accuracy for small step sizes. The improvement comes at the cost of computing the derivative twice per step—once at the start of the interval and once at its midpoint.
As an illustration, a simple implementation for the running example introduced in the referenced algorithm is presented in Algorithm 1.3.
1.4.3 Runge-Kutta-4 Method
Both the Euler and Midpoint methods approximate the change in over a time step interval by evaluating the derivative at one or two specific points within the interval. The Runge-Kutta family of methods generalizes this idea by using multiple evaluations of the derivative to achieve higher accuracy. One of the most widely used methods in this family is the fourth-order Runge-Kutta method††margin: Often abbreviated as RK4. , which computes four derivative estimates over the interval :
where:
RK4 improves the local truncation error to , offering significantly better accuracy than the Euler or Midpoint methods. This comes at the cost of evaluating four times per step, but the method remains computationally efficient and stable for many practical applications.
Using the running example from the referenced algorithm, an implementation of RK4 is shown in Algorithm 1.4.
To compare the performance of these methods, we can visualize their outputs against the analytical solution:
It is important to highlight that advanced simulation techniques extend far beyond these numerical integration methods, allowing for the high-fidelity simulation of robotic systems, including visualization in pixel space. These techniques can incorporate detailed physical modeling, sensor data fusion, and learning-based approaches to create realistic and accurate simulations††margin: One notable example is the use of Neural Radiance Fields (NeRFs) for generating photorealistic scenes. . As we will discuss in later chapters on perception, these advancements are crucial for tasks such as robot training, planning under uncertainty, and evaluating the autonomy stack in novel and previously unseen scenarios.
1.5 Summary
In this chapter, we introduced the fundamental principles underlying the modeling and simulation of robotic systems. We began by introducing state space models, which provide a mathematical framework to describe the evolution of a robot’s state over time. Next, we discussed a robot’s kinematics and dynamics, which characterize its motion and the constraints acting on it. This included a discussion of generalized coordinates and kinematic constraints—both holonomic and nonholonomic—along with the formulation of kinematic models using Pfaffian constraints. Throughout this chapter, we examined practical examples such as the rolling wheel, the pendulum, and wheeled robots like the unicycle and differential drive models. Finally, we introduced numerical integration techniques for simulating robot dynamics over time. We presented the Euler, Midpoint, and Runge-Kutta methods, highlighting their trade-offs and applications through concrete code examples.
To learn more.
For readers interested in a deeper and more rigorous treatment of the concepts presented in this chapter, Siciliano and Khatib (2007); Siciliano et al. (2008)33. Siciliano, B., Khatib, O. Springer Handbook of Robotics. Springer-Verlag, 2007.
Siciliano, B., Sciavicco, L., Villani, L., Oriolo, G. Robotics: Modelling, Planning and Control. Springer Publishing Company, Incorporated, 2008. offer comprehensive and widely adopted references.
These texts cover the mathematical foundations of robot kinematics, dynamics, and control in greater depth, and provide additional examples, derivations, and exercises that complement and extend the material introduced here.
1.6 Exercises
The starter code for the exercises provided below is available online through GitHub. To get started, download the code by running in a terminal window:
We denote Problems requiring hand-written solutions and coding in Python with
and
, respectively.
Problem 1: Numerical Integration Methods
In the referenced algorithm we introduced a simple IVP and in Figure 1.7 we showed the differences between the Euler, midpoint, and fourth-order Runge-Kutta methods for solving it. In this exercise we will explore the use of a more advanced numerical integration scheme provided by the SciPy Python library called odeint. Open the notebook ch01/exercises/simulation.ipynb and practice by implementing the dynamics models for a damped pendulum and a bicycle, and then simulating them using odeint.
Problem 2: Nonholonomic Wheeled Robot Dynamics
The goal of this exercise is to familiarize yourself with some Python fundamentals that will be used throughout the book, such as NumPy and inheritance, as well as techniques for controlling nonholonomic wheeled robots.
Consider a simple robot with two wheels whose state is defined by the position of the center of the axle and the heading angle, shown in Figure 1.8. This robot’s motion can be described by the simplest nonholonomic wheeled robot model, the unicycle model.
The kinematic model we will use reflects the rolling without side-slip constraint, and is given below in Equation 1.34.
| (1.34) |
In this model, the robot state is , where is the Cartesian location of the robot center and is its heading with respect to the -axis. The robot control inputs are , where is the velocity along the main axis of the robot and is the angular velocity, subject to the control constraints:
In this problem, we will demonstrate the use of class inheritance in Python classes and the use of NumPy for vectorized operations. The notebook associated with this problem is ch01/exercises/nonholonomic_wheeled_robot_dynamics.ipynb.
We will be using a Dynamics base class for two different dynamics models: the wheeled robot dynamics model in this exercise and a double integrator model in the next exercise. The base class contains two unimplemented functions: step and rollout. The step function will propagate the dynamics a single time step with disturbances, and the rollout function will apply the step function multiple times to retrieve a trajectory of states over multiple time steps. Because the feed-forward dynamics are subject to disturbances, the same control sequence will result in different trajectories. We will observe this by executing multiple rollouts of the dynamics using the same control sequence from the same initial state.
In the ch01/exercises/nonholonomic_wheeled_robot_dynamics.ipynb notebook, complete the RobotDynamics class. Implement the function step using discrete-time Euler integration with the kinematic equations described in Equation 1.34. Then in the same class, implement the function rollout with two for-loops, calling the step function. Run the cells that rollout the robot’s dynamics and plot the control and state trajectories (this code has been written for you).
Problem 3: Double Integrator Dynamics
In this exercise, we consider the double integrator dynamics model:
| (1.35) |
In this model, the robot state is and the robot control inputs are .
Notice that in the previous problem, we used a for-loop to rollout several trajectories of the robot’s dynamics. In this problem, we will use the same base dynamics class for a DoubleIntegratorDynamics class, and use batching to reduce the number of for-loops needed to perform multiple rollouts. The notebook for this problem is ch01/exercises/double_integrator_dynamics.ipynb.
-
i.
To reduce the number of for-loops needed to perform multiple rollouts, we will batch the dynamics equations applied in the function step. Implement the function step in the DoubleIntegratorDynamics class.
-
ii.
Fill in the code in function rollout in the DoubleIntegratorDynamics class using the step function you just wrote. Note that you should only need one for-loop!
Practice · 4 notebooks
- Double Integrator Dynamics Open in Colab Source
- Nonholonomic Wheeled Robot Dynamics Open in Colab Source
- Simulation Open in Colab Source
- Numerical Integration Open in Colab Source