Part IV · Competencies: RL on Real Robots
20.Learning Manipulation
“RL is beginning to achieve real-world success in manipulation, but the diversity of objects and the difficulty of modelling contact keep general-purpose solutions below the maturity reached in locomotion.”
Manipulation is the competency that has resisted hardest, and understanding why is more instructive than any single result. Contact is where simulators are least trustworthy, object diversity defeats the generalization that made locomotion work, and failure is expensive. This chapter works through the subproblems in order of how well they have gone — grasping, then contact-rich assembly, then in-hand dexterity, then general pick-and-place — and shows where each technique from earlier chapters lands. It closes on evaluation, because manipulation is where success rates are most often reported in ways that will not survive scrutiny.
Foundation
Grasp wrench space and force closure, the Ferrari–Canny metric, contact-mode combinatorics, impedance control as an action space, and Wilson intervals for small-sample success rates.
Conceptual
Force closure you can break by dragging contacts — the analytic criterion that learned grasp scorers approximate from pixels.
Practical
A parallel-jaw gripper in rapier3d, grasp-selection DQN paying off Chapter 9, SAC insertion with impedance actions, and demo-boosted training from browser teleoperation.
After this chapter you can
- Explain force closure and compute grasp quality from contact geometry
- Explain why contact-mode combinatorics make planning through contact intractable
- Formulate impedance control as an action space and explain why it beats position control under uncertainty
- Describe the in-hand dexterity recipe and what it cost
- Say precisely why general pick-and-place remains below the real-world tiers
- Report a manipulation success rate honestly, with an interval that reflects the sample size
20.1 Why manipulation is the hard one
Chapter 18 listed four properties that made locomotion tractable. Manipulation fails on all four, and the symmetry is worth spelling out.
The dynamics do not simulate well. Manipulation is made of the contact interactions that Chapter 15 identified as simulators' weakest point — sustained sliding, friction that decides outcomes, compliance, deformation. A locomotion policy needs contact to be roughly right; a manipulation policy needs it to be right in detail.
Rewards are sparse and hard to write. "Did the assembly succeed?" is one bit, arriving after a long sequence. Dense shaping requires knowing what intermediate progress looks like, which for contact-rich tasks is often exactly what you do not know.
Failure is expensive. A dropped object may break; a mis-inserted peg can damage the workpiece or the robot; a manipulator near a person is a safety case.
Objects are diverse. A quadruped's world is terrain — endless variation over one type of thing. A manipulator's world contains objects it has never seen, whose mass, friction and compliance it cannot observe.
20.2 Grasping: the analytic criterion and its learned approximation
Grasping has the cleanest theory in manipulation, and it is worth knowing even though modern systems learn rather than compute it.
A contact exerting force at position produces a wrench — force plus torque — of . With Coulomb friction, the forces a contact can exert lie in a cone of half-angle about the surface normal.
A grasp has force closure when its contact wrenches positively span the wrench space: any disturbance can be opposed by some non-negative combination of contact forces. In the plane this reduces to a readable test — no half-plane may contain all the wrench generators.
Force closure: when a grasp actually holds
ch20-grasp-wrenchDrag the contact points around the object. Each cone shows the directions that contact can push, given the friction coefficient.
Force closure
Yes
resists any disturbance wrench
Grasp quality
0.034
largest resistible wrench (normalized)
Largest angular gap
172.7°
must stay below 180°
Contacts
2.00
6 wrench generators
The criterion
A grasp has force closure when its contact wrenches positively span the wrench space — every disturbance can be opposed by some non-negative combination of contact forces. In the plane this reduces to a readable test: no half-plane may contain all the generators, so the largest angular gap must be under 180°.
The quality number is the radius of the largest wrench ball the grasp resists — the Ferrari–Canny metric. It is what separates a grasp that technically holds from one that survives being carried across a room.
Force closure is binary; quality is continuous. The Ferrari–Canny metric takes the radius of the largest wrench ball the grasp can resist — the worst-case disturbance it survives. That is the difference between a grasp that technically holds and one that survives being carried across a room.
What modern systems actually do is skip the geometry. A network takes a depth image, proposes candidate grasps, and scores each one — approximating the force-closure computation without ever reconstructing the object. This is the payoff for Chapter 9: grasp selection is exactly the setting where value-based methods belong, because the action space is a few hundred discrete candidates and the argmax is both tractable and correct.
20.3 Contact-rich manipulation and impedance actions
Insertion is the canonical contact-rich task: a peg into a hole with clearance smaller than the robot's positioning error. Pure position control fails by construction — commanding a position the peg cannot reach produces enormous contact forces and a jammed or damaged part.
The answer, from Chapter 13's operational-space material, is impedance control. Instead of commanding position, command a target position and a stiffness, making the robot behave like a programmable spring:
Low stiffness in the directions where contact is expected lets the environment guide the part; high stiffness along the insertion axis maintains the push.
Why planning through contact is intractable is worth stating precisely, because it explains why learning is attractive here. With contact points, each is separated, sticking, or sliding — discrete modes, each with different dynamics. A peg-in-hole with 8 potential contacts has modes. Planning must search over mode sequences, and the search is combinatorial in a quantity that grows with the task's contact richness. Learned policies sidestep the enumeration entirely by never representing modes explicitly.
20.4 In-hand manipulation: what dexterity cost
Reorienting an object within the hand, using the fingers alone, is the hardest thing manipulators do — many contacts, all of them making and breaking, with the object's pose partially occluded by the hand doing the manipulating.
The result that defined the area used no new algorithm. It used everything from Part III, at maximum intensity: extreme domain randomization (masses, frictions, object dimensions, gravity, actuator dynamics, visual appearance), a recurrent policy performing the implicit system identification of Chapter 15, distributed PPO from Chapter 10, and enormous compute.
20.5 Where the techniques land
Assembling Part IV's map for manipulation:
| Subproblem | What works | Chapter |
|---|---|---|
| Grasp selection | Learned scoring over discrete candidates | 9 (value methods) |
| Contact-rich insertion | SAC with impedance action space | 11, 13, 17 |
| In-hand reorientation | Extreme randomization + recurrent policy | 15, 19 |
| Novel-object picking | Demonstrations + offline RL, fine-tuned | 16 |
| Deformable objects | Largely open; demonstrations most promising | 16, 21 |
The pattern in Tang's tables is consistent: manipulation successes lean on expert data far more than locomotion successes, which lean on simulation. That is exactly what the four criteria of §20.1 predict — when simulation is untrustworthy and reward design is hard, human demonstrations supply both the data and the specification.
use nalgebra::{Vector3, Matrix3};
/// The policy's action: where to go, and how hard to insist on getting there.
pub struct ImpedanceAction {
pub target_pos: Vector3<f64>,
/// Per-axis stiffness in the TASK frame — low along expected contact
/// directions lets the environment guide the part.
pub stiffness: Vector3<f64>,
}
pub struct ImpedanceWrapper {
kp_range: (f64, f64),
damping_ratio: f64, // ζ; 1.0 = critically damped
}
impl ImpedanceWrapper {
/// Map a normalized policy output in [−1, 1] to a physical command.
pub fn decode(&self, raw: &[f64], current_pos: &Vector3<f64>) -> ImpedanceAction {
let delta = Vector3::new(raw[0], raw[1], raw[2]) * 0.05; // ±5 cm
let stiffness = Vector3::from_iterator((3..6).map(|i| {
let t = (raw[i] + 1.0) / 2.0; // → [0, 1]
self.kp_range.0 * (self.kp_range.1 / self.kp_range.0).powf(t) // log-spaced
}));
ImpedanceAction { target_pos: current_pos + delta, stiffness }
}
/// Cartesian impedance law, mapped to joint torques by Jᵀ (Chapter 13).
/// Damping is derived from stiffness so the system stays critically damped
/// as the policy varies Kp — otherwise a stiffness change causes ringing.
pub fn to_joint_torques(
&self,
action: &ImpedanceAction,
x: &Vector3<f64>,
xdot: &Vector3<f64>,
jacobian: &nalgebra::Matrix3<f64>,
mass_est: f64,
) -> Vector3<f64> {
let kp = Matrix3::from_diagonal(&action.stiffness);
let kd = Matrix3::from_diagonal(&action.stiffness.map(|k| {
2.0 * self.damping_ratio * (k * mass_est).sqrt()
}));
let force = kp * (action.target_pos - x) - kd * xdot;
jacobian.transpose() * force
}
}20.6 Reporting results honestly
Manipulation is where evaluation goes wrong most often, so Chapter 14's methodology deserves restating with the specifics.
State the object set. "90% success" over five known objects in fixed poses is a different claim from 90% over fifty novel objects in clutter. Both may be worth publishing; conflating them is not.
Give an interval. With 20 trials and 18 successes, the point estimate is 90%. The Wilson score interval — appropriate near the boundary where the normal approximation fails — is roughly [70%, 97%]. Reporting 90% alone claims precision the experiment did not buy.
Report the failures. Which two failed, and how? A grasp that slipped is a different problem from one that never closed.
Report the human cost. How many resets, and did a person perform them? For manipulation this is usually the binding constraint on the entire experiment, and omitting it hides the real cost of the method.
20.7 Chapter bridge
Part IV is complete. Locomotion won because its dynamics simulate and its rewards shape. Navigation is unsettled between learned and classical because each fails differently. Manipulation lags because contact, diversity and cost all cut against it — and where it succeeds, it does so by leaning on human data rather than simulation.
Three competencies remain in Tang's taxonomy, and they share a property: the environment contains other agents. Chapter 21 takes on human–robot interaction, where the unmodelable part of the world is a person; multi-robot systems, where coordination is a Dec-POMDP with unpleasant complexity; and the frontier that has moved fastest since the survey was written — foundation models supplying the priors, goals and even rewards that this book has so far asked engineers to write by hand.
- 01Foundation●●●Force closure by hand
For two point contacts with friction coefficient μ on a circular object, derive the condition on their angular separation for force closure. Verify your answer against the widget by finding the boundary experimentally.
- 02Foundation●●●Ferrari–Canny
Define the Ferrari–Canny metric precisely as the radius of the largest wrench ball contained in the grasp wrench space. Then explain why a grasp can have force closure and near-zero quality, and what that looks like physically.
- 03Foundation●●●Contact-mode explosion
Count contact modes for a square peg entering a square hole with 8 potential contact points. Then explain why sampling-based planners struggle here in a way they do not for free-space motion planning.
- 04Foundation●●●Why compliance searches
Model the insertion funnel: show that with a chamfered hole and low lateral stiffness, contact forces produce a lateral correction proportional to misalignment. Derive the maximum initial misalignment that self-corrects.
- 05Conceptual●●●Break the grasp
In the grasp widget, find the smallest friction coefficient at which two opposed contacts still achieve force closure. Then move them to the same side and confirm no friction value rescues the grasp.
- 06Conceptual●●●Does a third contact help?
Add a third contact and find a placement that maximizes quality. Compare against the best two-contact grasp at the same friction. Quantify what the extra finger bought.
- 07Practical●●●Grasp-selection DQN
Build a parallel-jaw gripper in rapier3d, generate candidate grasps on procedurally-varied objects, and train a DQN scorer. Compare against the analytic Ferrari–Canny ranking on objects where geometry is known — the disagreements are the interesting part.
- 08Practical●●●Impedance versus position
Train SAC on peg insertion twice: once with position actions, once with impedance actions. Hold everything else fixed. Report success rate, peak contact force and sample count, then report success with a Wilson interval as §20.6 requires.
References
Baseline references
- Tang, C. et al. (2024). Deep Reinforcement Learning for Robotics: A Survey of Real-World Successes. Annual Review of Control, Robotics, and Autonomous Systems link§4.3 in full — grasping, pick-and-place, contact-rich manipulation, articulated and deformable objects, in-hand and non-prehensile manipulation, with the trend analysis behind §20.1.
- Kober, J., Bagnell, J. A. & Peters, J. (2013). Reinforcement Learning in Robotics: A Survey. International Journal of Robotics Research 32(11)The manipulation lineage, including the peg-in-hole results that motivated compliant action spaces.
Further reading & modern sources
- Ferrari, C. & Canny, J. (1992). Planning optimal grasps. ICRA 1992The grasp quality metric of §20.2.
- Mason, M. T. (2001). Mechanics of Robotic Manipulation. MIT PressContact mechanics, friction cones and force closure, developed properly.
- Mahler, J., Liang, J., Niyaz, S., Laskey, M., Doan, R., Liu, X., Ojea, J. A. & Goldberg, K. (2017). Dex-Net 2.0: Deep Learning to Plan Robust Grasps with Synthetic Point Clouds and Analytic Grasp Metrics. RSS 2017Learned grasp scoring trained against analytic metrics — the bridge between §20.2’s two halves.
- Akkaya, I. et al. (OpenAI) (2019). Solving Rubik’s Cube with a Robot Hand. arXiv:1910.07113 linkThe in-hand result of §20.4, including automatic domain randomization.
- Levine, S., Pastor, P., Krizhevsky, A., Ibarz, J. & Quillen, D. (2018). Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection. International Journal of Robotics Research 37(4–5)Large-scale real-world grasp learning — the data-collection alternative to simulation.
- Martín-Martín, R., Lee, M. A., Gardner, R., Savarese, S., Bohg, J. & Garg, A. (2019). Variable Impedance Control in End-Effector Space: An Action Space for Reinforcement Learning in Contact-Rich Tasks. IROS 2019The impedance action space of §20.3, with the comparison against position control.
- Kroemer, O., Niekum, S. & Konidaris, G. (2021). A Review of Robot Learning for Manipulation: Challenges, Representations, and Algorithms. Journal of Machine Learning Research 22(30)The comprehensive manipulation-learning survey.
