Chapter 7: Grasp Representation and Grasp Quality

Lesson 4: Robust Grasping Under Uncertainty

This lesson formalizes robust grasping as the problem of choosing grasps that remain stable despite uncertainty in object pose, contact location, and friction. Building on contact models, force/form closure, and grasp wrench space from previous lessons, we introduce probabilistic and worst-case models of uncertainty and define robust grasp quality metrics together with sampling-based approximations and multi-language implementations.

1. Motivation and Types of Uncertainty in Grasping

In previous lessons, we assumed a deterministic grasp model: object pose, contact locations, surface normals, and friction coefficients were known exactly. Let \( \mathbf{f} \in \mathbb{R}^{m_c} \) denote the stacked contact forces and \( \mathbf{G} \in \mathbb{R}^{6 \times m_c} \) the grasp map, so the net wrench on the object is

\[ \mathbf{w}_\text{net} = \mathbf{G}\mathbf{f} + \mathbf{w}_\text{ext}. \]

In reality, the following sources of uncertainty are present:

  • Pose uncertainty: the object frame relative to the gripper is only known approximately due to perception noise.
  • Contact uncertainty: small errors in finger placement and local surface geometry perturb contact positions and normals.
  • Friction uncertainty: the friction coefficient \( \mu_i \) at each contact is only known up to a range or distribution.
  • Model uncertainty: simplifications in contact models (e.g., point contacts with friction) and object mass/inertia.

We collect all uncertain parameters in a random vector \( \boldsymbol{\Xi} \), so that the grasp map and admissible contact forces become random:

\[ \boldsymbol{\Xi} \in \mathbb{R}^d, \quad \boldsymbol{\Xi} \sim p(\boldsymbol{\xi}), \quad \mathbf{G} = \mathbf{G}(\boldsymbol{\Xi}), \quad \mathcal{F} = \mathcal{F}(\boldsymbol{\Xi}). \]

Let \( q(\boldsymbol{\Xi}) \) denote a grasp quality metric (e.g., Ferrari–Canny radius) evaluated under a particular realization of the uncertain parameters. The robust grasping problem is:

\[ \text{Choose a grasp } g^\star \text{ such that } q(\boldsymbol{\Xi}; g^\star) \text{ is high with respect to the uncertainty model } p(\boldsymbol{\xi}). \]

A high-level pipeline for robust grasp selection is:

flowchart TD
  A["Candidate grasps Gi"] --> B["Uncertainty model p(xi)"]
  B --> C["Robust metric J(Gi) (worst-case / expected / chance)"]
  C --> D["Optimization or search over Gi"]
  D --> E["Execute chosen grasp on robot"]
        

The rest of this lesson makes each block mathematically precise and shows how to implement it in practice.

2. Probabilistic Models for Pose and Contact Uncertainty

We model object pose and local contact properties as random variables. Let \( \mathbf{x}_o \) parameterize the object pose in \( SE(3) \) using minimal coordinates \( \mathbf{x}_o = [\mathbf{t}^\top, \boldsymbol{\phi}^\top]^\top \in \mathbb{R}^6 \) with translation \( \mathbf{t} \in \mathbb{R}^3 \) and small-angle orientation \( \boldsymbol{\phi} \in \mathbb{R}^3 \). A common Gaussian pose model is

\[ \mathbf{x}_o \sim \mathcal{N}(\bar{\mathbf{x}}_o, \Sigma_o). \]

Let \( \mathbf{p}_i(\mathbf{x}_o) \) denote the nominal contact point on the object surface expressed in the object frame, and \( \mathbf{n}_i(\mathbf{x}_o) \) the surface normal. For small perturbations around the mean pose \( \bar{\mathbf{x}}_o \), a first-order linearization gives

\[ \mathbf{p}_i(\mathbf{x}_o) \approx \mathbf{p}_i(\bar{\mathbf{x}}_o) + \mathbf{J}_{p_i}(\bar{\mathbf{x}}_o)\, (\mathbf{x}_o - \bar{\mathbf{x}}_o), \]

where \( \mathbf{J}_{p_i}(\bar{\mathbf{x}}_o) \) is the Jacobian of the contact position with respect to pose. Because affine transformations preserve Gaussianity, we obtain

\[ \mathbb{E}[\mathbf{p}_i] = \mathbf{p}_i(\bar{\mathbf{x}}_o), \quad \operatorname{Cov}[\mathbf{p}_i] = \mathbf{J}_{p_i}(\bar{\mathbf{x}}_o)\, \Sigma_o\, \mathbf{J}_{p_i}^\top(\bar{\mathbf{x}}_o). \]

Similarly, we can model the friction coefficient at contact \( i \) as a random variable \( \mu_i \):

\[ \mu_i \sim \mathcal{N}(\bar{\mu}_i, \sigma_{\mu,i}^2) \text{ truncated to } [\mu_{\min,i}, \mu_{\max,i}], \]

ensuring physically meaningful nonnegative friction values. The full uncertainty vector that parameterizes the grasp is then

\[ \boldsymbol{\Xi} = \begin{bmatrix} \mathbf{x}_o \\ \mu_1 \\ \vdots \\ \mu_{m_c} \end{bmatrix}, \quad \boldsymbol{\Xi} \sim p(\boldsymbol{\xi}) \text{ with mean } \bar{\boldsymbol{\xi}} \text{ and covariance } \Sigma_{\xi}. \]

Given \( \boldsymbol{\Xi} \), all quantities entering the grasp map (contact points, normals, friction cones) become functions of \( \boldsymbol{\Xi} \), so the grasp map itself is random:

\[ \mathbf{G}(\boldsymbol{\Xi}) = \mathbf{G}\big(\{\mathbf{p}_i(\mathbf{x}_o), \mathbf{n}_i(\mathbf{x}_o), \mu_i\}_{i=1}^{m_c}\big). \]

In practice, probabilistic models are obtained from camera calibration error, pose estimation covariance from ICP or PnP algorithms, and empirical friction measurements. The next section explains how these uncertainties affect grasp quality.

3. Robust Grasp Quality Metrics

In Lesson 3, we defined a deterministic grasp quality metric \( q(\mathbf{G}) \), such as the Ferrari–Canny radius:

\[ q(\mathbf{G}) = \min_{\|\mathbf{d}\|_2 = 1} \max_{\mathbf{f} \in \mathcal{F}} \mathbf{d}^\top \mathbf{G}\mathbf{f}, \]

which measures the radius of the largest wrench ball contained in the grasp wrench space. Under uncertainty, we consider \( q(\boldsymbol{\Xi}) = q(\mathbf{G}(\boldsymbol{\Xi})) \) as a random variable. Three commonly used robust extensions are:

3.1 Worst-Case (Set-Based) Robustness

Let \( \mathcal{U} \subset \mathbb{R}^d \) be a compact uncertainty set (e.g., an ellipsoid):

\[ \mathcal{U} = \left\{ \boldsymbol{\xi} : (\boldsymbol{\xi} - \bar{\boldsymbol{\xi}})^\top \Sigma_{\xi}^{-1} (\boldsymbol{\xi} - \bar{\boldsymbol{\xi}}) \le \rho^2 \right\}. \]

The worst-case robust quality is

\[ q_{\text{wc}} = \inf_{\boldsymbol{\xi} \in \mathcal{U}} q(\boldsymbol{\xi}). \]

This ensures that for all parameter realizations in \( \mathcal{U} \) the grasp quality never drops below \( q_{\text{wc}} \).

3.2 Expected Robustness

For a probabilistic model \( p(\boldsymbol{\xi}) \), the expected grasp quality is

\[ q_{\text{exp}} = \mathbb{E}[q(\boldsymbol{\Xi})] = \int q(\boldsymbol{\xi})\, p(\boldsymbol{\xi})\, d\boldsymbol{\xi}. \]

Maximizing \( q_{\text{exp}} \) yields grasps that are good on average, but does not control rare but catastrophic failures.

3.3 Chance-Constrained Robustness

A compromise between worst-case and expected performance is to require that the quality exceeds a threshold with high probability. For a risk level \( 0 < \delta < 1 \), define the chance-constrained robust quality

\[ q_\delta^\star = \sup_{\gamma} \left\{ \gamma \; \middle| \; \mathbb{P}\big(q(\boldsymbol{\Xi}) \ge \gamma\big) \ge 1 - \delta \right\}. \]

Intuitively, \( q_\delta^\star \) is the largest quality level that the grasp achieves with probability at least \( 1 - \delta \). In terms of the cumulative distribution function (CDF) \( F_q \) of \( q(\boldsymbol{\Xi}) \),

\[ q_\delta^\star = F_q^{-1}(\delta), \]

i.e., the \( \delta \)-quantile of the quality distribution.

3.4 Simple Ordering Result

Let \( q_{\text{nom}} = q(\bar{\boldsymbol{\xi}}) \) be the nominal deterministic quality (evaluated at the mean parameters). Then, by definition,

\[ q_{\text{wc}} = \inf_{\boldsymbol{\xi} \in \mathcal{U}} q(\boldsymbol{\xi}) \le q(\bar{\boldsymbol{\xi}}) = q_{\text{nom}}. \]

So worst-case robust quality is always a lower bound on nominal quality. This illustrates the conservative nature of worst-case design.

4. Approximation via Sampling and Linearization

For realistic grasps and uncertainty models, the exact computation of \( q_{\text{wc}} \), \( q_{\text{exp}} \), or \( q_\delta^\star \) is intractable. We therefore rely on approximations based on sampling (Monte Carlo) and local linearizations.

4.1 Monte Carlo Estimators

Draw independent samples \( \boldsymbol{\xi}^{(1)}, \dots, \boldsymbol{\xi}^{(N)} \) from \( p(\boldsymbol{\xi}) \), and define \( q_k = q(\boldsymbol{\xi}^{(k)}) \). Then

\[ \widehat{q}_{\text{exp}} = \frac{1}{N}\sum_{k=1}^N q_k \]

is an unbiased estimator of \( q_{\text{exp}} \). For chance constraints, define the empirical violation probability

\[ \widehat{P}_\gamma = \frac{1}{N}\sum_{k=1}^N \mathbf{1}\big( q_k < \gamma \big). \]

A candidate robustness level \( \gamma \) is acceptable if \( \widehat{P}_\gamma \le \delta \). The corresponding empirical robust quality is simply the empirical \( \delta \)-quantile of \( \{q_k\}_{k=1}^N \).

4.2 Linearization of Wrenches

Another useful approximation is to linearize the wrench with respect to the uncertainty vector \( \boldsymbol{\Xi} \):

\[ \mathbf{w}_\text{net}(\boldsymbol{\Xi}) = \mathbf{G}(\boldsymbol{\Xi})\mathbf{f} + \mathbf{w}_\text{ext} \approx \mathbf{w}_0 + \mathbf{J}_w(\bar{\boldsymbol{\xi}}) (\boldsymbol{\Xi} - \bar{\boldsymbol{\xi}}), \]

where \( \mathbf{w}_0 = \mathbf{G}(\bar{\boldsymbol{\xi}})\mathbf{f} + \mathbf{w}_\text{ext} \) and \( \mathbf{J}_w(\bar{\boldsymbol{\xi}}) \) is the Jacobian of the wrench with respect to the uncertainty parameters. If \( \boldsymbol{\Xi} \sim \mathcal{N}(\bar{\boldsymbol{\xi}}, \Sigma_{\xi}) \), then

\[ \mathbf{w}_\text{net}(\boldsymbol{\Xi}) \sim \mathcal{N}\big( \mathbf{w}_0, \Sigma_w \big), \quad \Sigma_w = \mathbf{J}_w(\bar{\boldsymbol{\xi}}) \Sigma_{\xi} \mathbf{J}_w^\top(\bar{\boldsymbol{\xi}}). \]

This Gaussian wrench model can be used, for example, to bound the probability that a disturbance wrench lies outside the grasp wrench space, by comparing mean and covariance with a conservative approximation of the wrench space.

4.3 Algorithmic Flow

A generic algorithm for evaluating robust grasp quality via sampling is:

flowchart TD
  S["Sample xi(k) ~ p(xi) for k = 1..N"] --> Q["For each sample compute quality q_k"]
  Q --> AGG["Aggregate q_k: mean / min / quantile"]
  AGG --> DEC["Use aggregated metric to compare candidate grasps"]
        

The next section turns this into concrete implementations in Python, C++, Java, MATLAB, and Mathematica.

5. Multi-Language Lab — Monte Carlo Robust Grasp Evaluation

We implement a simplified robust Ferrari–Canny-like metric in multiple languages. We assume that for each grasp we already have a nominal set of planar wrenches \( \mathbf{w}_j \in \mathbb{R}^3 \) (2D force + torque around the out-of-plane axis) stacked as columns of \( \mathbf{W}_0 \in \mathbb{R}^{3 \times m} \). We treat uncertainty as additive zero-mean Gaussian noise on each wrench:

\[ \mathbf{W} = \mathbf{W}_0 + \Delta\mathbf{W}, \quad \Delta\mathbf{W}_{:,j} \sim \mathcal{N}(\mathbf{0}, \sigma_w^2 \mathbf{I}_3) \text{ independently}. \]

For a given realization of \( \mathbf{W} \), an approximate Ferrari–Canny quality is

\[ q(\mathbf{W}) \approx \min_{\ell=1,\dots,L} \max_{j=1,\dots,m} \mathbf{d}_\ell^\top \mathbf{w}_j, \]

where \( \{\mathbf{d}_\ell\}_{\ell=1}^L \) is a set of unit vectors uniformly distributed on the unit sphere in \( \mathbb{R}^3 \).

5.1 Python Implementation (NumPy)

Python is convenient for prototyping robust metrics; in practice, libraries such as trimesh, pybullet, or open3d can be used to compute contact points and wrenches.


import numpy as np

def random_unit_vectors(num_dirs: int, dim: int = 3) -> np.ndarray:
    """Sample unit vectors uniformly by normalizing Gaussian samples."""
    v = np.random.normal(size=(num_dirs, dim))
    v /= np.linalg.norm(v, axis=1, keepdims=True) + 1e-12
    return v  # shape (num_dirs, dim)

def ferrari_canny_approx(W: np.ndarray, num_dirs: int = 64) -> float:
    """
    Approximate Ferrari-Canny quality for planar wrenches.
    W: shape (3, m) with each column a wrench vector.
    """
    dirs = random_unit_vectors(num_dirs, dim=3)  # candidate disturbance directions
    q_val = np.inf
    for d in dirs:
        supports = d @ W  # inner products with all wrenches
        q_dir = supports.max()
        if q_dir < q_val:
            q_val = q_dir
    return float(q_val)

def robust_quality_mc(W0: np.ndarray,
                      sigma_w: float = 0.05,
                      num_samples: int = 200,
                      delta: float = 0.1):
    """
    Monte Carlo robust grasp quality.
    Returns (expected_quality, delta_quantile_quality).
    """
    qualities = []
    for _ in range(num_samples):
        noise = sigma_w * np.random.normal(size=W0.shape)
        W = W0 + noise
        q = ferrari_canny_approx(W)
        qualities.append(q)
    qualities = np.array(qualities)
    q_exp = float(qualities.mean())
    q_delta = float(np.quantile(qualities, delta))  # empirical delta-quantile
    return q_exp, q_delta

if __name__ == "__main__":
    np.random.seed(0)

    # Example nominal wrenches (3 x 4) for a simple planar 4-contact grasp
    W0 = np.array([
        [ 1.0, -1.0,  0.8, -0.8],
        [ 0.8,  0.8, -0.8, -0.8],
        [ 0.2, -0.2,  0.3, -0.3]
    ])

    q_exp, q_delta = robust_quality_mc(W0, sigma_w=0.05, num_samples=500, delta=0.1)
    print("Expected quality:", q_exp)
    print("0.1-quantile robust quality:", q_delta)
      

5.2 C++ Implementation (Eigen, ROS/MoveIt Ecosystem)

In C++, robust quality computation can be integrated into planning systems built on ROS, MoveIt, and collision libraries such as FCL. Below we show a minimal standalone Eigen-based implementation of the same Monte Carlo estimator.


#include <iostream>
#include <vector>
#include <random>
#include <Eigen/Dense>

using Wrench = Eigen::Vector3d;

Eigen::Vector3d randomUnitVector3(std::mt19937 &gen) {
    std::normal_distribution<double> dist(0.0, 1.0);
    Eigen::Vector3d v(dist(gen), dist(gen), dist(gen));
    double n = v.norm();
    if (n < 1e-12) {
        return Eigen::Vector3d(1.0, 0.0, 0.0);
    }
    return v / n;
}

double ferrariCannyApprox(const std::vector<Wrench> &wrenches,
                          int numDirs,
                          std::mt19937 &gen) {
    double q_val = std::numeric_limits<double>::infinity();
    for (int k = 0; k < numDirs; ++k) {
        Eigen::Vector3d d = randomUnitVector3(gen);
        double q_dir = -std::numeric_limits<double>::infinity();
        for (const auto &w : wrenches) {
            double s = d.dot(w);
            if (s > q_dir) {
                q_dir = s;
            }
        }
        if (q_dir < q_val) {
            q_val = q_dir;
        }
    }
    return q_val;
}

std::pair<double, double> robustQualityMC(
    const std::vector<Wrench> &W0,
    double sigma_w,
    int numSamples,
    double delta) {

    std::mt19937 gen(42);
    std::normal_distribution<double> noiseDist(0.0, sigma_w);

    std::vector<double> qVals;
    qVals.reserve(numSamples);

    for (int s = 0; s < numSamples; ++s) {
        std::vector<Wrench> W;
        W.reserve(W0.size());
        for (const auto &w0 : W0) {
            Wrench w = w0;
            w[0] += noiseDist(gen);
            w[1] += noiseDist(gen);
            w[2] += noiseDist(gen);
            W.push_back(w);
        }
        double q = ferrariCannyApprox(W, 64, gen);
        qVals.push_back(q);
    }

    // compute mean
    double mean = 0.0;
    for (double q : qVals) {
        mean += q;
    }
    mean /= static_cast<double>(qVals.size());

    // compute empirical delta-quantile
    std::sort(qVals.begin(), qVals.end());
    int idx = static_cast<int>(delta * qVals.size());
    idx = std::max(0, std::min(idx, static_cast<int>(qVals.size()) - 1));
    double q_delta = qVals[idx];

    return {mean, q_delta};
}

int main() {
    // Example nominal wrenches
    std::vector<Wrench> W0;
    W0.emplace_back(1.0,  0.8,  0.2);
    W0.emplace_back(-1.0, 0.8, -0.2);
    W0.emplace_back(0.8, -0.8,  0.3);
    W0.emplace_back(-0.8,-0.8, -0.3);

    auto result = robustQualityMC(W0, 0.05, 500, 0.1);
    std::cout << "Expected quality: " << result.first << std::endl;
    std::cout << "0.1-quantile quality: " << result.second << std::endl;
    return 0;
}
      

5.3 Java Implementation (e.g., with EJML)

In Java, linear algebra libraries such as EJML can be used to manipulate wrenches and grasp matrices. The following code uses only basic arrays to keep dependencies minimal.


import java.util.Arrays;
import java.util.Random;

public class RobustGraspJava {

    private static double[] randomUnitVector3(Random rng) {
        double x = rng.nextGaussian();
        double y = rng.nextGaussian();
        double z = rng.nextGaussian();
        double n = Math.sqrt(x * x + y * y + z * z);
        if (n < 1e-12) {
            return new double[]{1.0, 0.0, 0.0};
        }
        return new double[]{x / n, y / n, z / n};
    }

    private static double ferrariCannyApprox(double[][] W,
                                             int numDirs,
                                             Random rng) {
        int m = W.length;
        double qVal = Double.POSITIVE_INFINITY;
        for (int k = 0; k < numDirs; ++k) {
            double[] d = randomUnitVector3(rng);
            double qDir = Double.NEGATIVE_INFINITY;
            for (int j = 0; j < m; ++j) {
                double s = d[0] * W[j][0] + d[1] * W[j][1] + d[2] * W[j][2];
                if (s > qDir) {
                    qDir = s;
                }
            }
            if (qDir < qVal) {
                qVal = qDir;
            }
        }
        return qVal;
    }

    public static double[] robustQualityMC(double[][] W0,
                                           double sigmaW,
                                           int numSamples,
                                           double delta) {
        Random rng = new Random(42L);
        double[] qVals = new double[numSamples];

        for (int s = 0; s < numSamples; ++s) {
            double[][] W = new double[W0.length][3];
            for (int j = 0; j < W0.length; ++j) {
                for (int k = 0; k < 3; ++k) {
                    double noise = rng.nextGaussian() * sigmaW;
                    W[j][k] = W0[j][k] + noise;
                }
            }
            qVals[s] = ferrariCannyApprox(W, 64, rng);
        }

        // mean
        double mean = 0.0;
        for (double q : qVals) {
            mean += q;
        }
        mean /= numSamples;

        // delta-quantile
        Arrays.sort(qVals);
        int idx = (int) (delta * numSamples);
        if (idx < 0) idx = 0;
        if (idx >= numSamples) idx = numSamples - 1;
        double qDelta = qVals[idx];

        return new double[]{mean, qDelta};
    }

    public static void main(String[] args) {
        double[][] W0 = new double[][]{
            { 1.0,  0.8,  0.2},
            {-1.0,  0.8, -0.2},
            { 0.8, -0.8,  0.3},
            {-0.8, -0.8, -0.3}
        };

        double[] res = robustQualityMC(W0, 0.05, 500, 0.1);
        System.out.println("Expected quality = " + res[0]);
        System.out.println("0.1-quantile quality = " + res[1]);
    }
}
      

5.4 MATLAB / Simulink Implementation

In MATLAB, the Robotics System Toolbox can be used to compute contacts and wrenches from 3D geometry. The following script implements the Monte Carlo robust metric; this code can be wrapped in a MATLAB Function block inside Simulink for real-time evaluation.


function [qExp, qDelta] = robustQualityMC(W0, sigmaW, numSamples, delta)
% W0: 3 x m matrix of nominal wrenches
% sigmaW: scalar wrench noise std
% numSamples: Monte Carlo samples
% delta: risk level (e.g., 0.1)

if nargin < 2, sigmaW = 0.05; end
if nargin < 3, numSamples = 200; end
if nargin < 4, delta = 0.1; end

[dim, m] = size(W0);
assert(dim == 3, 'Wrenches must be 3xM.');

qVals = zeros(numSamples, 1);

for s = 1:numSamples
    noise = sigmaW * randn(size(W0));
    W = W0 + noise;
    qVals(s) = ferrariCannyApprox(W, 64);
end

qExp = mean(qVals);
sortedQ = sort(qVals);
idx = max(1, min(length(sortedQ), floor(delta * length(sortedQ))));
qDelta = sortedQ(idx);

end

function qVal = ferrariCannyApprox(W, numDirs)
% Approximate Ferrari-Canny quality for planar wrenches.
if nargin < 2, numDirs = 64; end
[dim, m] = size(W);
qVal = inf;
for k = 1:numDirs
    d = randn(dim, 1);
    d = d / (norm(d) + 1e-12);
    supports = d' * W;   % 1 x m
    qDir = max(supports);
    if qDir < qVal
        qVal = qDir;
    end
end
end

% Example usage:
% W0 = [ 1.0  -1.0   0.8  -0.8;
%        0.8   0.8  -0.8  -0.8;
%        0.2  -0.2   0.3  -0.3 ];
% [qExp, qDelta] = robustQualityMC(W0, 0.05, 500, 0.1)
      

5.5 Mathematica Implementation

Mathematica is useful for symbolic reasoning about robust metrics and visualizing quality distributions.


(* Nominal wrenches: 3 x 4 matrix *)
W0 = {
  { 1.0, -1.0,  0.8, -0.8},
  { 0.8,  0.8, -0.8, -0.8},
  { 0.2, -0.2,  0.3, -0.3}
};

randomUnitVector3[] := Module[{v},
  v = RandomVariate[NormalDistribution[0, 1], 3];
  v/Norm[v]
];

ferrariCannyApprox[W_, numDirs_: 64] := Module[
  {dirs, supports, qVals},
  dirs = Table[randomUnitVector3[], {numDirs}];
  qVals = Table[
    Max[dirs[[k]].W[[All, j]] & /@ Range[Length[W[[1]]]]],
    {k, 1, numDirs}
  ];
  Min[qVals]
];

robustQualityMC[W0_, sigmaW_: 0.05, numSamples_: 200, delta_: 0.1] := Module[
  {qVals, m, noise, W, qExp, qDelta},
  m = Length[W0[[1]]];
  qVals = Table[
    noise = RandomVariate[NormalDistribution[0, sigmaW], {3, m}];
    W = W0 + noise;
    ferrariCannyApprox[W],
    {numSamples}
  ];
  qExp = Mean[qVals];
  qDelta = Quantile[qVals, delta];
  {qExp, qDelta}
];

{qExp, qDelta} = robustQualityMC[W0, 0.05, 500, 0.1];
Print["Expected quality = ", qExp];
Print["0.1-quantile quality = ", qDelta];
      

In all implementations, the same mathematical structure appears: sampling wrenches under uncertainty, evaluating an approximate Ferrari–Canny quality, and aggregating samples into robust metrics.

6. Problems and Solutions

Problem 1 (Scalar quality under Gaussian uncertainty). Let the grasp quality be modeled as \( q(\Xi) = q_0 + a \Xi \) with \( \Xi \sim \mathcal{N}(0, \sigma^2) \) and \( a > 0 \). Compute: (a) \( \mathbb{E}[q(\Xi)] \), (b) \( \mathbb{P}(q(\Xi) \ge \gamma) \) for a given threshold \( \gamma \), and (c) the worst-case quality over the bounded set \( \Xi \in [-\varepsilon, \varepsilon] \).

Solution.

(a) Linearity of expectation gives

\[ \mathbb{E}[q(\Xi)] = \mathbb{E}[q_0 + a\Xi] = q_0 + a\mathbb{E}[\Xi] = q_0. \]

(b) We have \( q(\Xi) \ge \gamma \) iff \( a\Xi \ge \gamma - q_0 \), i.e. \( \Xi \ge (\gamma - q_0)/a \) because \( a > 0 \). Thus

\[ \mathbb{P}(q(\Xi) \ge \gamma) = \mathbb{P}\!\left( \Xi \ge \frac{\gamma - q_0}{a} \right) = 1 - \Phi\!\left( \frac{\gamma - q_0}{a\sigma} \right), \]

where \( \Phi \) is the standard normal CDF.

(c) On the interval \( [-\varepsilon, \varepsilon] \), the function \( q(\Xi) = q_0 + a\Xi \) is increasing, so the worst-case (minimum) occurs at \( \Xi = -\varepsilon \):

\[ q_{\text{wc}} = \min_{\Xi \in [-\varepsilon,\varepsilon]} q(\Xi) = q_0 - a\varepsilon. \]


Problem 2 (Friction interval and worst-case quality). Consider a planar force-closure grasp whose deterministic quality \( q(\mu) \) depends on the friction coefficient \( \mu \) at all contacts, where \( q(\mu) \) is monotonically increasing in \( \mu \) (wider friction cones improve the grasp). Suppose \( \mu \in [\mu_{\min}, \mu_{\max}] \). Show that the worst-case robust quality with respect to this interval is attained at \( \mu_{\min} \).

Solution.

The worst-case quality is

\[ q_{\text{wc}} = \inf_{\mu \in [\mu_{\min}, \mu_{\max}]} q(\mu). \]

By assumption, \( q(\mu) \) is monotonically increasing in \( \mu \), so for any \( \mu_1 < \mu_2 \) we have \( q(\mu_1) \le q(\mu_2) \). In particular, for every \( \mu \in [\mu_{\min}, \mu_{\max}] \), \( q(\mu_{\min}) \le q(\mu) \). Therefore

\[ q_{\text{wc}} = q(\mu_{\min}), \]

so robust design with respect to a friction interval is equivalent to evaluating the deterministic metric at the smallest plausible friction coefficient.


Problem 3 (Gaussian propagation of wrench uncertainty). Suppose the net wrench is approximated by the linearized model

\[ \mathbf{w}_\text{net}(\boldsymbol{\Xi}) \approx \mathbf{w}_0 + \mathbf{J}_w(\bar{\boldsymbol{\xi}}) (\boldsymbol{\Xi} - \bar{\boldsymbol{\xi}}), \]

and \( \boldsymbol{\Xi} \sim \mathcal{N}(\bar{\boldsymbol{\xi}}, \Sigma_{\xi}) \). Show that \( \mathbf{w}_\text{net}(\boldsymbol{\Xi}) \) is Gaussian and derive its mean and covariance.

Solution.

Let \( \mathbf{A} = \mathbf{J}_w(\bar{\boldsymbol{\xi}}) \) and \( \mathbf{b} = \mathbf{w}_0 - \mathbf{A}\bar{\boldsymbol{\xi}} \), so the affine model can be written as \( \mathbf{w}_\text{net}(\boldsymbol{\Xi}) = \mathbf{A}\boldsymbol{\Xi} + \mathbf{b} \). A basic result on affine transformations of Gaussians states that if \( \boldsymbol{\Xi} \sim \mathcal{N}(\bar{\boldsymbol{\xi}}, \Sigma_{\xi}) \), then \( \mathbf{A}\boldsymbol{\Xi} + \mathbf{b} \) is Gaussian with mean \( \mathbf{A}\bar{\boldsymbol{\xi}} + \mathbf{b} \) and covariance \( \mathbf{A}\Sigma_{\xi}\mathbf{A}^\top \). Substituting back,

\[ \mathbf{w}_\text{net}(\boldsymbol{\Xi}) \sim \mathcal{N}\big( \mathbf{w}_0, \Sigma_w \big), \quad \Sigma_w = \mathbf{J}_w(\bar{\boldsymbol{\xi}}) \Sigma_{\xi} \mathbf{J}_w^\top(\bar{\boldsymbol{\xi}}). \]


Problem 4 (Empirical robust quality from samples). For a candidate grasp, suppose a Monte Carlo simulation with \( N = 5 \) samples yields quality values \( q = [0.20,\; 0.30,\; 0.10,\; 0.40,\; 0.25] \). (a) Compute the empirical expected quality. (b) For risk level \( \delta = 0.2 \), compute the empirical \( \delta \)-quantile robust quality.

Solution.

(a) The empirical expectation is

\[ \widehat{q}_{\text{exp}} = \frac{1}{5}(0.20 + 0.30 + 0.10 + 0.40 + 0.25) = \frac{1.25}{5} = 0.25. \]

(b) Sort the samples: \( q_{\text{sorted}} = [0.10,\; 0.20,\; 0.25,\; 0.30,\; 0.40] \). With \( \delta = 0.2 \), a simple index rule is \( k = \lfloor \delta N \rfloor = \lfloor 1 \rfloor = 1 \) using 1-based indexing. The empirical \( \delta \)-quantile is then \( q_{\text{sorted},1} = 0.10 \). Thus the empirical robust quality is \( 0.10 \) for this tiny sample. More sophisticated indexing rules converge to the true quantile as \( N \) grows.


Problem 5 (Monotonicity of chance-constrained quality in risk). For a fixed grasp, define

\[ q_\delta^\star = \sup_{\gamma} \left\{ \gamma \; \middle| \; \mathbb{P}(q(\boldsymbol{\Xi}) \ge \gamma) \ge 1 - \delta \right\}. \]

Show that if \( 0 < \delta_1 < \delta_2 < 1 \), then \( q_{\delta_1}^\star \le q_{\delta_2}^\star \).

Solution.

Let \( S_\delta = \{\gamma : \mathbb{P}(q(\boldsymbol{\Xi}) \ge \gamma) \ge 1 - \delta\} \). By definition, \( q_\delta^\star = \sup S_\delta \). If \( 0 < \delta_1 < \delta_2 \), then \( 1 - \delta_1 > 1 - \delta_2 \), so the constraint \( \mathbb{P}(q(\boldsymbol{\Xi}) \ge \gamma) \ge 1 - \delta_1 \) is stricter than \( \mathbb{P}(q(\boldsymbol{\Xi}) \ge \gamma) \ge 1 - \delta_2 \). Therefore \( S_{\delta_1} \subseteq S_{\delta_2} \), and hence

\[ q_{\delta_1}^\star = \sup S_{\delta_1} \le \sup S_{\delta_2} = q_{\delta_2}^\star. \]

Allowing more risk (larger \( \delta \)) thus permits a higher robust quality level.

7. Summary

This lesson extended grasp quality analysis from deterministic models to settings with pose, contact, and friction uncertainty. We:

  • Modeled uncertain grasp parameters as random variables or elements of a compact uncertainty set.
  • Defined worst-case, expected, and chance-constrained robust quality metrics based on the underlying deterministic metric (e.g., Ferrari–Canny).
  • Used first-order linearization to propagate Gaussian uncertainty from pose parameters to wrenches.
  • Developed Monte Carlo estimators for robust qualities and implemented them in Python, C++, Java, MATLAB/Simulink, and Mathematica.

These concepts are central when deploying grasps in real systems where sensing and modeling are imperfect. Subsequent lessons will focus on synthesizing grasps and manipulating objects while exploiting such robustness concepts.

8. References

  1. Ferrari, C., & Canny, J. (1992). Planning optimal grasps. Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 2290–2295.
  2. Nguyen, V.-D. (1988). Constructing force-closure grasps. International Journal of Robotics Research, 7(3), 3–16.
  3. Pollard, N. S. (2004). Closure and quality measures for planar grasps under uncertainty. International Journal of Robotics Research, 23(7–8), 705–718.
  4. Roa, M. A., & Suárez, R. (2009). Computation of independent contact regions for grasping 3-D objects. IEEE Transactions on Robotics, 25(4), 839–850.
  5. Pinto, L., & Gupta, A. (2016). Supersizing self-supervision: Learning to grasp from 50K tries and 700 robot hours. Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 3406–3413.
  6. Hsiao, K., Lozano-Pérez, T., & Kaelbling, L. P. (2007). Grasping POMDPs. Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 4485–4492.
  7. Bertsimas, D., & Sim, M. (2004). The price of robustness. Operations Research, 52(1), 35–53.
  8. Campi, M. C., Garatti, S., & Calafiore, G. C. (2009). The scenario approach for systems and control design. Annual Reviews in Control, 33(2), 149–157.