Chapter 17: Deformable Object Manipulation (Rigid Robots)

Lesson 5: Case Studies: Cloth Folding, Cable Routing

This lesson develops two canonical deformable-manipulation problems for rigid robot arms: cloth folding and cable routing. We show how both can be cast as finite-dimensional optimal control problems with deformation energies and geometric constraints, and we connect these formulations to practical planners and controllers implemented in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica.

1. Unified Optimal-Control View of Cloth Folding and Cable Routing

Both cloth folding and cable routing are instances of planning for a high-dimensional deformable state manipulated by a low-dimensional rigid robot. Let \( x_t \in \mathbb{R}^n \) denote the deformable configuration at discrete time \( t \) (e.g., stacked mesh vertices or cable samples), and \( u_t \in \mathbb{R}^m \) the robot control (e.g., Cartesian end-effector velocities). A generic finite-horizon problem is

\[ \begin{aligned} &\min_{\{u_t\}_{t=0}^{T-1}} J(\{x_t,u_t\}) \\ &\text{subject to}\quad x_{t+1} = f(x_t,u_t), \quad t=0,\dots,T-1,\\ &\phantom{\text{subject to}}\quad h(x_t,u_t) \le 0, \quad t=0,\dots,T, \end{aligned} \]

where \( f \) is an approximate deformation model (possibly learned, see Lesson 4), and \( h \) encodes collision, self-intersection, and kinematic limits. The cost is typically decomposed as

\[ J = \Phi(x_T) + \sum_{t=0}^{T-1} \ell(x_t,u_t), \]

with terminal cost \( \Phi \) measuring task success (correct fold, correctly routed cable) and stage cost \( \ell \) penalizing strain and aggressive robot motions.

A typical decomposition of the state is \( x = (p_1^\top,\dots,p_N^\top)^\top \), where \( p_i \in \mathbb{R}^3 \) are vertex or sample positions on the deformable object. Dynamics \( f \) can be provided by a physics engine (mass-spring cloth, discrete rod cable) or a learned predictor, as discussed in previous lessons.

flowchart TD
  A["Task: 'fold cloth' or 'route cable'"] --> B["Perception: estimate deformable state x_t"]
  B --> C["Abstraction: mesh or sampled curve, constraints"]
  C --> D["Planner: optimize J with dynamics and constraints"]
  D --> E["Robot trajectory for end-effectors"]
  E --> F["Execution with feedback, regrasp or reroute if needed"]
        

2. Cloth Folding — Geometry and Deformation Energies

We consider a rectangular piece of cloth discretized by a triangular mesh with vertex set \( \{p_i\}_{i=1}^N \) and edge set \( \mathcal{E} \). The state is \( x = (p_1^\top,\dots,p_N^\top)^\top \). A simple quasi-static mass-spring model defines an elastic energy

\[ E_{\text{def}}(x) = \sum_{(i,j)\in\mathcal{E}} k_{ij} \big(\|p_i - p_j\| - \ell_{ij}\big)^2, \]

where \( k_{ij} > 0 \) are spring constants and \( \ell_{ij} \) the rest lengths of edges. This energy penalizes in-plane stretch and approximates bending when augmented with diagonal springs.

To encode a desired fold, we select a set of key vertices \( \mathcal{K} \subset \{1,\dots,N\} \) whose target positions \( \{\bar{p}_k\}_{k\in\mathcal{K}} \) describe the folded state. A natural terminal cost is

\[ \Phi_{\text{cloth}}(x_T) = \sum_{k\in\mathcal{K}} \big\|p_k(T) - \bar{p}_k\big\|^2, \]

while a typical stage cost combines deformation energy and robot effort:

\[ \ell_{\text{cloth}}(x_t,u_t) = \alpha\,E_{\text{def}}(x_t) + \beta\,\|u_t\|^2, \quad \alpha,\beta > 0. \]

In a quasi-static regime, we assume the cloth relaxes to a (local) minimum of \( E_{\text{def}} \) compatible with gripper positions, so \( f \) is effectively an energy-minimizing projection conditioned on end-effector poses. Learning-based models from Lesson 4 approximate this projection.

The gradient of the spring energy w.r.t. a vertex \( p_i \) is needed for gradient-based planners. For each edge \( (i,j)\in\mathcal{E} \):

\[ E_{ij} = k_{ij} \big(\|p_i - p_j\| - \ell_{ij}\big)^2, \quad d_{ij} = p_i - p_j, \quad r_{ij} = \|d_{ij}\|. \]

If \( r_{ij} \ne 0 \), then

\[ \nabla_{p_i} E_{ij} = 2 k_{ij} (r_{ij} - \ell_{ij}) \frac{d_{ij}}{r_{ij}}, \quad \nabla_{p_j} E_{ij} = -\nabla_{p_i} E_{ij}. \]

Summing over all incident edges yields \( \nabla_{p_i}E_{\text{def}}(x) \). These expressions are used directly in gradient-descent and trajectory optimization methods for fold planning.

3. Cable Routing — Discrete Curves and Bending Energies

A cable can be approximated as a polygonal chain with samples \( q_k \in \mathbb{R}^3 \), \( k=0,\dots,M \). The state is \( x = (q_0^\top,\dots,q_M^\top)^\top \). A discrete bending energy that penalizes curvature changes is

\[ E_{\text{bend}}(x) = \sum_{k=1}^{M-1} \big\| q_{k+1} - 2q_k + q_{k-1} \big\|^2. \]

The second difference \( q_{k+1} - 2q_k + q_{k-1} \) approximates the second derivative of the curve with respect to arc-length and thus curvature. To avoid sharp bends, we also impose inequality constraints on the discrete curvature magnitude, or equivalently upper bounds on this second difference.

Obstacles are represented by forbidden regions \( \mathcal{O}_j \subset \mathbb{R}^3 \). A simple separation constraint is

\[ \operatorname{dist}(q_k,\mathcal{O}_j) \ge d_{\min}, \quad k=0,\dots,M,\; j=1,\dots,J, \]

where \( d_{\min} \) is a safety margin derived from cable diameter and pose uncertainty. These constraints enter \( h(x_t,u_t) \) in the generic optimal-control formulation.

In many practical systems, the cable backbone is not directly actuated; instead the robot manipulates one or both ends and possibly some intermediate points. If we denote by \( g(x,u) \) a black-box quasi-static equilibration operator that relaxes the cable under gravity and contact, the dynamics can be approximated as

\[ x_{t+1} = g(x_t,u_t), \]

where \( u_t \) encodes the desired end-effector poses. Learned surrogates for \( g \) are particularly important here due to complex frictional contacts (see Lesson 4).

A common simplification for routing is to track only the centerline geometry at a coarse resolution, while treating small-scale slack as unmodeled compliance. Routing then becomes a search in the space of discrete curves that start at the source connector, end at the target connector, and satisfy curvature and obstacle constraints.

4. Discrete Energy Matrices and Basic Theoretical Properties

Both cloth and cable energies can be written in quadratic form with respect to stacked coordinates. For the bending energy, let \( Q \in \mathbb{R}^{3(M+1)} \) be the stacked vector \( Q = (q_0^\top,\dots,q_M^\top)^\top \). Define a block-sparse matrix \( D \in \mathbb{R}^{3(M-1)\times 3(M+1)} \) that applies the second-difference operator coordinate-wise:

\[ DQ = \begin{bmatrix} q_2 - 2 q_1 + q_0 \\ q_3 - 2 q_2 + q_1 \\ \vdots \\ q_M - 2 q_{M-1} + q_{M-2} \end{bmatrix}. \]

Then the bending energy can be written compactly as

\[ E_{\text{bend}}(Q) = \|DQ\|^2 = Q^\top D^\top D Q. \]

This representation yields immediate properties.

Proposition 1 (Positive semidefiniteness). The matrix \( H = 2 D^\top D \) is symmetric positive semidefinite, and \( E_{\text{bend}}(Q) = \tfrac{1}{2} Q^\top H Q \ge 0 \) for all \( Q \).

Proof. Symmetry is clear since \( H = 2 D^\top D \). For any \( Q \),

\[ Q^\top H Q = 2 Q^\top D^\top D Q = 2 \|DQ\|^2 \ge 0. \]

Thus \( H \) is positive semidefinite. Equality \( Q^\top H Q = 0 \) holds if and only if \( DQ = 0 \), i.e., all second differences vanish and the discrete cable is a straight or uniformly translated line, which is consistent with zero bending energy.

An analogous construction holds for the spring energy of cloth: with incidence matrix \( B \) encoding mesh edges, \( E_{\text{def}}(x) \) can often be written (after linearization) as \( x^\top K x \) with a sparse stiffness matrix \( K \). This structure enables efficient use of linear solvers inside planning algorithms.

5. Python Implementation — Gradient-Based Cloth Fold Planner

Below is a simplified Python implementation of a gradient-based planner for cloth folding. We assume a small set of grasped vertices follow robot end-effector trajectories, and we optimize these trajectories to minimize a discrete approximation of \( \Phi_{\text{cloth}} + \sum_t \ell_{\text{cloth}} \). For clarity, the code uses only numpy. In a full system, this would be integrated with a simulator such as PyBullet or MuJoCo and a motion planning stack such as OMPL.


import numpy as np

class ClothModel:
    def __init__(self, vertices, edges, rest_lengths, key_ids, key_targets,
                 k_spring=1.0, alpha_def=1.0, beta_ctrl=1e-2):
        """
        vertices: (N,3) initial positions
        edges: list of (i,j) index pairs
        rest_lengths: array of shape (len(edges),)
        key_ids: indices of key vertices K
        key_targets: (len(K),3) desired folded positions
        """
        self.x0 = vertices.copy()
        self.edges = edges
        self.rest_lengths = rest_lengths
        self.key_ids = np.asarray(key_ids, dtype=int)
        self.key_targets = np.asarray(key_targets, dtype=float)
        self.k = k_spring
        self.alpha = alpha_def
        self.beta = beta_ctrl

    def deformation_energy_and_grad(self, x):
        """Return E_def(x) and grad wrt x (flattened)."""
        N = x.shape[0]
        grad = np.zeros_like(x)
        E = 0.0
        for idx, (i, j) in enumerate(self.edges):
            pi = x[i]
            pj = x[j]
            dij = pi - pj
            rij = np.linalg.norm(dij)
            if rij < 1e-8:
                continue
            lij = self.rest_lengths[idx]
            diff = rij - lij
            E_ij = self.k * diff * diff
            E += E_ij
            # gradient
            scale = 2.0 * self.k * diff / rij
            g = scale * dij
            grad[i] += g
            grad[j] -= g
        return E, grad.reshape(-1)

    def terminal_cost_and_grad(self, x_T):
        """Phi_cloth(x_T) and grad wrt x_T (flattened)."""
        grad = np.zeros_like(x_T)
        diff = x_T[self.key_ids] - self.key_targets
        cost = np.sum(diff * diff)
        # gradient: 2 * (p_k - p_k*)
        for local_idx, vid in enumerate(self.key_ids):
            grad[vid] = 2.0 * diff[local_idx]
        return cost, grad.reshape(-1)

def fold_cloth(model, grasp_ids, T=20, step=1e-2, max_iters=200):
    """
    Optimize grasp trajectories for a single fold.
    grasp_ids: indices of grasped vertices controlled by the robot
    T: horizon length
    step: gradient step size
    """
    N = model.x0.shape[0]
    grasp_ids = np.asarray(grasp_ids, dtype=int)
    n_g = len(grasp_ids)

    # Parameterization: delta positions for each grasp over horizon (T, n_g, 3)
    U = np.zeros((T, n_g, 3), dtype=float)

    def rollout(U):
        # Simple quasi-static model: at each step, move grasp vertices, then relax cloth
        x = model.x0.copy()
        xs = [x.copy()]
        for t in range(T):
            for g_idx, vid in enumerate(grasp_ids):
                x[vid] += U[t, g_idx]
            # one gradient step of energy relaxation
            _, gradE = model.deformation_energy_and_grad(x)
            gradE = gradE.reshape(N, 3)
            x -= 0.1 * gradE  # projected gradient step
            xs.append(x.copy())
        return xs

    def objective_and_grad(U):
        xs = rollout(U)
        total_cost = 0.0
        gradU = np.zeros_like(U)

        # terminal cost
        Phi, gradT = model.terminal_cost_and_grad(xs[-1])
        total_cost += Phi

        # backpropagate terminal gradient through last relaxation step (very rough)
        # Here we ignore the dependence of relaxation on U for simplicity.

        # stage costs
        for t in range(len(xs) - 1):
            x_t = xs[t]
            E_def, _ = model.deformation_energy_and_grad(x_t)
            u_t = U[t].reshape(-1)
            total_cost += model.alpha * E_def + model.beta * np.dot(u_t, u_t)
            # d/dU of beta * ||u_t||^2 = 2 * beta * u_t
            gradU[t] += 2.0 * model.beta * U[t]

        return total_cost, gradU

    for it in range(max_iters):
        cost, gU = objective_and_grad(U)
        U -= step * gU
        if it % 20 == 0:
            print(f"iter {it}, cost {cost:.4f}")
    return U
      

The simplifications here (single relaxation step, crude backpropagation) are pedagogical. In practice, we would differentiate the simulator or use learned differentiable models to obtain more accurate gradients, and we would couple this with a trajectory optimizer such as CHOMP or an SQP method from earlier chapters.

6. C++ Implementation — Graph-Based Cable Routing

For cable routing, a common abstraction discretizes the workspace into a graph whose vertices represent feasible cable waypoints and whose edges indicate locally feasible segments that respect curvature and obstacle constraints. The planning problem reduces to a shortest-path problem on this graph. High-quality implementations typically reuse motion-planning libraries like OMPL inside ROS/MoveIt, but the core algorithm is a standard Dijkstra search:


#include <vector>
#include <queue>
#include <limits>
#include <cmath>

struct Vec3 {
    double x, y, z;
};

double distance(const Vec3 &a, const Vec3 &b) {
    double dx = a.x - b.x;
    double dy = a.y - b.y;
    double dz = a.z - b.z;
    return std::sqrt(dx*dx + dy*dy + dz*dz);
}

struct Edge {
    int to;
    double w; // edge weight
};

using Graph = std::vector<std::vector<Edge> >;

// Dijkstra shortest path from src to dst
std::vector<int> shortest_path(const Graph &G, int src, int dst) {
    const double INF = std::numeric_limits<double>::infinity();
    int n = static_cast<int>(G.size());
    std::vector<double> dist(n, INF);
    std::vector<int> parent(n, -1);

    using Node = std::pair<double,int>;
    std::priority_queue<Node, std::vector<Node>, std::greater<Node> > pq;

    dist[src] = 0.0;
    pq.push({0.0, src});

    while (!pq.empty()) {
        auto [d, u] = pq.top();
        pq.pop();
        if (d > dist[u]) continue;
        if (u == dst) break;
        for (const Edge &e : G[u]) {
            int v = e.to;
            double nd = d + e.w;
            if (nd < dist[v]) {
                dist[v] = nd;
                parent[v] = u;
                pq.push({nd, v});
            }
        }
    }

    std::vector<int> path;
    if (dist[dst] == INF) return path; // no path
    for (int v = dst; v != -1; v = parent[v]) {
        path.push_back(v);
    }
    std::reverse(path.begin(), path.end());
    return path;
}
      

The graph construction is where robotics-specific reasoning enters: we add an edge only if the local segment between two waypoints has acceptable curvature and does not collide with obstacles. Those checks rely on the geometric and physical models from Section 3 and on collision-checking routines from the planning chapters.

7. Java Implementation — Deformable State Integration Skeleton

In Java-based robotics stacks (e.g., custom simulators or middleware), we often encapsulate the deformable dynamics into an integrator class. Below is a skeleton that updates a 1D cable state using a simple explicit gradient step on the bending energy. This mirrors the derivation of \( E_{\text{bend}} \) from Section 3.


import java.util.Arrays;

public class CableState {
    public double[][] q; // positions [M+1][3]

    public CableState(int M) {
        q = new double[M + 1][3];
    }

    public CableState copy() {
        CableState c = new CableState(q.length - 1);
        for (int i = 0; i < q.length; ++i) {
            c.q[i] = Arrays.copyOf(q[i], 3);
        }
        return c;
    }
}

public class BendingIntegrator {
    private final double step;

    public BendingIntegrator(double step) {
        this.step = step;
    }

    // gradient descent on E_bend
    public void stepOnce(CableState state) {
        int M = state.q.length - 1;
        double[][] grad = new double[M + 1][3];

        for (int k = 1; k <= M - 1; ++k) {
            double[] qkm1 = state.q[k - 1];
            double[] qk   = state.q[k];
            double[] qkp1 = state.q[k + 1];

            double[] d2 = new double[3];
            for (int c = 0; c < 3; ++c) {
                d2[c] = qkp1[c] - 2.0 * qk[c] + qkm1[c];
            }

            // E_k = ||d2||^2, grad wrt q_{k-1}, q_k, q_{k+1}
            for (int c = 0; c < 3; ++c) {
                double g = 2.0 * d2[c];
                grad[k + 1][c] += g;
                grad[k][c]     += -2.0 * g;
                grad[k - 1][c] += g;
            }
        }

        // gradient step
        for (int k = 0; k <= M; ++k) {
            for (int c = 0; c < 3; ++c) {
                state.q[k][c] -= step * grad[k][c];
            }
        }
    }
}
      

In a complete system, this integrator would be coupled to robot commands that impose boundary conditions at the cable ends and to collision-checking routines to prevent penetration into obstacles.

8. MATLAB/Simulink Implementation — Mass-Spring Cloth/Cable Model

MATLAB with Robotics System Toolbox can be used to prototype cloth and cable models. A convenient approach is to build the mass-spring or bending system matrices in MATLAB and feed them into a Simulink state-space block. The example below constructs a simple 1D chain (cable) with bending energy and returns discrete-time matrices suitable for Simulink.


function [Ad,Bd,Cd,Dd] = buildCableBendingModel(M, dt, mass, k_bend)
%BUILD CABLE BENDING MODEL
% M: number of segments (M+1 nodes)
% dt: time step
% mass: point mass at each node
% k_bend: bending stiffness

N = M + 1;
nq = N; % 1D positions for simplicity
nv = N; % velocities
n  = nq + nv;

% second-difference matrix D (N-2 x N)
D = zeros(N-2, N);
for k = 2:N-1
    D(k-1, k-1) = 1.0;
    D(k-1, k)   = -2.0;
    D(k-1, k+1) = 1.0;
end

K = k_bend * (D' * D);    % stiffness matrix
Mmat = mass * eye(N);     % mass matrix

% state x = [q; v]
A_cont = zeros(n, n);
A_cont(1:nq, nq+1:end) = eye(N);           % qdot = v
A_cont(nq+1:end, 1:nq) = -Mmat \ K;       % vdot = -M^{-1} K q

B_cont = zeros(n, 1);    % no external input here

% discretize with Euler
Ad = eye(n) + dt * A_cont;
Bd = dt * B_cont;
Cd = eye(n);
Dd = zeros(n, 1);
      

In Simulink, we can place a State-Space block and set its parameters to Ad, Bd, Cd, Dd. Robot actuation at the cable endpoints can be modeled as external inputs added to the acceleration equation, or by imposing position constraints that overwrite the corresponding entries of \( q \) at each time step.

9. Wolfram Mathematica Implementation — Symbolic Gradient of Bending Energy

For small subproblems, symbolic tools such as Wolfram Mathematica are useful to check derivations of gradients and Hessians. The snippet below derives gradients of the bending energy for three planar points and generates a numerical function that can be embedded into a planner.


(* Three planar points q0, q1, q2 *)
Clear[q0, q1, q2];
q0 = {q0x, q0y};
q1 = {q1x, q1y};
q2 = {q2x, q2y};

d2  = q2 - 2 q1 + q0;
Eb  = d2.d2;

(* Gradients *)
g0 = Grad[Eb, {q0x, q0y}];
g1 = Grad[Eb, {q1x, q1y}];
g2 = Grad[Eb, {q2x, q2y}];

(* Export as a numerical function *)
gradFun = Function[
  {q0x, q0y, q1x, q1y, q2x, q2y},
  {g0, g1, g2}
];

(* Example usage *)
gradFun[0.0, 0.0, 0.5, 0.0, 1.0, 0.1]
      

This agrees with the discrete gradient structure implemented in the Java integrator. Similar symbolic checks can be done for cloth spring forces on small meshes to avoid mistakes in manual derivations.

10. Problems and Solutions

Problem 1 (Translation invariance of spring energy). Consider the cloth spring energy \( E_{\text{def}}(x) = \sum_{(i,j)\in\mathcal{E}} k_{ij}(\|p_i - p_j\| - \ell_{ij})^2 \) with fixed rest lengths \( \ell_{ij} \). Show that translating every vertex by the same vector \( t \in \mathbb{R}^3 \) leaves \( E_{\text{def}} \) unchanged.

Solution. Define \( \tilde{p}_i = p_i + t \) for all \( i \). For any edge \( (i,j)\in\mathcal{E} \),

\[ \|\tilde{p}_i - \tilde{p}_j\| = \|(p_i + t) - (p_j + t)\| = \|p_i - p_j\|. \]

Therefore each term in the sum is preserved: \( k_{ij}(\|\tilde{p}_i - \tilde{p}_j\| - \ell_{ij})^2 = k_{ij}(\|p_i - p_j\| - \ell_{ij})^2 \). Summing over edges yields \( E_{\text{def}}(\tilde{x}) = E_{\text{def}}(x) \), where \( \tilde{x} \) stacks the translated vertices.

Problem 2 (Nullspace of bending energy). For the discrete bending energy \( E_{\text{bend}}(Q) = \|DQ\|^2 \) constructed in Section 4, characterize the nullspace of \( D \), i.e., all configurations \( Q \) such that \( E_{\text{bend}}(Q) = 0 \).

Solution. \( E_{\text{bend}}(Q) = 0 \) if and only if \( DQ = 0 \), meaning all second differences vanish:

\[ q_{k+1} - 2 q_k + q_{k-1} = 0, \quad k = 1,\dots,M-1. \]

This recurrence implies that each coordinate sequence is affine in the index \( k \). Hence there exist vectors \( a,b \in \mathbb{R}^3 \) such that \( q_k = a k + b \) for all \( k \). Geometrically, the discrete cable backbone is a straight line (or a straight line plus a rigid shift), so no bending occurs. Thus the nullspace of \( D \) consists exactly of discrete straight lines.

Problem 3 (Quadratic approximation around a folded cloth). Let \( x^\star \) be a locally optimal folded configuration minimizing \( \Phi_{\text{cloth}}(x) + \alpha E_{\text{def}}(x) \) without robot controls. Show that in a neighborhood of \( x^\star \), the cost can be approximated as

\[ J(x) \approx J(x^\star) + \tfrac{1}{2}(x - x^\star)^\top H (x - x^\star), \]

for some symmetric positive semidefinite matrix \( H \), and interpret the role of \( H \) in planning.

Solution. Since \( x^\star \) is a local minimizer and \( J \) is twice differentiable, a second-order Taylor expansion gives

\[ J(x) = J(x^\star) + \nabla J(x^\star)^\top (x - x^\star) + \tfrac{1}{2}(x - x^\star)^\top \nabla^2 J(x^\star)(x - x^\star) + o(\|x - x^\star\|^2). \]

At a local minimizer, \( \nabla J(x^\star) = 0 \), and the Hessian \( H = \nabla^2 J(x^\star) \) is symmetric positive semidefinite by standard second-order optimality conditions. Neglecting higher-order terms yields the stated approximation. In planning, \( H \) acts as a local stiffness matrix: its eigenvectors associated with large eigenvalues correspond to directions in which the cost increases rapidly, so a planner should avoid perturbations along those modes when refining a fold.

Problem 4 (Shortest-path vs. minimum-bending routing). Consider a 2D cable routing problem in a free rectangular strip with no obstacles. Show that minimizing the discrete bending energy subject to fixed endpoints is solved by any straight polyline between the endpoints and that, in this case, the minimum of \( E_{\text{bend}} \) coincides with the Euclidean shortest path.

Solution. From Problem 2, \( E_{\text{bend}}(Q) = 0 \) if and only if the cable samples lie on a discrete straight line. Any such line connecting the endpoints is a global minimizer of \( E_{\text{bend}} \). In a rectangular strip without obstacles, the Euclidean shortest path between the endpoints is the straight segment connecting them, which is also the limit of refining any discrete straight polyline. Thus the zero-bending-energy solutions coincide with the shortest paths, illustrating that in free space bending penalization and length minimization agree.

Problem 5 (High-level pipeline for cloth folding). Sketch an algorithmic pipeline that takes as input an RGB-D observation of a cloth, a desired fold specification, and outputs a sequence of robot grasp poses and motions.

Solution. One possible pipeline is summarized below.

flowchart TD
  S["Start: RGB-D image, fold spec"] --> P["Perception: segment cloth, estimate mesh state x_0"]
  P --> A["Abstraction: choose keypoints and crease line"]
  A --> PL["Plan: optimize end-effector trajectories to minimize J"]
  PL --> SIM["Simulate or roll out with deformable model"]
  SIM --> CKS["Check: fold quality, no collisions"]
  CKS -->|success| EXEC["Execute on robot with feedback"]
  CKS -->|failure| ADJ["Adjust model or replan, possibly regrasp"]
        

Each block in the pipeline corresponds to modules covered across previous lessons: perception (Chapter 10), deformable state representation (Lesson 2), planning (Chapters 3–5), and learning-based prediction/correction (Lesson 4).

11. Summary

In this lesson we treated cloth folding and cable routing as canonical case studies in deformable manipulation with rigid robots. We formulated both tasks as constrained optimal-control problems over high-dimensional deformable states, introduced discrete deformation and bending energies, and established fundamental properties such as positive semidefiniteness and nullspaces. We then showed how these models translate into concrete implementations in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica, connecting back to the planning and learning machinery developed earlier in the course.

12. References

  1. Terzopoulos, D., Platt, J., Barr, A., & Fleischer, K. (1987). Elastically deformable models. Computer Graphics (SIGGRAPH), 21(4), 205–214.
  2. Baraff, D., & Witkin, A. (1998). Large steps in cloth simulation. Proceedings of SIGGRAPH, 43–54.
  3. Bergou, M., Wardetzky, M., Robinson, S., Audoly, B., & Grinspun, E. (2008). Discrete elastic rods. ACM Transactions on Graphics, 27(3), 63:1–63:12.
  4. Toussaint, M., & Lopes, M. (2017). Multi-bound tree search for logic-geometric programming in cooperative manipulation domains. IJCAI, 1230–1236.
  5. Schulman, J., Ho, J., Lee, A., Awwal, I., Bradlow, H., & Abbeel, P. (2013). Finding locally optimal, collision-free trajectories with sequential convex optimization. Robotics: Science and Systems.
  6. Eppner, C., & Brock, O. (2013). Planning grasp strategies that enable dynamic manipulations of deformable objects. IEEE International Conference on Robotics and Automation, 4958–4964.
  7. Yamakawa, Y., Senoo, T., Namiki, A., & Ishikawa, M. (2010). Dynamic high-speed folding of a cloth using a high-speed multifingered hand and a high-speed vision system. IEEE International Conference on Robotics and Automation, 5486–5491.
  8. Hauser, K., Bretl, T., Latombe, J.-C., Harada, K., & Wilcox, B. (2008). Motion planning for legged robots on varied terrain. International Journal of Robotics Research, 27(11–12), 1325–1349.
  9. Han, W., & Inoue, H. (1992). Study on a skill of clothes handling using a multifingered robot hand. IEEE/RSJ International Conference on Intelligent Robots and Systems, 2047–2054.
  10. Mellema, R., Stuber, J., & van de Wouw, N. (2020). Modeling and control of cable and hose routing for robotic applications. IFAC-PapersOnLine, 53(2), 8226–8233.