Robot Motion Planning
Motion planning finds a collision-free geometric path from start to goal in the robot's configuration space, then parameterizes it into a dynamically feasible trajectory that respects velocity, acceleration, and jerk limits.
Why Does This Exist?
If you treat a robot as an infinitesimal point, finding a route between two coordinates is a straightforward 2D maze search. But real physical robots have volume: a delivery rover has a 50-centimeter chassis with protruding wheels, and a 6-axis manipulator has thick aluminum links that sweep a broad 3D volume as they articulate.
If a path planner routes an arm right along the edge of a shelf, the fingertip might clear the edge while the elbow punches straight through the wood. Furthermore, even if a geometric line of waypoints is collision-free, a physical robot cannot instantly change direction: electric motors have finite torque, leading to maximum acceleration and jerk boundaries.
Motion planning bridges this gap through two critical abstractions:
- Configuration space (-space) obstacles: By growing physical obstacles by the robot's physical geometry (via Minkowski sums), the robot is shrunk to a single mathematical point, converting complex volumetric collision queries into simple point containment tests.
- Trajectory parameterization: Parameterizing a static geometric path into a time-indexed trajectory with smooth velocity profiles that motor controllers can physically track.
Basics first: the joint coordinates that define configuration space live in robot-degrees-of-freedom. Converting operational poses to joint waypoints lives in robot-forward-inverse-kinematics. Re-planning trajectories online against dynamic obstacles lives in robot-model-predictive-control.
Think of It Like This
Navigating a wide furniture dolly through a narrow doorway
Imagine pushing a heavy, wide wooden wardrobe on a four-wheeled dolly through an apartment doorway.
You do not simply aim for the open space between the door frames. You look at the width of the wardrobe and mentally "fatten" the door frame inwards on both sides by half the wardrobe's width. In your mind, the wide doorway shrinks to a narrow passage. If the center of your dolly can pass through that shrunken gap, you know the physical edges of the wardrobe will not scrape the paint off the door jambs.
Where it stops: a human mover can pause, tilt the wardrobe at a angle, or squeeze through foam padding. In high-dimensional robotics (such as a 7-axis arm moving through a cluttered engine bay), -space obstacles are complex non-linear manifolds that cannot be visualized directly, requiring sampling algorithms (like RRT or PRM) to explore the free space.
How It Actually Works
The Minkowski sum and -space obstacles
Let the robot body be a rigid set of points , and let obstacles in the workspace be . When the robot is located at configuration , its physical footprint is .
The configuration space obstacle region is the set of all configurations where the robot intersects an obstacle:
For a circular robot of radius translating in 2D space, the -space obstacle for a circular obstacle of radius is computed via the Minkowski sum:
In -space, the robot is represented as a single point at , and the obstacle is enlarged to radius . A point path is collision-free if and only if it never enters any expanded circle.
Graph search versus sampling-based planning
- Grid / Graph Search (A*, Dijkstra): Discretizes -space into an explicit grid. Guarantees finding the optimal path if one exists (resolution completeness), but scales exponentially with configuration dimension . Effective for 2D mobile bases, intractable for 7-DoF arms.
- Sampling-Based Planners (RRT, PRM): Explores continuous high-dimensional -space by generating random configuration samples , steering toward them, and checking collision along the local edge. Rapidly-exploring Random Trees (RRT) bias growth toward unexplored Voronoi regions, finding feasible paths in high dimensions within milliseconds (probabilistically complete).
From geometric path to timed trajectory
A geometric path specifies positions parameterized by distance . A trajectory assigns time to every point, establishing velocities and accelerations .
A standard industrial trajectory profile is the trapezoidal velocity profile:
- Phase 1 (Acceleration): Accelerate at until reaching cruise speed .
- Phase 2 (Cruise): Cruise at constant velocity .
- Phase 3 (Deceleration): Decelerate at to stop smoothly at the goal.
Worked example: navigating an obstacle and trajectory timing
A circular mobile robot navigates an indoor floor:
- Robot radius: ().
- Circular pillar obstacle centered at with physical diameter ().
- Start: , Goal: .
First, compute the -space obstacle radius and diameter:
A direct straight-line path from to passes through , penetrating into (unavoidable collision).
The planner introduces an intermediate waypoint . Check clearance from waypoint to obstacle center:
Clearance margin beyond the -space obstacle:
Now compute total path length :
Time parameterization with and :
- Acceleration time: .
- Distance traveled during acceleration: .
- Deceleration distance: ().
- Cruise distance: .
- Cruise time: .
- Total trajectory duration: (smooth, bounded jerk and acceleration).
Code
This Python snippet defines the -space obstacle expansion, tests waypoint clearance, and generates the time-parameterized trapezoidal velocity profile.
import math
def plan_timed_path( r_robot: float, r_obs: float, obs_center: tuple[float, float], waypoint: tuple[float, float], v_max: float = 0.50, a_max: float = 0.50,) -> tuple[float, float, bool, float]: """Compute C-space obstacle radius, clearance, safety check, and total duration.""" r_cspace: float = r_robot + r_obs dist_to_obs: float = math.hypot( waypoint[0] - obs_center[0], waypoint[1] - obs_center[1], ) is_safe: bool = dist_to_obs > r_cspace
# 2-segment path: (0,0) -> WP -> (2,2) l1: float = math.hypot(waypoint[0], waypoint[1]) l2: float = math.hypot(2.0 - waypoint[0], 2.0 - waypoint[1]) total_len: float = l1 + l2
# Trapezoidal profile timing t_accel: float = v_max / a_max d_accel: float = 0.5 * a_max * (t_accel ** 2) d_cruise: float = total_len - 2.0 * d_accel t_cruise: float = d_cruise / v_max total_time: float = 2.0 * t_accel + t_cruise
return round(r_cspace, 3), round(dist_to_obs, 3), is_safe, round(total_time, 2)
r_c, clearance, safe, duration = plan_timed_path( r_robot=0.15, r_obs=0.10, obs_center=(1.0, 1.0), waypoint=(0.6, 1.4),)
print(r_c) # -> 0.25print(clearance) # -> 0.566print(safe) # -> Trueprint(duration) # -> 7.09Watch Out For
Assuming a geometric path can be executed at maximum speed
A path is merely an ordered set of geometric waypoints without timestamps. If an execution script commands motor drives to hit each waypoint at maximum velocity without accounting for cornering acceleration, the motors demand infinite acceleration at sharp turns.
The symptom is severe trajectory tracking error, cutting corners, or tripping overcurrent faults. Fix it by passing geometric paths through a kinodynamic trajectory smoother (such as Time-Optimal Path Parameterization, TOPP-RA, or cubic splines) that enforces joint velocity, acceleration, and torque constraints.
Planning in task space without checking arm self-collisions
When planning end-effector paths for a 6-axis or 7-axis manipulator, planners often check only whether the tool tip hits an obstacle.
The symptom is the gripper reaching the target while the arm's elbow or forearm link crashes into a support strut or into the robot's own base. Fix it by evaluating collision checking in the full configuration space (-space) using bounding volume hierarchies (such as oriented bounding boxes or swept-sphere cylinders) covering all physical robot links.
The Quick Version
- Motion planning finds collision-free routes in configuration space (-space), where obstacles are expanded by the robot's physical dimensions.
- Expanding a obstacle by a robot radius creates a diameter -space obstacle for point navigation.
- Routing through waypoint achieves a clearance of , providing a safety margin over the collision boundary.
- A geometric path only specifies where to go; trajectory parameterization assigns timestamps, velocities, and accelerations that motor drives can physically follow.
- Trapezoidal velocity profiles bound maximum acceleration () and cruising speed (), preventing motor torque saturation at sharp corners.