# Distributed Shaping of Robot Swarms Through Spatial Moments of Arbitrary Order

Jin Chen, Hector Garcia de Marina · arXiv · 2026-11-14

- **Problem** Swarm tasks often specify how the group is spread in space rather than where each agent must stand, but moment-based designs have struggled to add higher-order shape without disturbing lower-order moments or depending on global positions.
- **Method** Projects each higher-order moment-error gradient onto the complement of lower-degree polynomials sampled at the agents, applies the corrections in a lower-triangular hierarchy, and offers a joint regularized Gauss–Newton alternative, both with a distributed estimator that uses relative positions and neighbor communication.

## Why describe a swarm by its distribution

Many swarm tasks instead care about how the group is spread out, for example stretching more along one direction or taking a recognisable outline, regardless of which agent occupies which spot.

Distribution-level approaches differ in what they regulate: density feedback, PDE-constrained optimization and moment control each describe the target in a different way. Moments are attractive because they are invariant to agent labelling and can be estimated by neighbor communication without rebuilding a full density. Second-order descriptors fix only the centroid, principal directions and spreads, so a Gaussian-like cloud and the airplane target can share the same covariance.

Higher-order image-moment control transfers Legendre and pseudo-Zernike moments to a swarm, but its bases are orthogonal over a continuous image domain rather than over the agent positions.

## Defining the target through whitened moments

The order-m central moment tensor is the empirical average over agents of m-fold products of the centered positions \\(z\_i = p\_i - p\_c\\), so the covariance \\(M\_2\\) is the order-two case. For a planar configuration, \\(M\_3\\) has four independent entries, and the other entries follow from symmetry. A desired formation is then a set of configurations that one common orthogonal matrix \\(Q\\) can align with a reference through every order from two to \\(K\\), which is the moment-similarity class \\(F\_K\\).

The formation error \\(e\_K(p)\\) is the minimum over \\(Q\\in O(d)\\) of the root sum of squared Frobenius differences between the aligned moments and the desired ones, and it vanishes exactly on \\(F\_K\\). Because the minimum is over a compact group, the error is well defined, so the control objective can be stated as this error tending to zero.

The whitened coordinates \\(w\_i = \\Lambda^{-1/2}V^\\top z\_i\\) divide each principal-axis displacement by its standard deviation, so that \\(E\_N\[w\]=0\\) and \\(E\_N\[ww^\\top\]=I\_d\\). The normalised tensors \\(S\_m = E\_N\[w^{\\otimes m}\]\\) carry the shape beyond the covariance, and the error \\(E\_m = S\_m - S^\*\_m\\) compares them with the reference tensors for \\(3\\le m\\le K\\).

Because the whitened covariance is the identity, the controllers can adjust higher-order shape without changing the axis spreads.

## Setting the spreads first

The dispersion controller \\(u^{(2)}\_i = -V\\,\\mathrm{diag}(\\lambda-\\lambda^\*)V^\\top z\_i\\) pushes each principal variance toward its target without moving the centroid or the principal directions. The optional centroid controller \\(u^{(1)}\_i = -k\_c(p\_c-p^\*\_c)\\) is added only when an absolute centroid is prescribed; otherwise it is zero.

Under this controller each whitened coordinate changes only through a rescaling that cancels the change of its standard deviation, so the normalised point cloud stays fixed. The shape can therefore be reshaped separately, and the higher-order corrections must act on the whitened cloud while keeping its zero mean and identity covariance.

## Projected corrections for each order

That candidate also moves the centroid, the covariance and the lower moments, so it has to be projected before use.

The proof differentiates each raw moment with the product rule, so each term reduces to an inner average of the velocity with a monomial of degree at most \\(r-1\\), and these averages vanish by the orthogonality assumption.

For \\(m\\ge 3\\) the residual projector \\(R\_{m-2} = I\_N - Q\_{m-2}(Q\_{m-2}^\\top Q\_{m-2})^{-1}Q\_{m-2}^\\top\\) removes from each coordinate the part lying in the sampled polynomial space of degree at most \\(m-2\\). With \\(A\_m D = R\_{m-2}\\{D(w\_i^{\\otimes(m-1)})\\}\\) and \\(H\_m = A\_m^\*A\_m\\), the order-\\(m\\) correction is \\(v^{(m)} = -k\_m A\_m E\_m\\), and the physical velocity is \\(u^{(m)}\_i = V\\Lambda^{1/2} v^{(m)}(w\_i)\\).

The total hierarchical input is \\(u\_i = u^{(1)}\_i + u^{(2)}\_i + u^{(3:K)}\_i\\), where \\(u^{(3:K)}\_i\\) sums the corrections for orders 3 through K. Each correction is the velocity field closest to the negative-gradient candidate among fields empirically orthogonal to the lower polynomial space, so it is steepest descent within that subspace.

## A worked third-order correction

For \\(m=3\\), the constant and the coordinate functions form an empirically orthonormal basis, so the projection has a closed form. In one dimension this reduces to \\(v^{(3)}(w) = -k\_3E\_3(w^2-1-S\_3w)\\), so a skewness below its target pushes agents far from the centroid outward on the side that needs it. This raises the skewness while the mean and variance stay fixed.

## Why lower orders stay fixed

Theorem 2 states that a correction of order \\(m\\) does not change any moment of lower order, so the centroid and covariance follow only the centroid and dispersion controllers. A correction of order \\(r\\) can still change moments of higher order \\(m\>r\\), through a coupling operator \\(B\_{mr}\\) that is linear in \\(E\_r\\).

Stacking the error equations gives a block lower-triangular system in which the derivative of \\(E\_m\\) depends on \\(E\_m\\) itself through \\(-mk\_mH\_m\\) and on errors of lower order through the \\(B\_{mr}\\) terms. Once \\(E\_3,\\dots,E\_{m-1}\\) vanish, the order-\\(m\\) error obeys \\(\\dot E\_m=-mk\_mH\_mE\_m\\), and its energy decays at the rate \\(-mk\_m\\\|A\_mE\_m\\\|\_N^2\\).

The coupling operators can involve moments above order \\(K\\), so the errors \\(E\_3,\\dots,E\_K\\) alone do not always determine their own derivatives.

## How many agents full regularity needs

Full order-\\(m\\) regularity means \\(H\_m\\succ0\\), equivalently that \\(A\_m\\) is injective, so no nonzero order-\\(m\\) error yields a zero corrective field. Proposition 3 gives a necessary condition \\(N\\ge D\_{m-2}+\\lceil h\_m/d\\rceil\\), where \\(h\_m=\\binom{d+m-1}{m}\\) is the dimension of the symmetric tensor space, and a sufficient condition on the rank of \\(Q\_{K-1}\\).

The sufficient condition can be conservative, since for \\(d=2\\) and \\(K=3\\) it asks for six agents while five suffice.

The paper states that this pentagon attains the agent bound in the necessary condition.

## Local convergence of the hierarchy

Theorem 4 fixes a reference \\(\\bar w\\in Z\\) at which each \\(Q\_{m-2}\\) has full column rank and each \\(H\_m\\) is positive definite, and it allows any positive gains \\(k\_m\\). Under those conditions there is a neighborhood \\(U\\) of \\(\\bar w\\) in which the root sum of squared higher-order errors decays exponentially, with constants \\(c\\) and \\(\\alpha\\), and trajectories converge to a point in \\(Z\\).

This gives \\(\\dot V\\le -2\\alpha V\\) while the trajectory stays in the neighborhood, and a bound on the path length keeps it there.

Remark 6 notes that distinct point agents stay at distinct positions in a regular neighborhood, but the argument gives no uniform positive separation distance.

## The joint alternative

The joint controller takes normalised products of probabilists' Hermite polynomials as features, with \\(\\phi\_\\alpha(w)\\) defined over multi-indices with \\(3\\le\|\\alpha\|\\le K\\). Its moment-error vector is \\(e = h - h^\*\\), where \\(h\\) and \\(h^\*\\) are the empirical averages of the features at the current and reference whitened positions. Because the lower standardized moments are fixed, \\(e=0\\) is equivalent to matching the moments through order \\(K\\).

The projected feature gradients \\(B\_\\alpha\\) and their Gram matrix \\(G\_{\\alpha\\beta}=E\_N\[B\_\\alpha\\cdot B\_\\beta\]\\) are positive semidefinite, since the quadratic form is a mean squared norm. The regularized feedback \\(v\_i=-\\sum\_\\alpha B\_{i\\alpha}\[(G+\\mu I)^{-1}e\]\_\\alpha\\) yields \\(\\dot e=-G(G+\\mu I)^{-1}e\\), so the error norm does not increase.

Theorem 8 gives \\(\\\|e(t)\\\|\_2\\le e^{-\\sigma t}\\\|e(0)\\\|\_2\\) with \\(\\sigma=g/(g+\\mu)\\), where \\(G\\succeq gI\\) holds in the neighborhood. Full column rank of \\(Q\_{K-1}(w^\*)\\) is sufficient for \\(G(w^\*)\\succ0\\), so the joint law needs no separate regularity check beyond that rank condition.

## Running the controllers with neighbor communication

Each agent estimates its centered position and the required moments from relative measurements and neighbor messages, using the graph Laplacian of a fixed connected undirected graph. The highest estimated order is \\(R=\\max\\{K,2K-3\\}\\) for the hierarchy and \\(R=2K-2\\) for the regularized joint law. From the estimates an agent forms \\(\\hat C\_i\\), \\(\\hat T\_i\\) and \\(\\hat w\_i\\), then evaluates the same control law in physical coordinates.

The distributed law perturbs the exact lower-moment identities while local estimates disagree, so the closed loop needs a separate slow–fast analysis.

Assumption 1 requires a fixed, undirected, connected graph, initialization that makes the estimation errors zero mean, distinct positive reference eigenvalues and a smooth principal-frame convention. The proof uses a composite energy of the slow dispersion and moment errors plus a fast estimation energy, and bounds the trajectory length to keep the configuration in its neighborhood.

Remark 11 notes that the estimation lag grows with the controller's moment orders and the agent speed, so high orders on sparse graphs need faster communication. Corollary 12 extends the same argument to the joint realization with a possibly different constant and neighborhood.

## Airplane simulation

The text gives the setup and the plotted axes, but not final error values, so the comparison rests on the plotted curves.

## Limitations

The convergence results are local: the hierarchy needs an initial configuration in a neighborhood of a regular reference. The distributed result needs sufficiently fast estimation relative to agent motion, and zero initialization alone need not give admissible covariance estimates. The agent bound is necessary, while the sufficient condition can be conservative.

An absolute centroid objective needs absolute-position or centroid-reference information, since relative positions alone determine only the centered configuration. Communication-saving schemes such as event-triggered dynamic average consensus are left to robot implementations. The numerical study is a single airplane scenario with one graph and one set of gains.

## Paper info

- **Authors**: Jin Chen, Hector Garcia de Marina
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-14
- **Added**: 2026-11-17
- **Updated**: 2026-11-14
- **Version**: v1
- **arXiv**: 2611.19272
- **Category**: eess.SY · cs.RO
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.19272v1) · [PDF ↗](https://arxiv.org/pdf/2611.19272v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

This paper shapes a swarm into a target pattern, such as a figure taken from an image, by controlling its spatial moments. The image is sampled into a reference configuration whose centroid and covariance set the position and principal spreads of the formation, while its higher-order moments, expressed in covariance-normalized (whitened) coordinates, encode the remaining shape. In contrast with geometric formation control, which prescribes distances, bearings, or relative positions between specific agents, this specification concerns the swarm as a whole and assigns no agent to a particular place. The key mechanism is orthogonalization in the swarm's own empirical inner product: projecting negative-gradient velocities onto the complement of low-degree polynomials sampled at the agents makes every higher-order correction preserve all lower-order moments exactly. The resulting hierarchical controller has lower triangular error dynamics and converges locally exponentially for any positive gains, so orders can be added without undoing those already achieved. A joint alternative regulates the higher moments together through a regularized Gauss--Newton step while preserving the centroid and covariance dynamics. We give bounds on the number of agents and sufficient conditions for regularity. Both controllers admit a distributed implementation that uses only relative positions and neighbor communication and retains local exponential convergence when estimation is sufficiently fast. In a distributed simulation on a sparse graph, 350 agents form an airplane from an unstructured swarm through moments up to order ten; the hierarchy reaches the full specification, while the joint law approaches it with smaller velocities.

## Quote from the paper

Jin Chen, Hector Garcia de Marina (2026). Distributed Shaping of Robot Swarms Through Spatial Moments of Arbitrary Order. arXiv:2611.19272v1. https://arxiv.org/abs/2611.19272v1

**BibTeX**

```
@misc{chen2026distributed,
  title = {{Distributed Shaping of Robot Swarms Through Spatial Moments of Arbitrary Order}},
  author = {Jin Chen and Hector Garcia de Marina},
  year = {2026},
  eprint = {2611.19272},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.19272v1}
}
```

## Other paper commentary

- [ResWAM: Learning What Changes, Not What Stays, for World-Action Models](https://refivu.com/en/papers/8ff204e6-02d0-446a-b10f-79536a9345b6-reswam-learning-what-changes-not-what-stays-for.md)
- [PROOF: Perceptive Robustness via Out-of-Distribution Fallback for Legged Locomotion](https://refivu.com/en/papers/279ca1a1-82a3-47dc-b2cc-f17e67e707ed-proof-perceptive-robustness-via-out-of-distribution-fallback.md)
- [TouchTwin: Scaling Human Touch Data via Real-to-Sim-to-Real](https://refivu.com/en/papers/462b68fa-213d-42d2-afc6-70494a111d9b-touchtwin-scaling-human-touch-data-via-real-to.md)
- [FAST-LIO2: Fast Direct LiDAR-inertial Odometry](https://refivu.com/en/papers/401ff61a-2475-494b-b01d-b01a805546db-fast-lio2-fast-direct-lidar-inertial-odometry.md)
- [Learning Dexterous In-Hand Manipulation](https://refivu.com/en/papers/8f01a51e-a6e2-4461-a855-c35b36cbc49e-learning-dexterous-in-hand-manipulation.md)
- [Learning Hand-Eye Coordination for Robotic Grasping with Deep Learning and Large-Scale Data Collection](https://refivu.com/en/papers/7027eeb7-fc1d-48f5-a7af-9efbaa9ad813-learning-hand-eye-coordination-for-robotic-grasping-with.md)
- [OmitEHR: Scalable Omission Detection in LLM-Generated Clinical Summaries](https://refivu.com/en/papers/0f462e1f-4873-4a64-a64d-577f1ec2ce80-omitehr-scalable-omission-detection-in-llm-generated.md)
- [Does a completed simulation run mean a usable urban wind result for AI agents?](https://refivu.com/en/papers/74b7f1fe-00ec-4d7c-9d3c-c0bed37b7054-does-a-completed-simulation-run-mean-a-usable.md)
- [Empowering Masked Diffusion Models to Self-Correct with Leave-One-Out Transformers](https://refivu.com/en/papers/aa23c75a-1959-445a-a3e9-da71095ed5a1-empowering-masked-diffusion-models-to-self-correct-with.md)
- [Guiding AI Agents to Generate Conjectures by Encoding How Theorems Build on One Another](https://refivu.com/en/papers/62af4783-da20-4330-8ead-89401a9e5c42-guiding-ai-agents-to-generate-conjectures-by-encoding.md)
- [Ultra-CAN: A Lightweight Blind ISAC Receiver for Chaos-Based Telemetry and Local-Seed Ranging in the Internet of Drones](https://refivu.com/en/papers/6a8f4d17-a3c9-488e-9bae-908b02d428f7-ultra-can-a-lightweight-blind-isac-receiver-for.md)
- [Agent Authenticator: Passkey-Grade, Hardware-Bound Authentication for AI Agents](https://refivu.com/en/papers/c6881b60-4466-4f78-874b-a41bdd696c71-agent-authenticator-passkey-grade-hardware-bound.md)

## Terms in this paper

- [Gram matrix](https://refivu.com/en/terms/0c7320647dff-gram-matrix)
- [skewness](https://refivu.com/en/terms/1cdbd12c466b-skewness)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/9fdfd5ad-397c-4dcf-aebb-4762dee0b52e-distributed-shaping-of-robot-swarms-through-spatial-moments)
