Manipulator Basics · Theory · Module 13 of 14
13 — Collision Detection and Manipulator Motion Planning
Obstacles in the room become forbidden regions in the robot's configuration space. Learn how arms are checked for collision, why a straight joint move can hit something, and how sampling-based planners such as RRT and RRT* find, shorten and validate a safe path.
Kinematics tells you which configuration reaches a target. Motion planning finds how to get there without hitting the table, a fixture, a part or the robot itself.
Learning objectives
After this module you should be able to:
- Explain configuration space (C-space) and how workspace obstacles map into it.
- Describe collision checking with simple geometry (capsules, spheres and boxes), including self-collision and safety margins.
- Explain why straight-line motion in joint space can collide, and how edges are checked.
- Describe RRT and RRT*, their properties (probabilistic completeness, asymptotic optimality) and their parameters.
- Smooth a planned path, re-validate it, and time-parameterise it for execution.
Conceptual explanation
The configuration space (C-space) of an arm is the space of its joint values: a square (in fact a torus) for a 2R arm, a 6-dimensional space for a 6-DOF arm. Each configuration is a point. It is either free (within joint limits, no collision) or in collision. An obstacle that is a simple disc in the workspace becomes a curved, often non-convex forbidden region in C-space, because every configuration in which any link touches it is forbidden.
Planning in C-space turns "move the arm without collisions" into "find a curve between two points that stays in the free region". The catch is that the free region cannot be computed explicitly in six dimensions. It can only be probed, one configuration at a time, by a collision checker.
Collision checking
Real meshes are expensive, so arms are wrapped in simple shapes. A capsule (a segment with a radius) fits a link well, and its distance to a sphere, a box or another capsule is cheap to compute exactly. A configuration is valid when: all joints are within limits; every link clears every obstacle by a safety margin; non-adjacent links clear each other (self-collision); and the tool and any carried part clear everything too. Production systems add a broad phase (bounding-volume hierarchies) to discard far-apart pairs quickly, and a narrow phase (for example GJK) for the rest.
Why straight lines fail
Interpolating the joints from start to goal is the simplest motion. Its tool path is a curve, and the links sweep a whole region of the workspace. If that region contains an obstacle, the move collides even though both end points are free. A planner therefore checks edges, not just points: it checks configurations along the segment at a spacing fine enough that nothing can slip between samples.
Sampling-based planning
RRT (rapidly-exploring random tree) grows a tree from the start: sample a random configuration (sometimes the goal itself), find the nearest tree node, step towards the sample, and add the new node if it and the edge are collision-free. It is probabilistically complete: if a path exists, the chance of finding it goes to one as samples grow. Its paths are jagged and far from shortest. RRT* also chooses the cheapest nearby parent for each new node and rewires neighbours through it; with more samples its path converges towards the optimum (asymptotic optimality), at a higher cost per iteration.
From path to motion
- Smooth: shortcutting repeatedly tries to replace a stretch of the path by a straight segment and keeps it if the segment is valid.
- Validate: re-check the final path at a fine resolution (smoothing creates new edges).
- Time-parameterise under velocity and acceleration limits (Module 10).
- Monitor during execution: the controller follows with some lag, and the world may change.
Mathematical formulation
Here is the volume occupied by the robot at and the obstacles. Distance from a capsule (segment , radius ) to a sphere (centre , radius ):
RRT extension with step size η.
RRT* neighbourhood radius: it shrinks as the tree grows, which keeps the cost per iteration logarithmic.
Edge checking at resolution δ (rad).
Worked examples
Example 1: distance from a link to an obstacle
A link capsule from to m with radius 30 mm, and a spherical obstacle of radius 50 mm at m. The closest point on the segment is , 0.1 m from the centre, so the clearance is m: 20 mm, as the engine computes. With a 30 mm safety margin, this configuration would be rejected.
Example 2: the two-post scene of Lab 10
Two discs of radius 70 mm stand in the 2R arm's workspace. Sampling the C-space on a 120 × 120 grid, 93.5% of it is free. Going from to by straight joint interpolation fails 22% of the way: link 2 hits the circle, although both end points are free.
| Planner | Iterations | Tree nodes | Collision checks | Raw path length (rad) | After shortcutting | Validated at 0.01 rad | Execution time |
|---|---|---|---|---|---|---|---|
| RRT (stops at first solution) | 476 | 332 | 2,709 | 7.15 | 5.89 | yes | 4.70 s |
| RRT* (3,000 iterations) | 3000 | 2432 | 56,771 | 4.77 | 4.75 | yes | 4.42 s |
RRT found a path after 476 iterations, but a long, jagged one. Shortcutting removed part of the detour, but the result is still longer than the RRT* path. RRT* found its first solution at the same iteration, then kept improving it, at roughly 21 times the collision checks. After smoothing, both are validated at 0.01 rad and timed for execution. Reproduce this in Lab 10.
Example 3: the robot can hit itself
The 3R arm with no obstacles moves its last joint from −120° to 150° with . Both end configurations are valid, but the straight move fails at , where link 3 folds back onto link 1: a self-collision. Turning the other way is impossible because of its ±170° limits, so a planner has to find a way round, for example by moving out of the way while turns.
Interactive experiment
Interactive configuration space of a 2R arm (needs JavaScript).
Real-world applications
- MoveIt 2 plans with OMPL (RRT-Connect by default, also RRT* and PRM), checks collisions against a planning scene with FCL, and validates and time-parameterises the result.
- Offline programming tools check robot programs for collisions and reach before they run in the cell.
- Bin picking plans a fresh collision-free path for every part, around the bin walls and the other parts.
- Safety: speed and separation monitoring and safe zones in the controller complement planning. They are certified functions; a planner alone is not a safety system.
Common mistakes
Checking only the end points
Both configurations can be free while the motion between them collides. Check edges at a fine resolution.
Using too coarse an edge resolution
A thin obstacle can fall between samples. Choose δ so that no link point moves further than the smallest obstacle size (plus margin) between checks.
Forgetting the carried object
After grasping, the part is part of the robot. Add it to the collision model, or the arm will drag it through obstacles.
Not re-validating after smoothing
Shortcutting creates new edges. Validate the final path before executing it.
Zero safety margin
Models, calibration and tracking are imperfect. Plan with a margin of several millimetres to centimetres.
Key takeaways
- Planning happens in configuration space; workspace obstacles become curved forbidden regions there.
- Collision checking uses simple shapes (capsules, spheres, boxes) and must include self-collision, the tool and any carried part.
- Straight joint moves collide even with free end points; edges must be checked.
- RRT is probabilistically complete; RRT* is also asymptotically optimal. Smooth, re-validate and time-parameterise every path.
Knowledge check
Write an answer to each question, then reveal the explanation. Your answers stay in your browser.
Question 1
What is the configuration space of a 2R arm without joint limits?
Explanation
A torus: each joint angle wraps around, so the square [−π, π)² with opposite edges glued together.
Question 2
Why can a straight joint-space move collide when both ends are collision-free?
Explanation
The links sweep a region of the workspace on the way; if an obstacle lies in that region, some intermediate configuration collides.
Question 3
What does "probabilistically complete" promise, and what does it not?
Explanation
If a path exists, the probability of finding it tends to one as the number of samples grows. It gives no bound on the time, and cannot prove that no path exists.
Question 4
What does RRT* do that RRT does not?
Explanation
It chooses the lowest-cost parent among nearby nodes and rewires neighbours through new nodes when that shortens their paths, so the solution keeps improving towards the optimum.
Question 5
After grasping a box, what must change in the collision model?
Explanation
The box is attached to the gripper and checked against the obstacles (and the robot); the box itself is removed from the obstacle list.
Practise it in the labs
Then test yourself in practice exercises and challenge mode.
References and further reading
- S. M. LaValle, Planning Algorithms, Cambridge University Press, 2006, chapters 4–5.
- S. Karaman and E. Frazzoli, "Sampling-based algorithms for optimal motion planning", International Journal of Robotics Research, 30(7), 2011.
- J. J. Kuffner and S. M. LaValle, "RRT-Connect: an efficient approach to single-query path planning", IEEE ICRA, 2000.