(Physics) Model-based Planning for Contact-rich Robotic Manipulation

Tao Pang
Nov 2022


Why contact-rich?

Collision-free Motion Planning
Interact with the world



Smaller
What can we learn from RL (reinforcement learning)?

- RL still requires heavy offline computation.
- The Nvidia policy is trained with "only 8 NVIDIA A40 GPUs" for 60 hours.
- (OpenAI) Andrychowicz et al. "Learning dexterous in-hand manipulation." The International Journal of Robotics Research, 2020.
- (Nvidia) Handa et al. "DeXtreme: Transfer of Agile In-hand Manipulation from Simulation to Reality", arXiv preprint, 2022.
-
H.J. Terry Suh*, Tao Pang*, Russ Tedrake, “Bundled Gradients through Contact via Randomized Smoothing”, RA-L, 2022.
-
Tao Pang*, H.J. Terry Suh*, Lujie Yang, Russ Tedrake, "Global Planning for Contact-Rich Manipulation via Local Smoothing of Quasi-dynamic Contact Models", under review, 2022.
[1] OpenAI.
[2] Nvidia.

How does RL power through non-smooth contact dynamics? [3][4]
- RL maximizes a stochastic reward using gradients estimated from sampling.
- Sampling has a smoothing effect on the reward's landscape.
In model-based planning, we can smooth contact dynamics, but without using samples (faster!).
Why is contact-rich planning hard?

Contact dynamics is non-smooth!
Two solutions
Descend with gradients of smoothed dynamics
Reason explicitly about contact mode transitions
Contact
No Contact
- But descent methods get stuck in local minima.
- Therefore they need non-trivial initialization.
- Good at escaping local minima,
- But mode enumeration scales poorly (exponentially) with the number of contacts.

smoothed dynamics
original dynamics
\(u = 0\)
Model-based Planning through Contact: a Quick Review
- Trajectory Optimization through Contact
- Mordatch, Igor, Emanuel Todorov, and Zoran Popović. "Discovery of complex behaviors through contact-invariant optimization." ACM Transactions on Graphics (TOG), 2012.
- Hogan, François Robert, and Alberto Rodriguez. "Feedback control of the pusher-slider system: A story of hybrid and underactuated contact dynamics." arXiv preprint arXiv:1611.08268, 2016.
- Posa, Michael, Cecilia Cantu, and Russ Tedrake. "A direct method for trajectory optimization of rigid bodies through contact." The International Journal of Robotics Research, 2014.
- Aydinoglu, Alp, and Michael Posa. "Real-time multi-contact model predictive control via admm." 2022 International Conference on Robotics and Automation (ICRA), 2022.
- Cheng, Xianyi, et al. "Contact mode guided motion planning for quasidynamic dexterous manipulation in 3d." 2022 International Conference on Robotics and Automation (ICRA), 2022.
- Marcucci, Tobia, et al. "Approximate hybrid model predictive control for multi-contact push recovery in complex environments." 2017 IEEE-RAS 17th International Conference on Humanoid Robotics (Humanoids), 2017.
- Enumerate mode switches locally
- Enumerate Mode Switches
Good
Scalability (Smoothed dynamics)
Bad Scalability (Mode Transitions)
Local Planning
Global Planning
Global planning with RRT + Smoothed dynamics?

[1] Mordatch et al.

[3] Posa et al.

[6] Marcucci et al.

[4] Aydinoglu and Posa.

[2] Hogan and Rogriguez.
- Sampling mode transitions.
[5] Cheng et al.

Our Method: Sim and Hardware Demos.
- Our planner combines
- sampling-based global search and
- smoothed contact dynamics.
- Our planner takes less than a minute to find most plans shown above, on a single CPU.
Open-loop execution of contact-rich plans on hardware:
A better contact dynamics model for contact-rich planning
- Rapidly-Exploring Random Tree (RRT): iteratively builds a tree that fills the state space. [1]
- A good distance metric should reflect dynamic reachability. [2]


- Steven M. LaValle, "Planning Algorithms", Cambridge University Press , 2006.
-
H.J.T. Suh, J. Deacon, Q. Wang, "A Fast PRM Planner for Car-like Vehicles", self-hosted, 2018.
-
Tao Pang*, H.J.T. Suh*, Lujie Yang, Russ Tedrake, "Global Planning for Contact-Rich Manipulation via Local Smoothing of Quasi-dynamic Contact Models", under review, 2022.
How do we measure reachability under the non-smooth contact-dynamics constraint?

A convex, quasi-static, differentiable contact model that can be easily smoothed. [3]

Reachability-informed distance metric using smoothed linearization of our model
Presented Works
Collaborators

-
Tao Pang*, H.J. Terry Suh*, Lujie Yang, Russ Tedrake, "Global Planning for Contact-Rich Manipulation via Local Smoothing of Quasi-dynamic Contact Models", under review.
-
H.J. Terry Suh*, Tao Pang*, Russ Tedrake, "Bundled Gradients through Contact via Randomized Smoothing", RA-L, 2022.



Terry Suh
Lujie Yang
Russ Tedrake
What is quasi-static dynamics?
- Quasi-static: velocity is small so that inertial and Coriolis forces are negligible.
- \(x \coloneqq q \coloneqq [q^\mathrm{u}, q^\mathrm{a}]\): system configuration.
- \(q^\mathrm{a}\): actuated, imepdance-controlled robots
- \(q^\mathrm{u}\): un-actuated objects.
- \( u \):
robot velocitiesposition command to the stiffness-controlled robots [1]. - \(\delta q \coloneqq q_+ - q\)
- \(h\): step size in seconds.
\( x_{+} = f(x, u)\)
- \(\lambda_i\): contact forces/impulses
- \(\phi_i \): signed distances
(KKT)
- A convex quadratic program (QP), after linearizing \(\phi_i\).
- "Minimizing potential energy, subject to non-penetration constraints."
Force balance of the robot.
Force balance of the object.
Non-penetration.
"Contact forces cannot pull."
"Contact force needs contact."
-
Tao Pang, Russ Tedrake, "A Convex Quasistatic Time-stepping Scheme for Rigid Multibody Systems with Contact and Friction", ICRA, 2021.
Quasi-static dynamics is good for manipulation planning!
- Many manipulation tasks are quasi-static.
- Spatial benefit: Smaller state space (\([q, v]\) vs. only \(q\)).
-
Temporal benefit: Ignoring transients => looking into the future with fewer steps.
-
Tao Pang, Russ Tedrake, "A Convex Quasistatic Time-stepping Scheme for Rigid Multibody Systems with Contact and Friction", ICRA, 2021.


Second-order Dynamics
Quasi-static Dynamics
Quasi-static Dynamics Needs Regularization
Quasi-static Dynamics
- The quadratic cost is positive semi-definite.
- The object can be anywhere between the robot and the wall, similar to having a null space.
Regularized least squares
Regularized Quasi-static Dynamics
- The quadratic cost is now positive definite.
- "Among all possible object motions, give me the one that moves the least."
- Picking \(\epsilon = m^\mathrm{u} / h\) gives Mason's definition of quasi-dynamic dynamics.
What about friction?
- For a frictionless multi-body system with \(n_\mathrm{c}\) contacts, the dynamics can be solved as a QP:
- \(\mathcal{K}^\star_i\) is the dual of the \(i\)-th friction cone.
- Still convex! Convexity is achieved at the expense of "hydroplaning" between relatively-sliding objects.
- But hydroplaning disappears as \(h \rightarrow 0\).
- Anitescu [1] has a nice convex approximation of Coulomb friction constraints, allowing us to write down the dynamics as a Second-Order Cone Program (SOCP):
Tangential displacements
Dynamics of the Toy Problem
- Anitescu, Mihai. "Optimization-based simulation of nonsmooth rigid multibody dynamics." Mathematical Programming 105.1 (2006): 113-143.
Differentiability
Convex, Quasi-Static, Differentiable Dynamics (an SOCP)
- The KKT optimality condition of the dynamics SOCP defines equality constraints (including active contact constraints), from which the derivatives of \(\delta q^\star\) w.r.t. \((\mathbf{Q}, b, \phi_i, \mathbf{J}_{\mathrm{n}_i}, \mathbf{J}_{\mathrm{t}_i})\) can be computed using the Implicit Function Theorem (IFT).
- \(\mathbf{A}, \mathbf{B}\) can then be computed using the gradients from IFT and the chain rule.
- Standard practice for many differentiable simulators, even though many of them do not find the active constraints by solving convex programs.



Smoothing
- The contact dynamics \(f(q, u) \in C^0\) has discontinuous gradients, which are bad for planning methods that use gradients.
- Smoothing with "force at a distance" is a common method to alleviate this problem.
Optimality Condition
KKT
Original Dynamics
Smoothed Dynamics
Smoothing, the general case.
Put constraints in a generalized log for \(\mathcal{\kappa}_i^\star\)
- An unconstrained convex program.
- Can be solved with Newton's method.
- Also differentiable.
Convex, Quasi-Dynamic, Differentiable Dynamics (an SOCP)
Notation:
Original dynamics
Smoothed dynamics
Smoothed gradients enable trajectory optimization for dexterous hands, but...
Task: Turning the ball by 30 degrees.
What about 180 degrees?
Finding this trajectory requires powering through local minima!
Sampling-based Motion Planing is Great at Global Exploration, but...
- Rapidly-Exploring Random Tree (RRT): iteratively builds a tree that fills the state space. [1]
- Dynamic reachability is essential for efficient exploration. [2]


- Steven M. LaValle, "Planning Algorithms", Cambridge University Press , 2006.
-
H.J.T. Suh, J. Deacon, Q. Wang, "A Fast PRM Planner for Car-like Vehicles", self-hosted, 2018.
How do we think about reachability under the contact-dynamics constraint?
A distance metric that reflects reachability
Smoothed Contact Dynamics

\(\varepsilon \) sub-level set
Nominal state
un-actauted(objects)
Smoothed
At state \(\bar{q}\), what doe an \(\varepsilon\)-ball in action space get transformed into under the smoothed dynamics?
RRT through contact
Three modifications to the vanilla RRT are made:
- Nearest node on tree is found using \( d^\mathrm{u}_{\rho}(q; \bar{q}) \).
- Contact sampling: robot configuration is occasionally reset to one that has a good distance metric, which typically corresponds to grasps.
- Dynamic-consistent extension: an action is computed using the smooth linearized dynamics to reach \(q\).
Distance Metric
RRT tree for a simple system with contacts


Ablation study: what trees look like after growing a fixed number of nodes.
The modified RRT works well for contact-rich tasks!


Planning wall-clock time (seconds)
Preliminary: stabilizing contact-rich plans
Open-loop
Closed-loop




Naive QP controller based on smoothed linearization:
Quasi-static dynamical systems: how to fix it.
A Impedance-controlled 1D robot and an object.
- Pang, Tao, and Russ Tedrake. "A convex quasistatic time-stepping scheme for rigid multibody systems with contact and friction." 2021 IEEE International Conference on Robotics and Automation (ICRA). IEEE, 2021.
- Pang, Tao, and Russ Tedrake. "A robust time-stepping scheme for quasistatic rigid multibody systems." 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2018.
\( x_{+} = f(x, u)\)
- \(x \coloneqq q \coloneqq [q^\mathrm{u}, q^\mathrm{a}]\): system configuration.
- \(q^\mathrm{a}\): actuated, imepdance-controlled robots
- \(q^\mathrm{u}\): un-actuated objects.
- \( u \):
robot velocities.position command to the impedance-controlled robots.
Contact force and \(q_+\) can now be uniquely* determined from \(u\), even for grasping.
Force-acceleration vs. Impulse-Momentum
Force-acceleration
- Stewart, David E. "Rigid-body dynamics with friction and impact." SIAM review 42.1 (2000): 3-39.
Impulse-momentum
is the optimality condition of
But impacts can lead to infinite forces (e.g. Painleve's Paradox) [1].
Time step
Stabilizing contact-rich plans

Open-loop hardware




Open-loop Drake
talk_10min
By Pang
talk_10min
- 409