MIT 6.4210 — Lecture 6

Motion Planning

§ Motion Planning: Setup

Definition. Some reminders of some definitions:

Definition. In motion planning, we assume that we have:

§ Motion Planning: Obstacle Space

Given a robot AA and an object OO, how can we determine the set of positions of AA in which AA and OO do not intersect?

Definition. We define the obstacle space Cobs⊂CC_{\mathrm{obs}} \subset C by Cobs:={q∈C∣A(q)∩O≠∅}C_{\mathrm{obs}} := \{q \in C \mid A(q) \cap O \neq \emptyset\}, in addition to Cfree=C∖CobsC_{\mathrm{free}} = C \setminus C_{\mathrm{obs}}.

Remark. For some reason, we care about whether CfreeC_{\mathrm{free}} is closed in the topology of CC. If not, we must use the closure of CfreeC_{\mathrm{free}}.

In simple translational cases, we can write Cobs=O⊖AC_{\mathrm{obs}} = O \ominus A, where ⊖\ominus is the Minkowski difference.

The Minkowski difference can be efficiently computed using the Star algorithm—details omitted.

But for nontranslational cases, the obstacle space can be harder to compute. For example, the robot might be allowed to rotate, or the configuration space might be non-Cartesian.

In some of these cases, the runtime for computing CobsC_{\mathrm{obs}} might be exponential!

The upshot of defining CobsC_{\mathrm{obs}} is that we can now define the problem of motion planning entirely within the configuration space CC.

Definition. In motion planning, we assume that we have:

§ Combinatorial Planning

Definition. A motion planner is complete if it always finds a solution if one exists and returns a failure in bounded time if not.

The combinatorial algorithms we discuss in this section will be complete, and they will all employ road maps.

Definition. Given a configuration space CC and a free space CfreeC_{\mathrm{free}}, a road map RR is a graph whose vertices are configurations in CfreeC_{\mathrm{free}} and whose edges are collision-free paths between vertices. This graph must be such that:

Here's an example of how a road map might let us find a collision-free path qI→qGq_I \to q_G.

Here are some different strategies for constructing road maps.

Visibility Graph. Suppose the configuration space is R2\mathbb{R}^2, and every obstacle is a convex polygon. (If an obstacle is concave, you can work around this by breaking it up into convex pieces.)

Then for any qI,qG∈Cfreeq_I, q_G \in C_{\mathrm{free}}, to find a path qI→qGq_I \to q_G, we simply:

It turns out that this algorithm in fact always finds the shortest collision-free path qI→qGq_I \to q_G.

Remark. In computational geometry, people have found more efficient algorithms for computing visibility graphs. In practice, though, sampling-based motion planning algorithms are preferred—as we'll see later on.

Voronoi Diagram. Just construct the Voronoi Diagram of the obstacles.

The roadmap graph is then exactly the “boundaries” of the Voronoi diagram. In a sense, this lets you keep a maximum distance away from any obstacle throughout your collision-free path.

One last algorithm archetype.

Cell Decomposition. Split the configuration space into cells, and then find paths between the cells.

For example, here's a cell decomposition by xx-coordinate of the obstacles.

There are also approximate cell decomposition approaches; for example, here's a quadtree decomposition approach.

The idea is that cells are either empty, full, or mixed, and that “mixed” cells can be zoomed into as needed.

As mentioned earlier, these are all complete algorithms (approximate cell decompositions only up to resolution). But their disadvantages are that they become intractable as the obstacle complexity or dimensionality of the CC-space increases. (And this happens very often in robotic manipulation!)

§ Sampling-Based Planning

Definition. A (randomized) motion planner is probabilistically complete if, assuming a solution exists, the probability of finding that solution in tt time tends to one as t→∞t \to \infty.

The sampling-based algorithms we discuss in this section will be probabilistically complete. There are two kinds:

Here's the most common multi-query algorithm.

Probabilistic Roadmap (PRM). Construct the roadmap R=(V,E)R = (V, E) procedurally by repeating the following algorithm.

  1. Randomly pick a point q∈Cq \in C and check if q∈Cfreeq \in C_{\mathrm{free}}. If it isn't, try again.

  2. If it is, add qq to VV, and for each q′∈Vq' \in V with ∥q−q′∥<d\|q - q'\| < d, add the edge q↔q′q \leftrightarrow q' to EE if that path is collision-free.

The whole point of PRM is to avoid having to compute CobsC_{\mathrm{obs}}. Instead, for each q∈Cq \in C, it uses a custom collision-detector to check whether q∈Cfreeq \in C_{\mathrm{free}}. (Efficient collision-detectors exist, because video games require them.)

As shown above, though, the paths outputted by PRM are not very short. Here are some improvements to PRM:

Unfortunately, PRM may fail with nonzero probability because the roadmaps it produces might not satisfy Accessibility and Departability or Connectivity, as shown below.

But PRM just works very well in practice because—even in high dimensions—collision-detection is still very fast.

Sometimes the obstacles do move around, though, in which case we require single-query algorithms.

Rapidly-Exploring Random Trees (RRT). We gradually add points to a connected tree in the following way.

  1. Randomly pick a point qrand∈Cq_{\mathrm{rand}} \in C and check if qrand∈Cfreeq_{\mathrm{rand}} \in C_{\mathrm{free}}. If it isn't, try again.

    • With probability pp (the goal bias), our random point qrandq_{\mathrm{rand}} will just be qrand=qGq_{\mathrm{rand}} = q_G, the goal.

  2. (Extend) If it is, then do the following:

    • Find the nearest point q′∈Tq' \in T to qrandq_{\mathrm{rand}}.

    • Compute the point qnewq_{\mathrm{new}} that is η\eta of the way between q′q' and qrandq_{\mathrm{rand}}, for some fixed constant η∈(0,1)\eta \in (0, 1).

    • If the segment q′→qnewq' \to q_{\mathrm{new}} lies in CfreeC_{\mathrm{free}}, then append qnewq_{\mathrm{new}} to TT and connect q′q' and qnewq_{\mathrm{new}} with a collision-free path.

You can see this algorithm in action using the (warning: AI-generated) widget below.

qI (drag) qG (drag) qrand qnew

0.50
5%

Note that this algorithm is not the same as a plain random walk—a random walk doesn't tend to go anywhere, whereas RRT will eventually tend to fill the space.

A natural speed-up is RRT-Connect, in which we grow a tree from both qIq_I and qGq_G bidirectionally.

  1. Grow trees TAT_A and TBT_B out of qIq_I and qGq_G, respectively.

  2. Suppose RRT adds a new vertex qnewq_{\mathrm{new}} to TAT_A (Extend). Then:

    • Take the nearest point q′∈TBq' \in T_B to qnewq_{\mathrm{new}} and take steps (Extend) from q′q' to qnewq_{\mathrm{new}} until a collision occurs.

    • Add any taken steps to the tree TBT_B. Then swap TAT_A and TBT_B.

      • Allegedly, taking TAT_A to always be the smaller tree helps even more.

  3. Repeat until the steps taken from q′q' to qnewq_{\mathrm{new}} reach qnewq_{\mathrm{new}} without any collisions.

You can see in the widget above that RRT-Connect is much better than RRT for navigating narrow passages.

One last improvement is RRT*, which favors shorter paths between qIq_I and qGq_G. Handwavily, it adapts RRT in two ways:

RRT* keeps running even after it reaches qGq_G so that even shorter paths can be found over time.

One advantage of RRT is that it works even for non-holonomic robots.

Definition. A robot is holonomic if it can freely move in any direction in its configuration space.

Combinatorial planning algorithms ask whether you can move from q1q_1 to q2q_2 in the configuration space, which is not easily answerable for non-holonomic robots.

But RRT only asks whether, starting from q′q', you can get closer to qrandq_{\mathrm{rand}}, thereby landing on qnewq_{\mathrm{new}}. This can be answered for non-holonomic robots by forward-simulating various inputs and checking whether any results land closer to qrandq_{\mathrm{rand}}.

Spoilers: it turns out that RRT (or variants of it) just perform the best in practice.