Cooperative Pursuit & Containment

Optimal control of pursuit agents corralling targets to the origin under repulsive particle dynamics.

Intuition

Goal: compute trajectories for a small team of pursuit agents that drive a swarm of evading targets to a goal region (the origin), where the targets follow nonlinear repulsive dynamics and cannot be controlled directly — only nudged through the pursuers' positions.

Consider a group of autonomous pursuit agents (shepherds) tasked with driving a swarm of evading targets (sheep) toward a goal region. Targets don't follow commands — they simply flee from nearby pursuers via short-range repulsive forces.

The challenge is cooperative: pursuers must coordinate their positions so that the net repulsive field experienced by the swarm points toward the origin. Poor coordination scatters the targets; good coordination funnels them inward.

We solve this as an optimal control problem using iterative LQR (iLQR), linearizing the nonlinear repulsive dynamics at each step and computing locally optimal pursuit trajectories that successfully contain and guide the swarm.

Pursuer Target
p x F ∝ 1/r² r

Mathematics

Targets are repelled from pursuers by an inverse-square force, giving nonlinear dynamics $x_{t+1} = F(x_t, u_t)$ with

$$F_i = \sum_{j} \frac{x_i - p_j}{\|x_i - p_j\|^3}.$$

At each step we linearize $F$ around the nominal trajectory $(\bar{x}_t, \bar{u}_t)$, taking Jacobians $A_t = \partial F/\partial x$ and $B_t = \partial F/\partial u$, and solve a quadratic LQR problem on the resulting local linear system. The optimal cost-to-go $V_t(x) = x^\top P_t x$ is found by sweeping the discrete-time Riccati equation backward:

$$P_t = Q + A_t^\top P_{t+1} A_t - A_t^\top P_{t+1} B_t \bigl(R + B_t^\top P_{t+1} B_t\bigr)^{-1} B_t^\top P_{t+1} A_t.$$

The feedback law $u_t^\star = -K_t x_t$ is read off from $P_{t+1}$. Iterating—re-linearize, re-solve, roll forward—converges to a locally optimal trajectory that corrals the targets to the origin.

Results

Two pursuit agents corral two targets to the origin. The iLQR controller computes efficient trajectories that coordinate the pursuers without scattering the targets.

Why It Matters

Multi-robot coordination
Swarm control
Nonlinear optimal control
Crowd management
Wildlife herding
Autonomous vehicles