“What is your PhD about?”
“Motion planning for robot arms.”
“Isn’t that already a mature field? What is left to research?”
“Motion planning, not trajectory planning. Let me explain…”
I have had this conversation with other people in robotics many times. So I thought I should write about what motion planning actually is.
It still took me three weeks to start. Perhaps I had become too relaxed during the summer break at home. Or perhaps writing about my own research brought on the same procrastination as writing a dissertation.
What is motion planning?
Put simply, motion planning means finding a path for a robot from a given position A to a given position B while satisfying specified constraints.
That might mean finding a shortest route to a destination for a mobile robot, or finding a collision-free motion for a robot arm so that it can grasp an object.

Some people prefer to call the first case path planning. Once we get to configuration space—assuming this article gets that far—we will see that the two are the same kind of problem, expressed in different planning spaces: one in three-dimensional Euclidean space, the other on a higher-dimensional manifold.
This is going to be a long article, so here is the video first: a collection of motion-planning demonstrations with several of the robot arms in our lab. If you would rather skip the text, start there.
Watch the video in the original article ↗

You might be wondering: “All that just to pick up a bottle of water? What is so difficult? Robots in films can do much more.”
Yes, it is 2016 and there is a quantum satellite in orbit, yet we still struggle to get a robot to fetch a bottle. Most industrial robots still work by repeating motions that a person has taught them, point by point. Service robots remain largely confined to laboratories.
One main reason robot-arm motion planning is hard is the high dimensionality of the problem, which we will come back to. We do not yet have a planning algorithm that gives us both real-time performance and optimality across these problems.

Why study it?
If we want robots to fetch bottles, cook, or tidy a room, they need to generate collision-free, optimal motions quickly. Industry has some more specific reasons to care as well.

I think I first saw a diagram like this in some ROS-Industrial material. I could not find it again, so I sketched it from memory.
Industrial robots in 2016 are generally not very flexible. They rely heavily on manual teaching and have difficulty accommodating changes in orders. Academic research, meanwhile, concentrates on much more flexible applications. A substantial gap lies between the two.

Industrial robots are used extensively in automotive manufacturing. A car model may stay in production for several years, and the profit per vehicle is substantial enough that spending time teaching the robots at the outset is acceptable.
But robot manufacturers also want to enter the “3C” industries: computers, communications, and consumer electronics. Phones change much more frequently than car models, and the return on an individual product is much smaller. Production lines have to adapt quickly. Traditional point-by-point teaching becomes a poor fit.
For all their maturity and successful applications, industrial robots have several weaknesses: teaching takes time and effort; changing environments are difficult; changing a production line is expensive; and the tasks they handle tend to be relatively simple. Rapid product turnover in 3C manufacturing, together with rising labor costs, creates a demand for more flexible robots.
Imagine programming at the task level—“pick up A and place it at B”—instead of teaching a sequence like “A → point 001 → point 002 → open gripper → point 200 → … → close gripper → … → point 666 → B → open gripper.” That would be quite a change.
This was also the point of my earlier Zhihu answer about Mujin and its algorithms: motion planning makes higher-level task programming possible without the laborious manual teaching process.
Starting with two-dimensional planning
This section draws on the University of Pennsylvania’s Coursera course Robotics: Computational Motion Planning, the books Planning Algorithms and Principles of Robot Motion: Theory, Algorithms, and Implementations, and my dissertation proposal from the previous year.
Two common criteria for evaluating a planner are:
- Completeness: the algorithm solves every problem that has a solution, in finite time.
- Optimality: the algorithm finds an optimal path—for example, the shortest path or the one requiring the least energy.
Start with a game
Motion-planning algorithms are used far beyond robotics. Video games are another major application.

In a real-time strategy game such as Red Alert, we normally just select a destination. A unit finds its way around obstacles and goes there. Motion planning is what makes that possible.
To keep things simple, let us first treat the robot—or game character—as a point with zero size.
Walk To
The simplest “algorithm” is Walk To: move directly from the current position toward the goal until you arrive.

Some RPGs, such as The Legend of Mir—another clue to my age—use this simple approach, with mouse clicks specifying the character’s direction of travel.

The resulting path is the shortest one, so it is optimal, but the method cannot handle an obstacle in the way. It is incomplete and leaves obstacle avoidance to the player.
Bug algorithms
Bug algorithms add a way of dealing with simple obstacles:
- Move along the line M joining the start and the goal.
- On meeting an obstacle, follow its boundary clockwise or counterclockwise until returning to M.

This is the familiar idea of following a boundary through a two-dimensional maze. The algorithm is complete in two dimensions, but its path is not guaranteed to be optimal.
Ant colony optimization
Ant colony optimization is, as the name suggests, an optimization method, but it can be applied directly to path planning. The method is complete and optimal, though slow convergence has limited its use.

Artificial potential fields
A potential field describes an energy distribution. Gravity is a familiar example: an object at a different height has different potential energy, and a ball on a slope naturally rolls downhill.
An artificial potential field borrows this idea. Define a potential whose lowest point is the goal, with higher potential farther away. Add repulsive potentials around obstacles, with the highest values at the obstacles themselves, to discourage collisions.


Potential fields are intuitive, computationally inexpensive, and can be integrated with a robot’s controller. Senior students in our lab used them in middle-size-league robot soccer.
The difficulty is local minima: the robot can become stuck somewhere other than the goal. The method is therefore incomplete and not optimal.
Graph search
Another large family of methods first turns the motion-planning problem into a graph, then uses a graph-search algorithm to solve it.
A graph consists of discrete vertices—also called nodes or points—and the edges that connect them. It describes the connectivity of a structure.

Graph theory gives us many ways to find shortest paths. Two particularly familiar algorithms in planning are Dijkstra’s algorithm and A*.

The pseudocode is enough to implement both. The animation below is my own demonstration. A* adds a heuristic that guides the search, so in many cases it finds a path substantially faster than Dijkstra’s algorithm.

To use either algorithm for motion planning, we still need a way to turn the planning space into a graph.
Visibility graphs
Represent obstacles as closed polygons. Connect their vertices, discarding any connection that intersects an obstacle. Connect the start and goal to the vertices in the same way, again removing connections that cross obstacles. The result is a graph.

The name suggests a useful mental picture: stand at a vertex and connect it to every other vertex you can see without an obstacle in the way. This method can be shown to be complete and optimal.
Grid discretization
Discretization is even more direct. Divide the space into cells of a chosen size and mark any cell containing an obstacle as impassable. Connect neighboring cells using four- or eight-way connectivity, and you have a graph.
If the cells are too large, a passage may disappear. This makes the method resolution-complete and optimal.

This approach is common in real-time strategy games. I do not know whether the original Red Alert used it, but the open-source implementation OpenRA uses grid discretization with A*. Its source code is available on GitHub.

Probabilistic roadmaps: PRM
A probabilistic roadmap samples N points in the planning space, connects points, and removes connections that collide with obstacles. The result is a randomly constructed roadmap.
With too few samples, or a poor distribution of samples, it is incomplete. As the sample count increases, completeness can be approached. PRM is therefore probabilistically complete, but not optimal.

There are many other ways to construct a search graph, including Voronoi diagrams and cell decomposition.
Rapidly exploring random trees: RRT
Alongside graph-search approaches, another major family grows a tree. The best-known example is RRT.
Starting at the initial configuration, RRT extends a tree outward. Random samples in the planning space determine the directions in which it grows. Like PRM, it is probabilistically complete, but not optimal.

Configuration space: from mobile robots to arms
Robot arms differ from our planar examples in two main ways: they use a different planning space, and they usually have more degrees of freedom.
So far, we have treated the robot as a point. To plan for an arm, we need a way to represent its whole configuration with a single point. This is the idea of configuration space, or C-space.
Even a mobile robot has a physical size, so it cannot simply be treated as a point in the original map. One intuitive solution is to shrink the robot to a point and inflate the obstacles accordingly. This construction uses the Minkowski sum.

A robot arm is less straightforward. Its generalized coordinates—usually its joint angles—let us describe its configuration as a point. A six-degree-of-freedom arm, for example, can be represented by a vector (θ₁, θ₂, θ₃, θ₄, θ₅, θ₆).
Representing the obstacles is harder. Multiple inverse-kinematics solutions and singularities complicate the nonlinear relationship between workspace and configuration space. There is no convenient general method for directly mapping workspace obstacles into C-space. A usual approach is to discretize C-space and test each cell for collisions.

The picture above flattens that space onto a plane. A revolute joint wraps around: 0 and 2π represent the same angle. The configuration space is therefore more like a torus than a flat rectangle.

The torus itself has only two degrees of freedom, even though it is embedded in three-dimensional space. If you have read The Three-Body Problem, think of the flattened Solar System still sitting within a three-dimensional universe. Beyond three degrees of freedom, we cannot draw the arm’s configuration space directly.
This change in topology raises a question: do the planning algorithms we used before still work in C-space? My impression is that this receives fewer mathematical proofs of completeness in robotics than one might expect. Partly, not everyone building robots specializes in advanced mathematics. Partly, the configuration spaces of many familiar mechanisms—continuous revolute joints and prismatic joints, for example—are differentiable manifolds, locally resembling Euclidean space, so many of the algorithms remain usable.

For a two-joint arm, most of the methods above can be applied directly:


What changes in higher dimensions?
Higher dimensions bring two problems: the computational burden grows, and explicitly describing the obstacles becomes difficult. To decide whether a planner is useful for a robot arm, we need to ask how it handles both.
Walk To. It works in any dimension, in the limited sense that it moves directly toward the goal. It still has no way to handle obstacles. We barely count it as a planning algorithm.
Bug algorithms. They depend on following an obstacle clockwise or counterclockwise. Those directions do not have the same meaning in higher dimensions, so the method does not carry over directly.
Ant colony optimization. Convergence is still slow, and it is not widely used here.
Artificial potential fields. The classical construction requires a potential in C-space, which in turn depends on knowing how obstacles occupy that space. That prevents it from being applied directly to a high-dimensional arm in the same way.
Researchers have found workarounds. For example, put several control points on the arm and define a potential in the workspace. Apply the corresponding force at each control point, then use the relationship between force and the Jacobian—derivable through virtual work—to convert those forces into joint torques. Those joint torques act as the potential-field forces in configuration space.

Khatib is a leading figure in artificial potential fields and has applied them to motion planning for humanoid robots.

For arms with many degrees of freedom, potential fields offer good real-time performance and integrate well with control. But they remain neither complete nor optimal, so failure to find a solution is still possible.
Visibility graphs. Like Bug algorithms, this method requires an explicit description of the obstacles in C-space. It therefore cannot be used in high-dimensional space in this form.
Grid discretization. In principle, this applies in any dimension. The problem is the number of cells. Consider a six-degree-of-freedom arm with a grid spacing of 6°—already a coarse resolution. That produces 60⁶ = 4.67 × 10¹⁰ cells. At 0.1 ms per collision test, checking every cell alone would take 1,296 hours. The planning computation also grows exponentially with dimension. For planning problems above three degrees of freedom, this approach generally loses its practical value.
PRM and RRT. Neither requires an explicit map of how obstacles fill C-space. Instead, they use a collision-checking function to test sampled configurations. I am being called to dinner, so I will jump to the conclusion: both work in high-dimensional spaces, both are probabilistically complete rather than optimal, and both can plan very quickly.

Their speed comes with a serious drawback: the randomness introduced by sampling. With RRT or PRM, the user cannot predict the resulting motion, and each run may produce a different answer. As I see it in 2016, this is what keeps automatically planned robots out of industrial applications that demand extreme consistency.

Much of the planning research I see therefore concerns improvements to PRM and RRT: reducing that uncertainty and, in some cases, adding optimization objectives. Examples include RRT*, Informed RRT*, and SBL.
This is only an introduction. I have left many questions untouched: how to sample uniformly, how to check for collisions, how to solve inverse kinematics quickly, and how to put all of this on a real robot. Those will have to wait for another article.