Chapter 12 · Make an arm plan, move, touch, and prove the whole task
Today in the field story
One problem, then the next
Search several seeded paths from the current arm shape to the pre-grasp configuration. One route swings wide, another threads near the divider, and some seeds fail within the budget. Record success, time, path length, and minimum clearance for every attempt. RRT and OMPL are not luck dispensers: the repeated seed table reveals whether the mission has robust free space or one attractive accidental solution.
- Why now
Valid endpoints do not guarantee a connectable, repeatable path through configuration space.
- Ignore today
Ignore proving asymptotic planning theory; compare bounded seeded behavior on this scene.
- Unlocks next
A selected geometric path with known variability and clearance evidence.
Understand
Build the physical picture first
A sampling planner grows possible routes through the joint-angle maze, but each random branch still needs the robot model to say whether that branch is legal.
OMPL supplies abstract motion-planning algorithms, including randomized planners; MoveIt supplies the robot meaning around them. MoveIt defines the group's state space, start and goal constraints, joint bounds, validity checks, and planning scene. A planner such as RRT samples a configuration, finds a nearby tree node, extends toward the sample, and asks whether the new edge is valid. RRTConnect grows from both start and goal and tries to join the trees.
Random sampling explains why identical requests can produce different paths or planning times. A useful sample near an open route can solve the problem quickly; unlucky samples may grow branches into dead ends. Narrow passages are especially difficult because only a small portion of C-space leads through them. A timeout means no solution was found within that budget, not mathematical proof that no solution exists. An invalid start, impossible goal, or disconnected free region needs a different diagnosis.
Collision checking along an edge has a resolution. If only widely separated states are checked, both endpoints can be clear while a thin obstacle lies between them. Finer checking catches more detail but costs more computation. Planner range, goal bias, constraints, mesh complexity, scene margins, and post-processing also affect the result. Path shortening can remove needless bends, but the changed path must remain valid under the same or stricter scene and resolution.
Planner evaluation is an experiment, not a screenshot. Freeze the robot model, scene, start, goal, constraints, timeout, checking resolution, and machine load; then run declared random seeds. Record success, failure code, planning time, path length, minimum modeled clearance, and number of states. Compare distributions or medians and preserve failed seeds. One beautiful path proves only that one run returned a candidate under one recorded condition.
Words you need
Name each idea precisely
- Sampling-based planner
A planner that explores selected states in a continuous space instead of building an exact grid of every possible configuration.
Physical example:Randomly placed dots in a paper maze become possible arm configurations for a search tree.
- RRT
Rapidly-exploring Random Tree, which repeatedly samples a state and extends a tree from a nearby known state toward it.
Physical example:A branching pencil tree spreads quickly into large empty parts of a maze and sometimes reaches the exit corridor.
- State validity
The decision that one configuration satisfies declared joint bounds, collisions, and other feasibility checks.
Physical example:A shoulder-elbow pair is rejected because the elbow box overlaps a shelf even though both angles are individually legal.
- Edge resolution
How finely the configurations between two sampled states are checked for validity.
Physical example:Checking a paper route only every 10 cm can jump over a 2 cm line, while 1 cm checks reveal it.
- Planning timeout
The maximum search time allowed before the request returns without a found solution.
Physical example:A two-second budget can expire during an unlucky tree expansion even though another seed finds a route in half a second.
- Clearance
The modeled separation between the robot or payload and the nearest forbidden geometry along a path.
Physical example:Two routes reach the cup, but one keeps 50 mm from the shelf while the other passes only 4 mm away.
Math, one line at a time
Work through today’s relationship
Prerequisite rescue · optionalConfiguration space, sampling, and trajectory timing
A collision-free pose is not enough; the complete joint path and timing must be feasible.
- q
- one point in joint configuration spaceUnit: rad or m per joint
- Δq
- joint change between samplesUnit: rad or m
- v = Δq/Δt
- joint velocityUnit: rad/s or m/s
A joint moves from 0.2 rad to 0.8 rad, so Δq = 0.6 rad.
If allocated time is 0.3 s, average velocity is 0.6/0.3 = 2 rad/s.
If the limit is 1 rad/s, increase duration to at least 0.6 s and collision-check the interpolated path.
A route can pass API validation at its endpoints while failing in the middle; robot trajectories must validate every segment.
A 0.5 rad move with a 2 rad/s limit needs at least how long?
Δt = 0.5/2 = 0.25 s.
The sampled free fraction is
The separate planning success rate is
for the declared budget and test set.
Compare two planners without choosing the luckiest run
For one frozen simulated shelf scene and a 2.0 s timeout, Planner A succeeds on 18 of 20 declared seeds with median successful planning time 0.42 s, median path length 2.8 rad, and minimum observed clearance 14 mm. Planner B succeeds on 20 of 20 with medians 0.76 s, 3.1 rad, and 27 mm.
Calculate Planner A's measured success rate:
18 / 20 × 100% = 90%; preserve the two failed seeds and error codes.Calculate Planner B's measured success rate:
20 / 20 × 100% = 100%for this exact twenty-seed test, not for every future scene.Compare planning-time medians: A is
0.34 sfaster on successful runs, but failed runs must not be removed from the success decision.Compare path-length medians: A is
0.3 radshorter, which is a geometric cost rather than direct proof of faster execution.Compare minimum observed clearance: B keeps
13 mmmore modeled clearance in this test, which may matter more than the modest path difference near the shelf.Choose B for this declared workcell criterion if the requirement prioritizes twenty-of-twenty planning and at least
20 mmmodeled clearance; retain A as a measured alternative rather than calling it bad in general.
Planner B satisfies the example's success and clearance gates on all recorded seeds, while Planner A is faster and shorter only among the cases it solves.
Planner choice follows task-specific repeated evidence; success, time, length, and clearance answer different questions and must share the same test conditions.
Physical examples
Where this appears in real life
Two trees through a paper maze
Draw a start, goal, walls, and one narrow doorway; grow one pencil tree from the start and another from the goal using numbers from a shuffled deck as sample coordinates.
Large open areas collect branches quickly, while the narrow doorway may receive no useful sample for several turns; another shuffle produces another route and time.
Stepping over a thin tape line
Mark two safe floor points on opposite sides of a narrow tape strip and inspect only the two points, then inspect every shoe position along the step.
Safe endpoints do not make the connecting motion safe; intermediate checking exposes the crossed strip just as edge validation exposes a thin modeled obstacle.
Hands-on exercise
Make the idea observable
Use the same simulated robot and one saved narrow-passage planning scene. Fix all settings except planner ID and random seed.
Record robot and scene versions, planning group, start, goal, constraints, timeout, edge-checking resolution, planner parameters, and a list of at least ten seeds.
Run two available OMPL planner configurations across every seed and save return code, planning time, path state count, joint-space length, and modeled minimum clearance.
Add an obviously impossible goal inside a collision object and confirm its failure is reported separately from an ordinary timeout on a difficult but valid goal.
Make the edge-checking resolution deliberately coarse around a thin simulated obstacle, capture the invalid-looking gap, then tighten it and prove the suspect edge is rejected.
Apply the configured path simplification or smoothing stage, recheck the resulting path, and compare length and clearance before and after post-processing.
Create a compact table with success rate, failed seeds, median and slowest time, median path length, worst clearance, and the criterion that selects or rejects each configuration.
Paths and times should vary by seed, the narrow passage should expose unlucky searches, and the thin-obstacle test should show why endpoint checks or coarse edges are insufficient.
The same command reproduces the frozen benchmark, every failure retains its seed and cause, and the selected planner follows written acceptance criteria rather than visual preference.
Build today
Use MoveIt 2 to plan around collision objects, servo toward a target, execute a Task Constructor pick-and-place, and stop safely on contact or invalid state.
Evidence to save
DONE when a deterministic “Sampling-based motion planning with RRT/OMPL intuition” failure test reports expected versus actual behavior and passes after the documented fix.
Common mistakes
Catch the wrong mental model
Calling a planning timeout proof that no collision-free route exists.
Report only that this planner and configuration found no route within the stated budget; separately test invalid inputs, other seeds, planners, constraints, or scene geometry.
Selecting the fastest successful screenshot and omitting failed random seeds.
Predeclare seeds and metrics, keep every result, and compare success distribution, time, path cost, and clearance under identical conditions.
Increasing collision-checking step size to make planning faster without a thin-obstacle regression.
Tie resolution to geometry and risk, add targeted narrow-obstacle tests, and revalidate every post-processed edge against the current scene.
Job connection
How this becomes employable evidence
Benchmark OMPL planner configurations for a constrained bin-picking cell, preserve failed seeds, tune resolution and margins, and publish the tradeoff between planning latency, repeatability, path length, and clearance.
Relevant target roles
- Robotics Software Engineer — ROS 2 / AMR
- Robotics Application / ROS 2 Integration Engineer
- Robotics Deployment, Integration & Validation Engineer
Chapter 12 interview drill
Interview questions: Sampling-based motion planning with RRT/OMPL intuition
Practise a 60–90 second answer: define the idea, connect it to a physical robot, state assumptions, frames, and units when relevant, then finish with the failure signal or evidence you would inspect.
Primary interview scenario
Describe RRT or RRTConnect in configuration space, then design a fair repeated benchmark and explain how you would distinguish timeout, invalid start, impossible goal, and missed thin-obstacle checking.
Answer shape: clarify the situation → trace the physical and software path → test the most likely boundaries → name the evidence that would confirm the result.
Technical follow-up questions
Q1What robot-specific service does MoveIt provide to an abstract OMPL planner?
MoveIt defines the robot state space, bounds, start and goal constraints, collision and feasibility checks, and planning-scene context used to judge sampled states and edges.
Q2Why can identical start and goal requests return different RRT-style paths?
Random samples and timing change where and how the search trees grow, so routes, search effort, and timeout outcomes can differ between seeds.
Q3How can two valid edge endpoints still hide a collision?
The continuous motion between them may cross a thin C-space obstacle; intermediate states must be checked at a resolution fine enough for the modeled risk.