# Learning Keypoint Constraints from Visual Demonstrations for Safe Motion Planning

Robotics.world

> Robots need safety constraints and task requirements that end users find hard to specify, and existing constrained inverse optimal control methods require labeled state–action data plus analytical…

**arXiv**: 2610.19295 · Preprint · not peer-reviewed

**Published**: 2026-10-13

**Authors**: Zheng Qiu, Zhouyu Zhang, Ninghan Zhong, Glen Chou

## In plain words

Robots need safety constraints and task requirements that end users find hard to specify, and existing constrained inverse optimal control methods require labeled state–action data plus analytical dynamics — assumptions that break down for deformable objects or when no compact state estimate exists.

## AI summary

## Overview

**Research area:** Robotics — constrained inverse optimal control (CIOC), learning from visual demonstrations, and safe motion planning.

**Technical level:** Advanced. The paper assumes familiarity with constrained optimal control, KKT conditions, inverse optimization, and tube-based robust control.

**Scope:** A single framework (Keypoint Constraint Learning, KCL) that converts RGB-D human demonstrations into sparse 3D keypoint–mask trajectories, infers interpretable distance and orientation constraints via KKT conditions with learned keypoint dynamics, and plans robustly with those constraints in simulation and on hardware.

## What This Paper Is About

Robots need safety constraints and task requirements that end users find hard to specify, and existing constrained inverse optimal control methods require labeled state–action data plus analytical dynamics — assumptions that break down for deformable objects or when no compact state estimate exists. Video is an easy, rich source of demonstration data, but raw pixels are too high-dimensional for control and pixel-space constraints do not generalize.

The paper closes that gap by using sparse 3D object-centric keypoints plus semantic mask centroids as an intermediate representation, inferring geometric constraints from demonstrations in that reduced space, and planning trajectories that satisfy the inferred constraints while accounting for perception and learned-model error.

## Key Contributions

1. **A keypoint–mask visual state representation for constraint learning.** Semantic masks are extracted with SAM, keypoints are selected inside each mask by clustering DINOv2 features with k-means, tracked over time with TAPNext++, and lifted to 3D world coordinates with depth and camera calibration. The stacked keypoints and mask centroids form a reduced geometric state used for both dynamics learning and constraint inference.
2. **KKT-based inference of geometric constraints with learned dynamics.** Distance constraints (a learned squared margin ρ between a keypoint and a mask centroid) and orientation constraints (a learned axis-alignment threshold σ on a keypoint pair) are recovered by solving a relaxed inverse KKT problem that minimizes stationarity residuals with a slack on the learned dynamics equalities, using Big-M constraints for complementarity. Stage-wise parameters allow multi-stage tasks, and candidates that are always inactive or insensitive are pruned.
3. **A sensitivity analysis of constraint recovery.** Theorem 1 bounds the error in the learned distance margins and orientation thresholds as a function of keypoint/centroid perception error (ε_k, ε_c), the minimum keypoint-pair separation (ℓ_min), and error in the learned dynamics Jacobians (ε_f), via constants r_d, r_o, κ_ρ, κ_σ and ν̄.
4. **A robust feedback planner plus simulation and hardware validation.** A nominal trajectory is computed with IPOPT against the learned constraints, then tightened using a system-level synthesis (SLS) tube whose radii come from held-out one-step prediction residuals; the robust distance constraint requires the planned keypoint–centroid distance to exceed the learned clearance by the tube radius. The method is validated on navigation, rigid manipulation, deformable rope manipulation, and multi-stage tasks.

## Main Findings

- **Dubins-car obstacle avoidance:** KCL reaches 1.0 constraint-safety, 1.0 obstacle-safety and 1.0 goal-reaching in both PyBullet simulation and on a real TurtleBot, with clearance errors of 0.011 m (sim) and 0.021 m (hardware) and constraint-learning runtimes of 2.3 s and 4.1 s. In simulation all baselines reach the goal, but the paper reports K-VIL, ReKep, and MBIRL at 18.4%, 0%, and 0% learned-constraint satisfaction, with ReKep and MBIRL at 60.8% and 7.0% obstacle-safe.
- **KUKA arm manipulation with orientation constraints:** On a 7-DOF KUKA task that transports a cup past an obstacle while holding a 30° tilt bound, KCL achieves 1.0 on constraint safety, obstacle safety, and goal reaching in simulation and on hardware, with clearance errors of 0.03 m and 0.045 m. Baselines reach the goal but satisfy the inferred constraint only 0.971 (K-VIL), 0.977 (ReKep), and 0.021 (MBIRL) of the time in simulation, with clearance errors of 0.635 m, 0.649 m, and 0.003 m respectively.
- **Deformable rope obstacle avoidance:** In simulation KCL reaches constraint-safety 0.95, obstacle-safety 0.92, and goal-reaching 1.0; MBIRL never reaches the goal (0.0) and satisfies the ground-truth obstacle check 0.0 of the time, and ReKep satisfies the inferred constraint 0.24 of the time. On hardware KCL reaches 1.0 on all three metrics with a clearance error of 0.029 m. K-VIL is not reported for rope because the authors state it does not support deformable-object constraint parameterizations.
- **Multi-stage tasks:** KCL learns stage-wise constraints together with the task segmentation — rope knot tying in simulation (70 demonstration points, 2.3 s constraint-learning runtime, one-step dynamics loss 0.0047), cup picking and pouring on hardware (clearance error 0.0201 m), and hammer placing on hardware (clearance error 0.0042 m), with 1.0 constraint safety, obstacle safety, and goal reaching on the hardware tasks.
- **Robustness to a misspecified cost:** When the fixed keypoint-displacement cost is replaced by an unknown mixture of squared keypoint displacement (J₁), goal error (J₂), and path length (J₃), solving the inverse problem recovers α₁ = 1, α₂ = 0.063, α₃ = 0, with a constraint error of 0.012 — identifying the displacement cost as dominant without assuming it.
- **Small hardware evaluation batches:** The hardware validations use 5 trials (Dubins, KUKA, cup pouring, hammer placing) and 6 trials (rope), so hardware statistics come from small samples, while simulation evaluations use 1000 trials for Dubins and KUKA and 100 for rope.
- **Note on scope of this summary:** The supplied paper text is truncated partway through Section V-B, so the multi-stage experiment discussion (Section V-C) and the conclusion are reflected here only through the numerical results in Table I; the paper points to its Appendix C for additional results, including a comparison with a prior CIOC method and learning non-convex constraints.

## Methodology in Plain English

The pipeline has three stages.

**1. Turn video into a small geometric state.** For each RGB-D frame, the system segments objects to get masks and places a handful of keypoints inside each mask by clustering dense visual features and picking the pixel closest to each cluster center. Those keypoints are tracked frame to frame, and depth plus camera calibration lift them into 3D world coordinates. The state at each time is the concatenation of keypoint positions and mask centroids — a few dozen numbers rather than an image.

**2. Learn what the robot can do and what it must avoid.** A neural network learns the one-step state transition, split into a passive drift term and a control-driven term modulated by a learned gate, trained with an L1 one-step prediction loss on the demonstration trajectories. Separately, the authors assume each demonstration is a near-optimal solution to a control problem whose cost penalizes keypoint displacement and whose constraints include unknown distance and orientation relations. Asking that the first-order optimality (KKT) conditions hold for every demonstration turns constraint learning into an inverse problem: find the margins ρ and thresholds σ, along with Lagrange multipliers, that make the demonstrations stationary. Because tracked keypoints and learned dynamics are imperfect, the dynamics equality is relaxed by a slack bounded by ε_dyn, and the solver minimizes the L1 norm of the stationarity residual plus a penalty on that slack, with complementarity enforced exactly through binary variables.

**3. Plan, then pad for model error.** A trajectory is optimized with IPOPT to move keypoints toward the goal while keeping the learned constraints as hard inequalities. Because the learned dynamics are not exact, one-step errors would accumulate; the paper linearizes the dynamics around the nominal plan, treats prediction residuals from held-out data as bounded disturbances, and uses system-level synthesis to compute worst-case tube radii for each keypoint–centroid distance. The planned clearance is then inflated by that radius, so the executed trajectory should still satisfy the learned constraints under model error. Theorem 1 supplies the complementary bound on how perception and Jacobian errors shift the recovered constraint parameters themselves.

## Why This Matters

**Research impact.** The work connects two literatures that have been hard to combine: geometric keypoint methods for manipulation and constrained inverse optimal control. It removes three standard CIOC requirements — labeled state–action demonstrations, analytical dynamics, and manual state design — and it does so without a VLM at test time and without manual keypoint annotation, both of which the authors position as sources of hallucination and manual effort in prior work. The sensitivity theorem is also notable: rather than only reporting empirical robustness, it gives explicit dependence of constraint error on keypoint error, centroid error, minimum keypoint separation, and Jacobian error.

**Real-world applications.**

- Household and service manipulation, where a robot learns pouring, placing, and insertion constraints from a person's phone video.
- Deformable object handling in food processing, textile handling, or cable routing, where no accurate analytical state exists.
- Mobile robot navigation in cluttered spaces with learned clearance margins from teleoperation or human

## Authors’ abstract

We present Keypoint Constraint Learning (KCL), a framework for learning task-relevant motion constraints from visual demonstrations and for planning safely with the extracted constraints. To make constraint learning tractable from RGB-D observations, we represent demonstrations using sparse 3D object-centric keypoints and semantic mask centroids extracted through segmentation, visual feature clustering, and point tracking. In this reduced geometric space, we learn keypoint…

[The full abstract on arXiv](https://arxiv.org/abs/2610.19295)

[Read the original paper](https://arxiv.org/abs/2610.19295)

## Related papers

- [Learning Unknown Constraints without Unsafe Data via Optimality and Counterfactual Regularization](https://robotics.world/paper/learning-unknown-constraints-without-unsafe-data-via-optimality-and-2610.09350) 2026-10-07 · cs.RO · Also by Glen Chou, Zhouyu Zhang
- [Planning to Learn: Real-Time Robust Adaptive Control on the GPU with Guaranteed Future Learning](https://robotics.world/paper/planning-to-learn-real-time-robust-adaptive-control-on-the-gpu-with-2610.20925) 2026-10-14 · cs.RO · Also by Glen Chou
- [DemoStream: Batched Task-and-Motion-Plan Optimization for Automated Learning from Demonstration](https://robotics.world/paper/demostream-batched-task-and-motion-plan-optimization-for-automated-2610.22020) 2026-10-15 · cs.RO · Key terms of the title in common
- [Learning Task and Motion Plans from Real Demonstrations with Hybrid Flow Matching](https://robotics.world/paper/learning-task-and-motion-plans-from-real-demonstrations-with-hybrid-2610.04771) 2026-10-03 · cs.RO · Key terms of the title in common
- [Contact-Adaptive Robotic Ultrasound Probe Control for Tissue Exploration and Continuous Task-Relevant Visualization Using Robot-Free Image-Motion Demonstration](https://robotics.world/paper/contact-adaptive-robotic-ultrasound-probe-control-for-tissue-2609.37456) 2026-09-27 · cs.RO · Key terms of the title in common

---

Canonical: https://robotics.world/paper/learning-keypoint-constraints-from-visual-demonstrations-for-safe-2610.19295
