Robot Kinematics and Dynamics
Every robot must answer two geometric questions constantly: given the joint positions, where is the tool (or the robot body)? And given where the tool should be, what joint positions get it there? Kinematics answers these questions from geometry alone. Dynamics adds mass, inertia, and forces: what torques are needed to accelerate an arm along a path, and how will it move under gravity and contact?
These models sit underneath motion planning, control, calibration, simulation, and visualization. Mistakes in them — a wrong frame, a flipped rotation convention, a joint offset — produce robots that move to the wrong place with complete confidence. Understanding frames, transforms, and Jacobians makes those mistakes visible and debuggable.
TL;DR
- Describe every sensor, link, and object in a coordinate frame; relate frames with homogeneous transforms (rotation plus translation).
- Prefer quaternions or rotation matrices for computation; Euler angles are for humans and suffer from gimbal lock.
- Forward kinematics maps joint values to poses; inverse kinematics finds joint values for a target pose — often with several or no solutions.
- The Jacobian maps joint velocities to tool velocities; at singularities it loses rank and some motions become impossible.
- Dynamics relates torques to motion: M(q)q̈ + C(q, q̇)q̇ + g(q) = τ, plus contact and friction.
- Wheeled robots have nonholonomic constraints; use the right model (differential drive, Ackermann, omnidirectional).
Quick Example
Forward kinematics, analytic inverse kinematics, and the Jacobian for a two-link planar arm:
Joint velocities that move the tool at 0.1 m/s along x, using damped least squares near singularities:
Core Concepts
Frames and Transforms
A frame is an origin and three axes. Robots use many: map, odom, base_link, each link, each sensor, and the tool. A homogeneous transform — a 4×4 matrix combining a 3×3 rotation and a translation — converts coordinates from one frame to another, and transforms compose by multiplication: T_world_tool = T_world_base @ T_base_link1 @ … @ T_linkN_tool. Naming transforms by their frames (T_a_b takes points in frame b to frame a) prevents most mistakes. ROS uses a transform tree (tf2) and conventions in REP 103 (x forward, y left, z up for bodies; meters and radians).
Rotation Representations
Store and compute with quaternions or matrices; convert to Euler angles only for display. Check each library's quaternion ordering (w, x, y, z versus x, y, z, w). See 3D Math for Games for the shared mathematics.
Robot Descriptions
Robots are chains or trees of links connected by joints — revolute (rotation), prismatic (sliding), continuous, and fixed. Conventions such as Denavit–Hartenberg parameters or the product of exponentials describe each joint's geometry. In ROS, URDF (or Xacro-generated URDF) files describe links, joints, limits, inertia, and collision shapes, and are used for visualization, kinematics, and simulation.
Forward and Inverse Kinematics
Forward kinematics (FK) is straightforward: multiply transforms along the chain. Inverse kinematics (IK) is harder: a target may have no solution (out of reach), several (elbow up or down, wrist flips), or infinitely many (redundant robots with more than six joints). Approaches:
- Analytic IK for specific geometries (many six-axis arms with spherical wrists) — fast and complete.
- Numerical IK using the Jacobian (Newton steps, damped least squares) — general, but needs a good initial guess and can converge to different solutions.
- Optimization-based IK adding joint limits, collision avoidance, and preferences.
Always check joint limits, choose solutions consistently (to avoid sudden flips), and handle "no solution".
Jacobians and Singularities
The Jacobian J(q) maps joint velocities to the tool's linear and angular velocity. It drives velocity control, numerical IK, and force mapping. At a singularity the Jacobian loses rank: the arm cannot move in some direction, and solving for joint velocities produces huge values. Damped least squares, singularity-aware planning, and manipulability measures keep motions away from these configurations.
Statics and Dynamics
The Jacobian also relates forces: joint torques needed to apply a wrench F at the tool are τ = Jᵀ F. Dynamics adds mass and inertia: M(q)q̈ + C(q, q̇)q̇ + g(q) = τ, where M is the inertia matrix, C collects Coriolis and centrifugal effects, and g is gravity. Algorithms such as recursive Newton–Euler compute these efficiently. Dynamics models are used for gravity compensation, feedforward control, simulation, and estimating contact forces. See Feedback Control Systems.
Wheeled Robots
Wheeled robots usually move in the plane with constraints: a differential-drive robot cannot move sideways (a nonholonomic constraint), an Ackermann (car-like) robot has a minimum turning radius, and omnidirectional platforms with mecanum or omni wheels can translate in any direction. Their kinematic models convert wheel speeds into body velocity, which integrates into odometry. See Robot Localization and Mapping.
Libraries and Tools
Best Practices
Name Every Frame and Transform
Use explicit frame names in variables and messages, and document conventions for axes, units, and quaternion order.
Visualize Before Trusting
Render frames and robot models (for example in RViz) to catch flipped axes and wrong offsets before running hardware.
Handle Multiple and Missing IK Solutions
Select solutions consistently, respect joint limits, and fail safely when a target is unreachable.
Stay Away From Singularities
Plan paths with margins from singular configurations and use damped methods when near them.
Common Mistakes
Mixing Rotation Conventions
Euler Angles for Interpolation
Ignoring Singularities in Velocity Control
FAQ
What is the difference between kinematics and dynamics?
Kinematics describes motion from geometry alone — positions, velocities, and their relationships. Dynamics includes masses and forces, describing the torques needed to produce motion and how the robot responds to loads.
What is inverse kinematics?
Computing joint values that place a robot's tool or end effector at a desired position and orientation. It may have no solution, several solutions, or infinitely many for redundant robots.
What is a robot singularity?
A configuration where the Jacobian loses rank, so the robot cannot move its tool in some direction and joint velocities computed for certain motions become very large.
Why use quaternions instead of Euler angles?
Quaternions represent orientation compactly without gimbal lock and interpolate smoothly. Euler angles are intuitive but suffer from singularities and many conflicting conventions.
What is URDF?
The Unified Robot Description Format, an XML format used in ROS to describe a robot's links, joints, limits, inertial properties, visuals, and collision geometry.
Related Topics
- Robotics & Autonomous Systems — The robotics software stack
- Probability and Linear Algebra for Computing — Vectors, matrices, and rotations
- Feedback Control Systems — Controlling joints and wheels
- Robot Localization and Mapping — From wheel kinematics to pose estimates
- 3D Math for Games — Shared transform and rotation mathematics
- Game Physics — Simulated dynamics and collisions
- Robot Motion Planning — Collision-free paths and trajectories