Manuscript Offprint
arXiv:2610.35582Distributed Predictive Flocking for a Swarm of Miniature Vibration-Driven Robots in a Confined Arena
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Highlights
• Distributed leader-free predictive flocking for a dense swarm of miniature robots.
• Six safety formulations compared on a single common controller footing.
• Look-ahead safety constraint gives widest margins and fewest collisions.
• Single generalized controller deployed to handle different tasks successfully.
• Swarm stays coordinated up to the geometric packing limit in each task.
Distributed Predictive Flocking for a Swarm of Miniature Vibration-Driven Robots in a Confined Arena
Prajol Shrestha, Siddhant Mohapatra, Filip Novkoski, Julian Oelhaf, Nicolas Vandewalle, Ana-Sunčana Smith and Andreas Maier
Pattern Recognition Lab, Department of Computer Science, Friedrich-Alexander-Universität Erlangen-Nürnberg, 91058, Erlangen, Germany
PULS, Institute for Theoretical Physics, Friedrich-Alexander-Universität Erlangen-Nürnberg, 91058, Erlangen, Germany
GRASP, Institute of Physics B5a, University of Liège, B4000, Liège, Belgium
Group for Computational Life Sciences, Division of Physical Chemistry, Ruder Bošković Institute, 10000, Zagreb, Croatia
ARTICLE INFO
Keywords:
Distributed model predictive control
Multi-robot systems
Control barrier functions
Collision avoidance
Collective behavior
ABSTRACT
Coordinating many miniature robots in a confined arena, with no leader, central planner, or global map, is a core challenge for swarm robotics. As the swarm grows denser, collision avoidance becomes the limiting factor, and the number of safely coexisting robots depends on the formulation of the inter-robot safety constraint. We present a distributed predictive flocking controller in which each robot solves its own nonlinear model predictive control (NMPC) problem, optimizing swarm cohesion and alignment costs, inter-robot and obstacle safety, and a task objective, while exchanging only predicted trajectories with local neighbors. Within this generalized controller architecture, solved in real time, we compare six barrier and control-barrier-function (CBF) safety formulations on a digital twin of an open-source vibration-driven bristlebot in a 0.64 m² arena. A look-ahead discrete-time CBF performs best overall, with the fewest collisions and the widest inter-robot margins across nearly every swarm size tested. We deploy it on phototaxis, phototactic orbiting, and cohesion without a stimulus tasks, using swarm sizes starting from ten robots and up to the geometric packing limit. The swarm holds well: collisions stay low in small swarms, rising steeply as the packing limit approaches, while coordination and cohesion degrade gently rather than collapsing. The swarm is found not to trade safety for order, keeping both across the confined arena, with local alignment high at every swarm size.
1. Introduction
Autonomous multi-robot systems are a promising approach for tasks in cluttered, inaccessible, or hazardous spaces, from confined-structure inspection to search in collapsed buildings and medical micro-robotics [1]. In these settings, many miniature robots must coordinate in proximity within a tight, bounded arena. As in natural swarms, such as flocking of starlings, schooling of fish, the crowded colonies of ants and honey bees, and even the collective migration of cells, robust group behavior emerges from purely local interactions among simple agents [2, 3, 4], with no central control [1]. Miniaturization, however, tightly bounds onboard compute, memory, and power [5], demanding control that is theoretically principled yet computationally light. Moreover, when the arena is fixed, a growing number of robots increases the density of the swarm and hinders smooth motion. When it is also cluttered with obstacles, coordination is even harder. In this scenario, collision avoidance becomes the central challenge.
The standard way to coordinate such a swarm from purely local interactions is Reynolds’ boid model [6, 7], which reduces collective motion to three local rules (cohesion, alignment, and separation) that produce coherent group motion without global information [8]. Early control laws formalized these as artificial potential fields over a communication graph [9, 10], and reactive velocity-matching rules scale to tens of drones [11]. Such reactive methods, however, offer no predictive horizon, no formal safety guarantee under nonlinear dynamics, and no systematic handling of kinodynamic limits. These shortcomings are especially severe in confined, high-density settings, where many underactuated robots have little room to recover from unsafe motions.
This work was supported by the Pattern Recognition Lab, Friedrich-Alexander-Universität Erlangen-Nürnberg.
Corresponding author
prajol.shrestha@fau.de (P. Shrestha); andreas.maier@fau.de (A. Maier)
ORCID(s): 0009-0005-9585-3800 (P. Shrestha)
Shrestha et al.: Preprint submitted to Elsevier
Page 1 of 26
Model predictive control (MPC) [12] addresses these limitations. For the nonlinear dynamics of mobile robots, this takes the form of nonlinear MPC (NMPC). It solves a finite-horizon optimal control problem (OCP) online, which provides closed-loop feedback, constraint satisfaction, and explicit multi-objective trade-offs. Distributed MPC (DMPC) extends this to a swarm by splitting the global problem into per-agent OCPs coupled through shared constraints [13, 14, 15, 16]. Solvers such as the Sequential Quadratic Programming real-time iteration (SQP-RTI) [17] solve each per-agent OCP in real time. Similarly, optimization-based swarm planners achieve strong real-world navigation [18, 19, 20, 21]. These methods are mainly developed for point-to-point navigation [14, 22], with collision avoidance typically encoded as geometric constraints such as separating hyperplanes or safe corridors.
The closest works embed Reynolds behaviors in NMPC. They have been demonstrated on up to 16 quadrotors [23, 24], leader-follower teams [25, 26, 27], and fixed-wing unmanned aerial vehicles (UAVs) [28]. Most share one regime. They assume sparse flight in large 3D airspace, with the swarm migrating toward a shared goal. Even when several obstacles are present, they remain sparse relative to the available space, keeping the environment effectively low-density. Few address the opposite regime that we target, where many underactuated robots coordinate at high density in a fixed, confined, and cluttered arena under a task objective such as following a light gradient. Here, the inter-robot safety formulation, not free-space planning, governs how many robots can coexist. Each of these works, however, fixes a single safety formulation in advance, usually a distance constraint or a penalty. It remains open which formulation fits the most robots into a fixed arena with minimal collisions.
Safety formulations differ in how collision avoidance is encoded as a constraint in the OCP. Such a constraint is classically formulated using a barrier function whose safe set is kept forward invariant to certify safety [29], typically imposed as a hard [30] or soft [31] distance constraint. A Control Barrier Function (CBF) [29] relaxes this strict boundary condition by allowing to decrease at a rate bounded by a class- function, and its discrete-time form (Dt-CBF) [32] imposes this at each MPC stage. Zeng et al. [33] enforces it as a hard constraint, which is often infeasible. Feasibility is restored by softening the decay with slack variables [34, 35, 36], adding terminal barrier terms [37, 38], or anchoring a soft CBF with one hard step [39]. Beyond feasibility, when the constraint has relative degree greater than one, as for a distance constraint under unicycle dynamics, a higher-order CBF (HOCBF) [40, 41] chains the barrier conditions. Lu et al. [39] compare a distance-constraint MPC, a hard discrete-time CBF, a slacked CBF, and their combination on a common footing, but for a single robot. In the multi-robot setting, safety is enforced by reactive schemes [42, 43], by post-hoc CBF-QP (quadratic program) filters [44], or by a CBF inside a decentralized MPC with neighbors as predicted trajectories [45, 46, 47, 48]. A formulation's collision performance, however, likely changes with the swarm density. A comparison across densities is required to find the best one.
In this work, we investigate the maximum number of miniature robots a distributed predictive controller can flock in a fixed arena, and design a controller to push that limit. Each robot solves its own NMPC combining Reynolds cohesion, alignment, and separation (gated by neighbor presence) with inter-robot/obstacle safety and the task objective. It selects the K nearest neighbors within the communication radius and exchanges predicted trajectories synchronously as OCP parameters, giving a fully distributed, leader-free architecture with no central planner or global map. We evaluate it on a physics-informed digital twin [49] of the GRASPion [50], an open-source vibration-driven bristlebot studied as an active-matter model system. We characterize how densely the swarm packs a arena while sustaining two behaviors. These are phototaxis (ascending toward a moving Gaussian light gradient) and a phototactic orbital mode (orbiting the source along the intensity level-set). We compare six inter-robot safety formulations on a common footing (Section 3.3). A slacked barrier paired with a discrete-time CBF at a forward handle [51] sustains the highest density with the fewest collisions. The main contributions of this paper are as follows:
-
A distributed predictive control system for dense swarms of miniature vibration-driven robots. Each robot solves its own NMPC fusing flocking, safety, and the task objective, coupled to neighbors only through exchanged predicted trajectories.
-
Demonstration that a single controller generalizes across qualitatively different collective behaviors. The same architecture produces gradient-ascending phototaxis, stable phototactic orbital formation, and generic flocking with no modification to the safety or coordination layers, showing that task objectives and coordination structure are separable and that new tasks can be added without re-deriving safety guarantees.
-
A careful comparison of six inter-robot safety formulations within one identical controller, isolating the safety constraint as the only varying factor. The Look-ahead Slack Dt-CBF gives the best overall trade-off for the phototaxis deployment target.
Shrestha et al.: Preprint submitted to Elsevier
Page 2 of 26
- Characterization of the operating swarm density that the controller sustains in a fixed arena. The swarm stays cohesive with few collisions in small swarms; collisions rise steeply towards the geometric packing limit, as saturation sets in, while coordination and feasibility degrade gently rather than collapse.
The remainder of this paper is structured as follows. Section 2 presents the robot model, light field, control architecture overview, behavior generation, flocking rules, and the DMPC OCP. Section 3 reports the simulation results, including the safety-formulation study (Section 3.3), the analysis of collective behavior (Section 3.4), and the quantification of collision avoidance under different tasks (Section 3.5). Section 4 summarizes the work and provides an outlook for future studies.
2. Preliminaries and Problem Statement
In this work, we consider a swarm of robots operating in a bounded arena , with each robot labeled by . The state of robot is , where is the position and the heading. Inter-robot communication is modeled as a directed sensing graph , where denotes the set of robots and is the communication set of ordered pairs for which robot can observe robot . The neighbor set of robot is . We adopt a topological neighborhood with fixed cardinality , selecting the nearest robots within communication radius of robot . This choice keeps the neighbor count constant and avoids the cost discontinuities that arise under Voronoi or attraction-based topologies [52, 53, 54]. Each robot additionally accounts for up to nearby static circular obstacles within a sensing range , indexed by , with obstacle at center and radius . The environment also includes a single light source whose intensity field serves as the swarm stimulus.
The OCP is compiled once with a fixed parameter dimension. Neighbor and obstacle information therefore enters two fixed-size blocks of and slots, the neighbor block and the obstacle block. At each control step, robot receives a predicted trajectory from each neighbor , where and are the predicted position and velocity of neighbor at horizon stage . Throughout, a hat denotes a quantity the per-robot OCP treats as fixed data (the ego robot's current measured state and the neighbors' received predicted trajectories). The ego robot's own predicted states are decision variables. These trajectories fill the neighbor block, and the number of occupied slots changes from step to step. Each neighbor slot therefore carries a binary activation mask , where if slot is occupied at stage and otherwise. The obstacle block is filled the same way. Robot selects the nearest obstacles within obstacle sensing range and writes each center into a slot together with its own activation flag.
2.1. Robot Model
Each robot is modeled as a rigid ellipse with semi-major axis a and semi-minor axis b, matching the physical footprint of the GRASPion open-source bristlebot [50], as illustrated in Fig. 1. The simulated elliptical agent is modeled after this hardware platform, following the physics-informed digital twin of [49], so the simulation study is grounded in a physical robot footprint and can serve as a precursor to future physical experiments.
The dynamics of each robot are described by a three-state kinematic unicycle model with state , input , and continuous-time dynamics given by
where is the position, the heading angle, the linear velocity, and are the velocity components, and the angular velocity. The continuous-time dynamics (3) are integrated using an explicit Runge-Kutta 4 (ERK-4) integrator with three steps per control interval, yielding the discrete-time map .
2.2. Light Field Model
The arena contains a time-varying light field that each robot senses locally to compute its navigation reference. The field is modeled as a Gaussian intensity profile whose source either orbits the arena center or remains stationary.
Shrestha et al.: Preprint submitted to Elsevier
Page 3 of 26


Figure 1: (Left) Two elliptical robots with minimum safe distance and semi-axes (3 cm) and (1.5 cm). (Right) The physical GRASPion open-source bristlebot hardware.
Light Source The light source produces a Gaussian intensity field
where is an arbitrary position, is the peak intensity, is the position of the source at time , and represents the spatial spread of intensity.
Source Dynamics The light source supports two motion modes. In circular rotation mode, the source orbits the center of the arena at a fixed radius with angular speed , with the position of the source given by
where is the initial angle of the source in the orbit and is the speed of the source along the orbit. In stationary mode, the source remains fixed at the arena center.
Intensity Gradient The intensity gradient with respect to the robot position is computed analytically as
This analytic gradient is the local cue that the collective-behavior modes of Section 2.4 convert into each robot's look-ahead reference.
2.3. Control Architecture Overview
Every robot runs an identical decentralized controller, outlined in Fig. 2. At each control step, the robot senses the local light field, and a behavior module maps this reading to a look-ahead reference that encodes where the robot should head next. A per-robot optimal control problem (OCP) tracks that reference. Flocking rules keep the group cohesive and heading-aligned, while barrier and control-barrier-function constraints enforce inter-robot and obstacle safety. Robots publish their predicted trajectories over the sensing graph and re-solve synchronously from their neighbors' previous plans, coordinating the swarm without a central node. The rest of this section develops the remaining components in turn. These are the behavior module (Section 2.4), the flocking rules (Section 2.5), the six safety formulations (Sections 2.5.3–2.5.4), the reference-tracking and control-effort costs (Section 2.6), the assembled OCP (Section 2.7), and the decentralized execution loop (Section 2.8).
Shrestha et al.: Preprint submitted to Elsevier
Page 4 of 26

Figure 2: Per-robot control architecture for the DMPC swarm. Each robot runs three concurrent subsystems. The Perception block estimates the robot's state comprising position and , orientation , and velocity and . The Planning and Control block uses this state to compute a look-ahead reference based on the active swarm behavior (phototaxis or phototactic orbital) and then solves the local NMPC problem to produce control commands, which are passed through a Calibration layer before reaching the Actuator. The Communication block handles all inter-robot data exchange, where solid arrows denote state signals and dotted arrows denote predicted trajectory exchanges. Incoming broadcasts are filtered by a Neighbor Filter (within communication range and K-nearest selection) and stored in the robot's neighbors buffer before being used by the NMPC solver.
2.4. Collective Behavior Modes
Collective motion emerges when individual agents produce coordinated group-level movement through purely local interactions in the absence of centralized planning [6, 55]. In our controller, a behavior module translates local sensory observations into a look-ahead reference ( ) at each control step, which the OCP then tracks while maintaining flocking coherence and safety. We describe two such modes, phototaxis and phototactic orbital behavior.
At each control step, the light-field gradient is evaluated analytically from (4)–(6). The resulting reference heading depends on the selected collective behavior mode. Once the heading is obtained, the look-ahead reference position is computed as
where is the look-ahead distance, and the clipping function constrains the reference position to remain inside the arena. The reference velocity is set to a constant target value , and the reference angular velocity is fixed at zero.
2.4.1. Phototaxis Behavior Mode
Phototaxis drives each robot to ascend the intensity gradient of the light field without knowledge of the global source position. The reference heading is aligned with the steepest ascent direction:
Shrestha et al.: Preprint submitted to Elsevier
Page 5 of 26 where is a small gradient threshold. When the field is nearly flat ( ), the robot holds its current heading rather than turning randomly.
2.4.2. Phototactic Orbital Behavior Mode
In the phototactic orbital mode, each robot follows the tangent of the light intensity level set, effectively orbiting the source without knowledge of its global position. The reference heading is obtained by rotating the gradient direction from (8) by , with the orbital direction governed by the circulation parameter (where generates counter-clockwise motion, and generates clockwise motion):
2.4.3. Extensibility to Arbitrary Behaviors
Decoupling the reference generator from the OCP makes the architecture task-agnostic. Any behavior (directed migration, dispersal, transport, shape formation) can be integrated by mapping local observations to a look-ahead reference ( ), while the DMPC preserves safety and flocking coherence.
2.5. Reynolds Flocking Rules
The behavior modes set each robot’s individual objective, while the collective motion arises from the local steering rules proposed by Reynolds [6, 7]. Cohesion binds robots into a group, alignment coordinates their heading, separation keeps them from colliding, and obstacle avoidance steers them clear of static hazards. The controller encodes cohesion and alignment as quadratic cost terms in the per-robot OCP, while separation and obstacle avoidance are enforced through barrier and discrete-time CBF constraints [29, 32]. We focus on the separation and obstacle avoidance by comparing six different formulations, ranging from hard barriers to slacked variants (Sections 2.5.3 and 2.5.4).
2.5.1. Cohesion
The active-neighbor centroid at stage k is computed as a masked weighted average of predicted neighbor positions:
where the soft neighbor count
prevents division by zero when there are no neighbors in the vicinity. The cohesion penalty is
with weight , gated by the activation gate
When at least one neighbor slot is active, and the cost is enabled. In isolation, when and it vanishes. Separating (denominator safety) from (which enables the cohesion and alignment costs only when a neighbor is present) keeps the per-robot cost well posed for the SQP-RTI solve. Finally, cohesion uses the stage-matched predicted positions rather than current measured ones, pulling robot toward where its neighbors are predicted to be.
Shrestha et al.: Preprint submitted to Elsevier
Page 6 of 26
2.5.2. Alignment
The mean heading direction of active neighbors is estimated from their predicted velocity vectors:
The neighbor velocities are summed rather than normalized, so faster neighbors weigh more heavily. The offsets regularize atan2 near a zero velocity sum (fixing at only at exact cancellation, an edge case). The resulting then defines the alignment heading error, wrapped to :
and the alignment penalty is
with weight . As in the cohesion term, the shared gate disables both cohesion and alignment when robot i is isolated.
2.5.3. Inter-Robot Separation
The inter-robot separation constraint builds on a pairwise safety barrier and its Dt-CBF extension. For neighbor slot j at stage k, the barrier
is non-negative exactly when robot i and neighbor j are at least apart. Starting from this barrier, the same safety constraint can be encoded in several ways, each imposed hard or slacked. We consider six formulations that differ only in the safety constraint, and observe the corresponding change in swarm behavior. Section 3.3 then evaluates all six under identical conditions and retains the best-performing one. The last three share a common structure consisting of a slacked barrier anchor paired with a rate condition. They differ only in the rate condition, which is a one-step Dt-CBF on the body, the same condition on a forward handle, or a two-step higher-order chain.
(a) Hard BF The plain barrier imposed as a hard constraint,
is the most direct encoding of the rule. It forbids any predicted configuration closer than at every stage. It is purely reactive (it acts only once a neighbor is within range) and, as a hard constraint, allows no slack, so a robot surrounded by several neighbors at once can leave its OCP with no feasible input.
(b) Hard Dt-CBF The discrete-time CBF condition as a hard constraint,
compares the barrier with its one-step-ahead value . The latter is formed by a forward-Euler step of the ego position and a constant-velocity step of each neighbor,
The ego step is linear in , which keeps the quadratic-program subproblems well conditioned. It is a first-order approximation used only inside the barrier constraint, separate from the ERK-4 discretization of the dynamics (3). The condition does not forbid but limits how fast the barrier may shrink each step, to at most a fraction (a discrete class- rate). The robot therefore starts slowing while still safely separated rather than braking at the boundary, giving smoother, early avoidance. This is exactly the MPC-CBF formulation of [33]. Being a hard constraint, it carries the same infeasibility risk as Hard BF with dense congregations of robots.
Shrestha et al.: Preprint submitted to Elsevier
Page 7 of 26
(c) Slack BF The plain barrier mentioned in Hard BF, softened by its slack,
keeps the OCP solvable in the crowded configurations that make Hard BF infeasible. When no input can satisfy , the penalized slack opens just enough to admit a feasible, minimally-violating solution instead of failing.
(d) Slack Dt-CBF The slacked barrier anchor (23) and the discrete-time CBF condition softened by its own slack,
imposed together on the same neighbor, each with its own slack. The rate condition combines the before-contact activation of Hard Dt-CBF with the improved solvability of Slack BF. The anchor guards the footprint at every stage while the CBF constraint shapes the approach rate. This is the reference point for the next two formulations: they retain this anchored structure and change only where or how the rate condition is evaluated, so the ensuing description only mentions those two choices.
(e) Look-ahead (LA) Slack Dt-CBF This formulation is a modification of Slack Dt-CBF with its rate condition moved from the body onto a forward handle a fixed distance ( ) ahead of the robot, adapting the offset-point construction of Huang et al. [51] to discrete time,
with the slacked condition imposed on the handle. A body distance barrier has relative degree two under unicycle dynamics, so the turn rate does not appear in its one-step form and a robot can only slow down to keep clear. The handle moves with the heading, so enters the one-step barrier directly. The robot can, therefore, also steer around a neighbor, while the body anchor (23) still guards the true footprint.
(f) Slack Dt-HOCBF The slacked barrier anchor (23) together with a slacked higher-order (relative-degree-two) chain [41, 40] is built natively in discrete time from successive barrier values rather than from derivatives. With and , the barrier evaluates the one-step and two-step prediction under the held input ,
with decay rates . Expanding the chain gives the single constraint actually imposed,
where the two-step prediction advances the heading as and each neighbor by its constant velocity. This addresses the same relative-degree-two obstruction as (e) but analytically rather than geometrically: is absent from the one-step barrier, yet it enters through the rotated heading, with sensitivity .
Across the six formulations, a safety constraint is either imposed hard or softened by its own non-negative slack for a barrier constraint, for a Dt-CBF constraint), and the active slacks are penalized in the cost,
where collects the chosen formulation’s inter-robot slacks for neighbor , and , are the quadratic and linear weights. The set holds both slacks for the hybrid, look-ahead, and higher-order variants (d)–(f), a single slack for Slack BF, and none for the hard variants. Each slack is driven to zero whenever its constraint is satisfiable and absorbs only the unavoidable residual otherwise. Inactive neighbor slots are padded ( ) so their constraints and slacks vanish.
Shrestha et al.: Preprint submitted to Elsevier
Page 8 of 26
2.5.4. Obstacle Avoidance
The selected formulation (a)–(f) from Section 2.5.3 is applied unchanged to static obstacles, so no new safety constraints are introduced. Each obstacle is treated as a neighbor with a fixed prediction. Three substitutions turn each inter-robot safety constraint of the chosen formulation into its obstacle counterpart. The neighbor position becomes the obstacle center (held at zero velocity). The clearance becomes (a fixed radius exceeding the obstacle radius ). The class- gains take their obstacle values (defaulting to the inter-robot ones). The obstacle barrier, for instance, is
The obstacle slacks are penalized analogously,
with the chosen formulation's obstacle slacks for obstacle and , the quadratic and linear weights. At the terminal stage , the one-step prediction is undefined, and all formulations revert to a plain terminal barrier.
2.6. Look-Ahead Reference Point and Control Effort
The look-ahead reference point produced by the behavior module of Section 2.4, whatever the mode, enters the per-robot OCP through a quadratic tracking cost. The stage-k deviations of the state from this reference point are then defined as
The wrapping in (34) maps the heading deviation to , avoiding discontinuities at . The deviations form a quadratic reference-tracking cost:
with weights . A control-effort term regularizes the inputs for smoother, more energy-efficient trajectories:
where .
2.7. OCP Formulation
Each robot solves a finite-horizon OCP over N stages. The cost assembles the look-ahead, control-effort, cohesion, and alignment terms plus CBF slack penalties into a stage and a terminal cost. This cost is minimized subject to the dynamics, the state and input box constraints, and safety constraints that enforce separation and obstacle avoidance.
Stage Cost The stage cost at horizon stage is
where the look-ahead, control-effort, cohesion, alignment, inter-robot slack, and obstacle slack terms are given by (36), (37), (12), (17), (30), and (32), respectively. Separation and obstacle avoidance no longer appear as cost terms. They are enforced through the barrier and Dt-CBF constraints of Sections 2.5.3–2.5.4.
Shrestha et al.: Preprint submitted to Elsevier
Page 9 of 26
Terminal Cost The terminal cost at stage is
where the position, heading, inter-robot slack, and obstacle slack terms are given by (33), (34), (30), and (32), respectively.
Full OCP Every robot i solves the following optimization problem (with neighbor data treated as stage-wise parameters), which incorporates all the previously defined cost terms and constraints in a unified formulation:
Here, and are the inter-robot and obstacle safety constraints of the selected formulation (a)–(f) (Sections 2.5.3 and 2.5.4), evaluated on the neighbors’ predicted trajectories and the obstacle positions . The bounds and are the state and input box limits. The slack vectors and hold up to 2K and 2M entries for . The predictive Dt-CBF rows require the one-step-ahead prediction, while the higher-order rows require the two-step prediction, so they drop at the terminal stage . For the hard formulations (a) and (b), the slacks are fixed to 0.
2.8. Simulation Workflow
Each control step executes a synchronous parallel update [56] in which all robots compute their optimal control sequences simultaneously using only neighbor information from the previous timestep (Algorithm 1). This structure prevents any robot from exploiting another robot’s within-step update, matching the limited communication of a real distributed system. At the beginning of each control step, a KD-Tree [57] is constructed over the current robot positions . This spatial partitioning structure enables all -nearest-neighbor queries within communication range to be performed in total time compared to the naive pairwise distance search [58]. Each robot then samples the local light intensity and gradient to compute a look-ahead reference which encodes the desired position, heading, linear speed, and angular velocity according to the active swarm behavior mode. It also collects the nearby obstacle positions within range and the neighbors’ predicted trajectories buffered from the previous control step. Using these inputs, each robot solves a local OCP over horizon via a single SQP-RTI step, while updating the stage-wise parameter vector to incorporate the look-ahead reference, neighbor trajectories, and obstacle positions as time-varying coupling parameters in (40). After optimization, the robot applies the first control action and publishes its updated predicted trajectory for use by neighboring robots at time .
3. Simulation Results
We evaluate the proposed DMPC framework through a series of simulation studies. The studies characterize the operating density up to the geometric packing limit, compare the six inter-robot safety formulations under a common controller setup, demonstrate emergent collective behavior across the task modes, and assess real-time computational scalability with swarm size.
Shrestha et al.: Preprint submitted to Elsevier
Page 10 of 26
Algorithm 1 DMPC Control Step at time t
1: Advance light field: 2: Spatial Indexing: Construct KD-Tree from current positions 3: for robot in parallel do 4: Detect K nearest neighbors via KD-Tree query with range 5: Buffer from neighbors' previous trajectories 6: end for 7: for robot in parallel do 8: Sense light intensity and gradient 9: Compute look-ahead reference based on the active swarm behavior 10: Detect the M nearest obstacles within range and compute their center positions 11: Fetch trajectories from neighbor buffer 12: Warm-start: , 13: for do 14: Build and set parameter block : look-ahead reference + neighbor trajectory + obstacle positions 15: end for 16: Execute one SQP-RTI step to obtain 17: Extract first optimal control input and updated from solver 18: end for 19: Synchronize: All robots publish updated trajectories simultaneously 20: for robot do 21: Apply 22: end for
3.1. Simulation Setup
We implemented our DMPC framework symbolically in Python using CasADi [59] and exported the resulting OCP to acados [17], which generates and compiles highly optimized C code via its code-generation pipeline. The solver uses the acados SQP-RTI scheme, ERK-4 integration, and the interior-point QP solver HPIPm [60], and a Gauss-Newton Hessian approximation of the OCP. Simulations were performed on the compute nodes of a throughput cluster, each with two 16-core 2.90 GHz Intel Xeon Gold 6326 (Ice Lake) processors, i.e. 32 physical cores, and 250 GB of RAM. Every run was pinned to a single core, so the per-robot solve times reported in Section 3.6 are single-core numbers.
The physics environment was simulated using a custom 2D engine within a fixed workspace (horizon , control step , up to neighbors). The NMPC and Reynolds penalty weights were tuned via Bayesian optimization with Optuna [61] to maximize swarm coherence while prioritizing safety and solver stability. The lower speed bound (Table 3) keeps every robot moving instead of letting it stop. The environmental Gaussian light source rotated along a circular trajectory in the phototaxis experiment and remained stationary in the phototactic orbital experiment. All robots were initialized at uniform random positions in a central sub-region covering 90% of the arena with a minimum initial separation of and ran for 9000 control steps ( ), long enough for the swarm to reach and hold a steady state rather than being measured mid-transient.
Metrics and protocol All reported quantities are means over 10 random seeds with 95% confidence intervals. Steady-state quantities are averaged over the last 3000 of the 9000 steps (the final 300 s). A robot-robot (or robot-obstacle) contact is a distinct overlap of the elliptical footprints, evaluated at the MPC-commanded positions and counted once per overlap episode. All runs include a lightweight reactive collision-response layer (a per-robot heading bias plus a few positional-separation sweeps) matching the deployed system. A contact is detected as soon as the footprints overlap, before the layer reacts. The layer then pushes the overlapping pair apart and biases their headings away from each other, so overlaps stay shallow and brief. Solver feasibility is the fraction of per-robot solves returning a successful acados status. The six formulations share an identical stack, weights, horizon, arena, seed set, and safe distance . Only the inter-robot safety and obstacle-avoidance constraints differ. For the look-ahead formulation, the pair was selected by a grid screening followed by Bayesian optimization, and for the anchored Slack Dt-CBF, the decay rate was selected by a direct two-point comparison, each re-verified over the full ten-seed protocol. Formulations (d) and (e) therefore share , which is what makes the look-ahead ablation below a single-variable comparison. The remaining formulations run at the gains inherited from their source implementations rather than at individually optimized ones; a single shared gain would not be meaningful across formulations that differ in structure, and we report this asymmetry.
Shrestha et al.: Preprint submitted to Elsevier
Page 11 of 26 because it bounds how the cross-formulation ranking should be read. The complete set of cost weights, CBF gains, slack weights, and environment constants is listed in Appendix B, Table 3.
3.2. Capacity and Operating Density
We now characterize how densely the swarm can pack in the fixed arena. This section establishes the geometric capacity and selects the operating point used in the later analysis.
Geometric capacity The swarm size is limited by the safety buffer, not the physical footprint. The elliptical footprint is small, only of the arena at , against when the buffers are also considered. At , the buffers cap the swarm size at an upper limit of non-overlapping safety disks of radius (Table 1). This packing results in area coverage, just below the ideal hexagonal because of boundary and finite-size effects. The ceiling depends on the safety distance, ranging from at to at . Across these distances, the buffer occupancy at the limit stays near . We therefore use buffer occupancy as a density measure comparable across safety distances.
Operating point We select the operating point with a closed-loop DMPC sweep over and movement headroom . The sweep scores occupancy, collisions, feasibility, solve time, and neighbor-buffer utilization. Sweeping over cm over the four barrier and CBF formulations available at the time, it finds both viable, so we set , the tighter of the two. The working maximum then follows from the geometric headroom criterion with ( buffer occupancy), not from the sweep score. Beyond the safety buffers can no longer be packed without forced overlap, and the swarm stays feasible only through the slacked barrier.
Table 1
Swarm size, physical robot footprint, and safety buffer occupancy in a () arena. The physical footprint uses and the safety buffer area is (). The green row () marks the representative swarm size used for the behavior figures. The yellow row () marks the largest swarm size that leaves some headroom to move. The red row marks the geometric non-overlapping packing limit ().
| Swarm Size | Physical Robot Footprint | Safety Buffer | ||
|---|---|---|---|---|
| Total Area | Occupancy (%) | Total Area | Occupancy (%) | |
| 1 | 14.14 | 0.22 | 38.48 | 0.60 |
| 10 | 141.40 | 2.21 | 384.85 | 6.01 |
| 25 | 353.50 | 5.52 | 962.11 | 15.03 |
| 50 | 707.00 | 11.05 | 1924.23 | 30.07 |
| 75 | 1060.50 | 16.57 | 2886.34 | 45.10 |
| 80 | 1131.20 | 17.68 | 3078.76 | 48.11 |
| 100 | 1414.00 | 22.09 | 3848.45 | 60.13 |
| 120 | 1696.80 | 26.51 | 4618.14 | 72.16 |
| 137 | 1937.18 | 30.27 | 5272.38 | 82.38 |
3.3. Safety Formulation Comparison
The inter-robot and obstacle safety constraints can be formulated in several ways. To map this design space, we compare the six formulations (a)–(f) of Sections 2.5.3 and 2.5.4 for the phototaxis mode in the absence of obstacles. The slacked variants carry the feasibility-recovery idea of Zeng et al. [34] over to our distributed swarm. Under the identical setup of Section 3.1 (same stack, solver, and closed-loop simulator), the six formulations differ only in how they enforce inter-robot and obstacle safety, so the comparison isolates that single design choice. Each configuration is evaluated at over 10 seeds, with marked by the dashed vertical line in the figures. Fig. 3 reports the solver feasibility, the collisions, and the mean QP solve time versus swarm size , and Table 2 summarizes the low-density operating point alongside a high-density operating point .
Shrestha et al.: Preprint submitted to Elsevier
Page 12 of 26
(a)

(b)

(c)

Hard BF Hard Dt-CBF Slack BF Slack Dt-CBF LA Slack Dt-CBF Slack Dt-HOCBF
Figure 3: Safety-formulation comparison across the six variants (phototaxis, free space, 10-seed mean, 95% CI bands). (a) Solver feasibility, (b) inter-robot collisions (distinct contacts over 9000 steps, log scale), and (c) mean per-robot QP solve time, versus swarm size . The dashed vertical line marks the geometric packing limit .
Table 2 Safety-formulation comparison (phototaxis, free space, 10-seed mean ± 95% CI). Collisions are cumulative counts of distinct robot-robot contacts over 9000 steps, reported at a low density () and at a high-density operating point . Feasibility and solve time are at . Bold marks the best value in each column.
| Variant | Feas. (%) | Solve (ms) | Coll. | Coll. |
|---|---|---|---|---|
| Hard BF | ||||
| Hard Dt-CBF [33] | ||||
| Slack BF | ||||
| Slack Dt-CBF | ||||
| LA Slack Dt-CBF | ||||
| Slack Dt-HOCBF |
Feasibility Solver feasibility separates the hard and slacked formulations most sharply (Fig. 3a). The two hard formulations hold only about 90% to 92% feasibility at . When a solver is infeasible (roughly 8% to 10% of the per-robot OCPs), the robot falls back to a reactive potential-field controller (goal attraction with inter-robot, obstacle, and wall repulsion). This matches the recursive-infeasibility limitation that Zeng et al. [33] identify for the hard discrete-time CBF. Softening the barrier with slack variables removes the problem. All four slacked formulations (Slack BF, Slack Dt-CBF, LA Slack Dt-CBF, and Slack Dt-HOCBF) hold at least 99.4% feasibility across the entire density range, and 100% up to ; the minimum over all densities and all four is 99.47%, at the packing limit. The small remaining infeasibility comes from the hard arena-boundary constraint, not the safety constraint. At high density, robots pressed against the arena walls can briefly make it infeasible. Feasibility alone, however, does not separate these four. As the collision results show next, a formulation can be feasible everywhere yet still fail to keep robots apart.
Collisions The formulations diverge in collision counts, not feasibility (Fig. 3b), and they separate by structure rather than by barrier order. At the three formulations that pair a barrier anchor with a rate condition (d)–(f) average contacts, against for the three without an anchor (a)–(c), a factor of 2.4. The two groups do not overlap at any density in the sweep. Carrying an anchor alongside the rate condition therefore matters more than which rate condition is used.
Two further results follow within the anchored group. First, the look-ahead handle alone reduces contacts by a factor of 2.5 at low and moderate density, falling to 1.2 at the packing limit, where it takes them from to . Formulations (d) and (e) are identical apart from the handle, at the same decay rate , with disjoint confidence intervals at every density and no measurable solve-time cost. The reduction is therefore due to the handle, which gives the angular velocity direct authority over the constraint so a robot can steer around a neighbor rather than only brake. Second, the higher-order chain helps at moderate density and stops helping at the packing limit. The Slack Dt-HOCBF is second best in small swarms, but by it falls behind the LA Slack Dt-CBF, against . It does not fail by becoming infeasible, holding 100% feasibility across the whole range against 99.5%
Shrestha et al.: Preprint submitted to Elsevier
Page 13 of 26 for (d) and (e). What it gives up is margin, and not just at the packing limit. The chain lets its robots run closer than the look-ahead variant at every density (Fig. 4a), 5.02 against 5.31 cm at the packing limit. Its two-step condition allows the barrier to shrink further before the robot has to act. That costs nothing when the arena has unoccupied space. As the available area shrinks, a smaller gap leads to contact. On this task, the deployed LA Slack Dt-CBF is best or tied-best at every density except , where it is second behind the Slack Dt-HOCBF with disjoint confidence intervals. Elsewhere, the look-ahead advantage over the chain widens as the arena fills, from at to at .
Safety margins The formulations also differ in the safety margin they sustain (Fig. 4). These runs use the deployed closed loop with the reactive layer active (Section 3.1), and are measured on post-steering positions, so they never show interpenetration. Each value is a mean over robots and steps of the nearest-neighbor distance, not a per-step minimum. The margins separate along the same structural line as the collision counts. On the inter-robot axis, the three anchored formulations (d)–(f) hold 10.1–10.6 cm at and 5.0–5.3 cm at the packing limit. The three without an anchor (a)–(c) fall from 7.8–8.6 cm to 4.3–4.5 cm. Comparing group means, the anchor sustains roughly 0.7 cm of extra clearance at maximum crowding. The deployed LA Slack Dt-CBF is widest of all at high density, with 5.82 cm at and 5.31 cm at . At , only the anchored formulations still hold a clear margin above , at 7.6–8.8 cm. The unanchored group sits at 6.8–7.1 cm, at or just either side of it. Beyond that density, every formulation operates inside the nominal buffer, already 6.5–6.8 against 5.8–5.9 cm at . The task drives this, not the choice of formulation. Phototaxis gathers the swarm at the light peak, so the robots there sit far closer than the arena average of 30% buffer coverage at (Table 1) would suggest, and neighboring buffers have to overlap. What the anchor leads to is a consistently larger share of the space that remains, and from upward the formulation that holds the widest spacing also records the fewest contacts.
On the robot-obstacle axis, the ordering is similar, but the effect concentrates at the low-density end. At the Slack Dt-CBF and the LA Slack Dt-CBF (d), (e) keep about 5.6 cm of clearance each, against 1.8–3.8 cm for the remaining four, the Slack Dt-HOCBF included. From and up, every formulation converges to 1.6–1.7 cm. At that density, robots are pressed against obstacles by their neighbors rather than by their own control choices, so the safety formulation can no longer set the obstacle clearance. This is the margin-side counterpart of the collision result that obstacles stop mattering once inter-robot congestion dominates (Section 3.5).
Computational cost The LA Slack Dt-CBF costs slightly more to solve because of its added look-ahead constraints. Its per-robot solve time is about 3.7 ms at , roughly 1.0 ms above the cheapest formulations (Fig. 3c). Each robot optimizes against a fixed number of neighbors, so this per-robot cost barely changes with swarm size and stays within 3.66–3.74 ms across the sweep. It is therefore well inside the 100 ms budget of a 10 Hz loop at every density. Section 3.6 reports the distribution and separates this per-robot cost from the per-step wall time of the single-process simulation, which does grow with . The extra cost is small, so on phototaxis, the deployment target, the LA Slack Dt-CBF gives the best trade-off across feasibility, collisions, and safety margin. Therefore, we adopt it as the deployed formulation for the collective behavior simulations.
3.4. Emergence of Collective Behavior
We characterize the emergent behavior of the swarm under the DMPC framework. The LA Slack Dt-CBF formulation governs both inter-robot separation and obstacle avoidance. We study three tasks, namely coordinated phototaxis, phototactic orbiting, and cohesion without a stimulus. Fig. 5 shows representative snapshots at . The snapshots show how the local coupling terms regulate spatial density and heading agreement while each agent pursues its objective, without global communication or a central coordinator. With two and with twelve static obstacles in the arena, every behavior still holds its form while the swarm moves around the obstacles (Figs. 8 and 9 in Appendix A).
We assess coordination among the robots using two distinct metrics. The first is the polar order parameter calculated locally over only the set of active neighbors,
where is the set of active neighbors of each robot inclusive of the robot , and is the number of active neighbors for . When all the robots in every neighborhood are in near-perfect alignment, , whereas in a
Shrestha et al.: Preprint submitted to Elsevier
Page 14 of 26
(a)

(b)
Hard BF Hard Dt-CBF Slack BF Slack Dt-CBF LA Slack Dt-CBF Slack Dt-HOCBF
Figure 4: Safety margins of the six safety formulations versus swarm size (phototaxis with two static obstacles, deployed closed loop with the reactive collision-response layer active, 10-seed mean, 95% CI bands). (a) Steady-state mean nearest-neighbor distance , center to center, dashed horizontal line at cm. (b) Mean robot-obstacle clearance , robot center to obstacle surface, dashed horizontal line at cm, since the obstacle barrier bounds the center-to-center distance. The gray band spans the footprint-contact range, which varies with orientation for elliptical robots (2b–2a between two robots, b–a from a robot center to an obstacle surface). The vertical dashed line marks the geometric packing limit.
disordered state with random robot orientations, . This metric is widely used in biophysics to quantify order in a moving flock or swarm [8, 55]. The second metric is the nearest-neighbor distance averaged over all robots,
where k is the nearest neighbor of robot i. This metric finds pervasive use in quantifying internal group structure in natural and artificial flocks [62, 63]. While the NND varies with animal species, it unequivocally reaches a stable value at long time scales. The top and bottom rows of Fig. 6 elucidate the variation in the local polar order and long-time NND for different swarm sizes and different obstacle numbers, under distinct modes of operation.
3.4.1. Phototaxis Behavior
We first examine the full DMPC formulation with all Reynolds steering rules (Section 2.5) active, demonstrating gradient-following behavior, followed by isolating the contribution of the social coupling by removing these terms entirely.
With Reynolds Flocking Rules – Collective Behavior In phototaxis mode, each robot ascends the light gradient while the cohesion and alignment costs, together with the CBF separation constraints, produce collective motion. The CBF constrains the closing velocity toward each neighbor's predicted position, so avoidance starts early, without the over-braking or deadlocks of purely reactive methods [47]. The swarm stays compact and heading-aligned as it tracks the rotating source (Fig. 5a). The local polar order reduces with increasing swarm size, as radial phototaxis uses a convergent field that brings agents together from all directions, producing head-on encounters that locally cancel heading agreement (Fig. 6a). A cluttered environment further worsen the alignment by introducing additional
Shrestha et al.: Preprint submitted to Elsevier
Page 15 of 26
(a)

(b)

(c)

(d)

Position x [m]
Position x [m]
Position x [m]
Position x [m]
Position x [m]
World boundary
Light
Robot
Active collision
Figure 5: Collective behavior in obstacle-free space with the LA Slack Dt-CBF formulation, . (a) Phototaxis, where the swarm stays cohesive and heading-aligned while tracking the moving light source. (b) Phototaxis with the coupling costs and avoidance constraints removed, where the robots pile up at the light peak and collide. (c) Phototactic orbiting, where the swarm co-rotates along the light's intensity level set. (d) Cohesion without a stimulus, where the Reynolds costs alone keep the group cohesive. Each column corresponds to a certain time t, and the orange field is the light source. Supplementary video 1 shows these four behaviors in the obstacle-free arena.
collision avoidance, which de-aligns the local heading. The NND (Fig. 6d), on the other hand, decreases as the space for movement in the domain decreases (increasing swarm size), partly also attributable to the nature of the phototaxis mode, which attempts to converge the robots to a small location. Beyond , the NND falls below the safe buffer distance of cm, indicating some amount of buffer overlap. As the swarm size approaches the geometric packing limit, the phototaxis gradient forces the robots into oblique, blocking contacts, causing NND to fall as low as 5 cm.
Without Reynolds Flocking Rules – Swarm Collapse In the absence of the cohesion and alignment costs and the separation constraints, the collective behavior disappears. Each robot climbs the gradient on its own, so the swarm
Shrestha et al.: Preprint submitted to Elsevier
Page 16 of 26 arrives at the light peak without spacing or heading agreement (Fig. 5b). The swarm effectively collapses onto a small area in the domain, clearly attributing the occurrence of flocking to the Reynolds steering costs.
3.4.2. Phototactic Orbital Behavior
In the phototactic orbital mode, each robot follows the tangent of the sensed intensity level set through the gradient-rotation reference (9), orbiting the source without global localization. The CBF constraints (26) prevent collisions as robots compete for the same orbit while the cohesion and alignment costs keep the swarm compact and co-rotating. From arbitrary initial positions, it converges to a stable orbital formation (Fig. 5c). Although the phototactic orbital mode is susceptible to crowding similar to the phototaxis mode, the decay of the local polar order is more muted in the former (Fig. 6b). This is a direct consequence of the co-location of local neighbors along concentric orbital paths, leading to better heading agreement, even for large swarms. Similarly, the NND also settles slightly below the safe buffer distance even for , as the locally tangential motion along the orbital causes the robots to align along their major axes, allowing for sufficient separation among them (Fig. 6e). Both metrics are only mildly affected by the addition of obstacles to the system.
3.4.3. Flocking in the Absence of Stimuli
In this mode, the light field is disabled, providing the robots no global stimulus. Hence, each robot holds its heading with a small random turn each step. The swarm drifts outward and settles into a band along the walls, with an empty interior (Fig. 5d). Once a robot reaches a wall, it stays there until its heading drifts away, so the walls fill faster than they empty. Cohesion and alignment order the band, so the swarm circulates the arena similar to an edge current [64].
(a)

(b)
(c)
(d)
(e)

(f)

Free space
Few obstacles (2)
Cluttered (12)
Figure 6: Local polar order (top row) and average nearest-neighbor distance (NND; bottom row) versus swarm size for the deployed LA Slack Dt-CBF, one column per collective behavior (10-seed mean with 95% CI bands, steady state over the last 300 s). The columns are phototaxis (a, d), phototactic orbiting (b, e), and cohesion without a stimulus (c, f). Each panel compares the obstacle-free arena, the few-obstacle arena (2 obstacles), and the cluttered arena (12 obstacles, positions randomized per seed). The dotted horizontal line marks the buffer distance of , while the vertical dashed line marks the geometric packing limit .
The flock remains relatively well-aligned at low swarm sizes, with heading disagreements as the domain starts getting crowded with robots and obstacles due to frequent steering for collision avoidance (Fig. 6c). This is an expected outcome, showing that the alignment and cohesion costs work as intended. The band structure resembles the phototactic
Shrestha et al.: Preprint submitted to Elsevier
Page 17 of 26 orbital, despite the difference in shape of the orbit. This is evident from the NND (Fig. 6f), which follows a similar trend as in the phototactic orbital mode.
3.5. Collision Behavior Across Density and Tasks
The collision load of the deployed LA Slack Dt-CBF depends on both swarm size and task. We measure both here, across three obstacle environments.
Collisions versus swarm size We sweep across three environments, namely obstacle-free, few-obstacle (2), and cluttered (12, positions randomized per seed). We count distinct robot-robot contacts over the 9000-step run (Fig. 7). Contacts stay negligible in small swarms. Free space averages 1.0 contact at , with the nearest neighbor 8.8 cm away on average, well above . Contacts then climb steeply, from at to at the packing limit, where the mean nearest-neighbor separation has fallen to 5.3 cm. The growth is strongly linear. Contacts rise by a factor of 87 between and while the robot count only doubles. Near the packing limit the full margin cannot be held for every pair, so the slacked CBF admits transient contacts while the solver stays feasible (Section 3.3).
Obstacles dominate in small swarms and hardly matter in large ones (Fig. 7). At the cluttered arena produces three orders of magnitude more contacts than free space. By that gap has closed to a factor of 1.6, and by to 1.3. The crossover falls between and . The environment therefore dominates in small swarms, while in large swarms collisions come from the packing density.
(a)

(b)
(c)
Free space
Few obstacles (2)
Cluttered (12)
Figure 7: Distinct contacts versus swarm size for the deployed LA Slack Dt-CBF. (a) Phototaxis, (b) phototactic orbiting, and (c) cohesion without a stimulus. Each panel compares the obstacle-free arena, the few-obstacle arena (2), and the cluttered arena (12, positions randomized per seed). The vertical axis is log-scaled. The dashed vertical line marks the packing limit . The band around each curve is the 95% confidence interval over 10 seeds.
Effectiveness of avoidance is set by task geometry Considering an identical controller, the number of contacts spans two orders of magnitude across the three behaviors, a factor of 103 between the best and the worst at (Fig. 7). Phototaxis concentrates the swarm at the peak intensity of the light source and has the highest number of contacts at . The orbital mode spreads robots along an intensity level set and has far fewer contacts at . Cohesion without a stimulus falls in between at . However, this order of effectiveness is not preserved across different swarm sizes. The stimulus-free mode is the worst in small swarm, with 25 contacts at , whereas the other modes record none. The cause is how robots meet, not how crowded they are. At the stimulus-free swarm is the most spread out of the three, with a mean nearest-neighbor distance of 16.1 cm against 9.9 cm for phototaxis. The difference is in their headings. A shared gradient gives phototaxis and orbiting a common direction, so two robots that come close are already traveling the same way. Without a stimulus each robot follows its own random heading, and only the local coupling keeps neighbors together. In large swarms the same absence of a shared target protects it, since the robots never concentrate. At every larger swarm size orbiting stays safest and phototaxis worst, except in the cluttered arena where the stimulus-free mode moves ahead of orbiting at and . Obstacles raise contacts in every mode, but the orbital mode pays the largest penalty, at against for phototaxis. Obstacles sit directly on the orbit and force detours. The safety formulation decides how large a swarm can grow before contacts appear. The task decides how many contacts it has at any given size.
Shrestha et al.: Preprint submitted to Elsevier
Page 18 of 26
3.6. Computational Performance and Scalability
The experiments run one task per core on shared compute nodes, so other jobs on the same node could slow down the solve time. We repeated the measurement on an idle node reserved for this run alone. Averaged over the density sweep, each formulation's mean agrees with its shared-node value to within 0.07 ms, so sharing a node does not distort the per-robot times reported in Section 3.3, and the idle run also gives the full distribution. Each solve covers the full per-robot control step, including both consensus iterations.
The mean and the 99th percentile stay well inside both the 100 ms (10 Hz) and 33.3 ms (30 Hz) budgets at every density. Across the six formulations peaks at 13.1 ms, and at the operating densities it stays at or below 3.9 ms. Worst-case single solves are larger and matter for a hard real-time guarantee. The maximum observed on the idle node is 98.8 ms, so the 10 Hz budget is met at every density while the 30 Hz budget is not. These maxima are lone draws from the tail. They grow with only because a larger swarm performs more solves per run, from 3000 at to 41100 at , while the mean and do not grow. A 30 Hz deployment would therefore cap the solver iterations and fall back to the reactive controller on the rare overrun.
The per-step wall time necessarily grows with , since a single process advances all robots in sequence. It is at least times the per-robot cost, so , 93, 184 and 374 ms at . This is a simulation artifact. Each robot runs its own optimization onboard or in parallel when deployed, so the governing cost is the per-robot time. That cost is flat in (Section 3.3), so computation does not limit the swarm size. The current single-process simulation bottleneck can be removed through parallel execution and is left as future implementation work.
4. Conclusion
We presented a distributed predictive flocking controller for dense miniature ellipsoid robot swarms in a confined arena. Each robot solves a local NMPC combining task tracking, Reynolds-style flocking, and inter-robot and obstacle safety constraints, using only exchanged predicted trajectories of active neighbors, without a leader, central planner, or global map. The results demonstrate that the same controller architecture generalizes across different modal objectives such as gradient-ascending phototaxis, stable phototactic orbital formation, and even flocking in the absence of any stimulus. The emergent collective behavior arises purely from local optimization of cohesion and alignment costs, coupled with safety constraints that maintain separation. This separability between the task and the coordination points towards a modeling paradigm where new tasks can plausibly be added without necessarily re-deriving the safety features or coordination structure. Each robot optimizes against a fixed neighbor set, so solve time is in swarm size, measured at 3.7 ms on average and flat across the density sweep, making the scaling limit architectural (a serial solve with a single workstation caps closed-loop control at roughly 27 robots) rather than algorithmic.
Comparing six safety formulations under identical conditions showed that performance is determined by structure rather than barrier order; pairing a slacked barrier anchor with a rate condition reduces contact counts by a factor of 2.4 relative to formulations without an anchor, with no overlap across the density sweep. Considering the phototaxis mode as the deployment target, the LA Slack Dt-CBF is found to be most effective in preventing collisions, while also providing the highest inter-robot margins for most swarm sizes tested. The look-ahead handle drives this improvement, giving the turn rate direct authority over the constraint so a robot can steer around a neighbor rather than only brake. Removing this handle alone raises contacts by up to a factor of 2.5 at low density, and by 1.2 at the geometric packing limit. Moreover, a higher-order rate chain improves performance further at moderate density but loses its advantage at the packing limit, showing that a higher barrier order does not automatically guarantee better safety.
The collective motion is analyzed through local polar order and NND analysis, which, apart from quantifying controller performance, also point toward a biomimetic reading of these results. The muted order decay and more efficient packing found for the orbital mode, versus the sharper degradation under phototaxis, mirror a structural distinction well documented in natural swarms: neighbors on a shared circulating path align through a shear-like velocity field, while neighbors converging on a common point align through a convergent one, with the latter being inherently more collision-prone and alignment-averse as group size grows. That our controller reproduces these qualitative results from local optimization alone, without it being an explicit design target, suggests the polar order and NND metrics already computed here could serve as a bridge to the natural flocking literature. Furthermore, the wall-following behavior observed in the absence of external stimuli concurs well with studies of natural fish schools and insect swarms in confined spaces, a systematic evaluation and comparison of which can open a path to tuning the flocking and safety weights toward biologically observed regimes rather than controller-internal ones.
Shrestha et al.: Preprint submitted to Elsevier
Page 19 of 26
The current work has two limitations. The vibration and friction induced locomotion of the real bristlebot is modeled only kinematically rather than physically, so variations involving surface, payload, and actuation asymmetry enter the controller only as unmodeled disturbance. The safety comparison is also internal by design: six formulations within one stack, which isolates the safety constraint but does not benchmark against external distributed-flocking baselines, most of which target fully actuated 3D quadrotors or underactuated 2D robots rather than vibration-driven platforms. Further extensions can be carried out in terms of optimization and learning; the slack weight, rate-condition horizon, and look-ahead distance form a compact design space suited to automated tuning against the contact-rate and feasibility metrics already collected here, while a learned residual dynamics model could absorb the friction disturbance currently left unmodeled, narrowing the gap between the kinematic model and the true vibration-driven actuation. Immediate next steps include physical validation on the GRASPion hardware, extension to dynamic obstacle avoidance, and robust or stochastic MPC formulations for stronger safety guarantees. Overall, these results establish a single, kinematic model-agnostic NMPC architecture that unifies task-driven behavior, emergent flocking, and safety against collisions, while the polar-order and NND signatures it reproduces open a concrete path toward grounding swarm-robotics control in the structure of natural collective motion.
CRediT authorship contribution statement
Prajol Shrestha: Conceptualization, Methodology, Software, Formal Analysis, Writing – Original Draft, Writing – Review & Editing, Visualization, Validation. Siddhant Mohapatra: Conceptualization, Formal Analysis, Visualization, Writing – Review & Editing. Filip Novkoski: Formal Analysis, Visualization, Writing – Review & Editing. Julian Oelhaf: Writing – Review & Editing. Nicolas Vandewalle: Writing – Review & Editing. Ana-Sunčana Smith: Writing – Review & Editing. Andreas Maier: Supervision, Resources, Project administration, Funding acquisition, Conceptualization, Writing – Review & Editing.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Data availability
No external data was used. The code and simulation environment that reproduce all results are available at https://github.com/prajolshrestha/bristlebot-swarm-mpc. The full set of simulation videos, including the full-length renders from which the supplementary videos are derived, is archived at https://doi.org/10.5281/zenodo.22642863.
References
[1] Guang-Zhong Yang, Jim Bellingham, Pierre E. Dupont, Peer Fischer, Luciano Floridi, Robert Full, Neil Jacobstein, Vijay Kumar, Marcia McNutt, Robert Merrifield, Bradley J. Nelson, Brian Scassellati, Mariarosaria Taddeo, Russell Taylor, Manuela Veloso, Zhong Lin Wang, and Robert Wood. The grand challenges of science robotics. Science Robotics, 3(14):eaar7650, 2018. doi: 10.1126/scirobotics.aar7650.
[2] S Camazine, J Deneubourg, NR Franks, J Sneyd, G Theraulaz, and E Bonabeau. Self-Organization in Biological Systems. Princeton University Press, 2001.
[3] Tamás Vicsek, András Czirók, Eshel Ben-Jacob, Inon Cohen, and Ofer Shochet. Novel type of phase transition in a system of self-driven particles. Phys. Rev. Lett., 75:1226–1229, Aug 1995. doi: 10.1103/PhysRevLett.75.1226.
[4] A. Jadbabaie, Jie Lin, and A.S. Morse. Coordination of groups of mobile autonomous agents using nearest neighbor rules. IEEE Transactions on Automatic Control, 48(6):988–1001, 2003. doi: 10.1109/TAC.2003.812781.
[5] Sabrina M. Neuman, Brian Plancher, Bardienus P. Duisterhof, Srivatsan Krishnan, Colby Banbury, Mark Mazumder, Shvetank Prakash, Jason Jabbour, Aleksandra Faust, Guido C.H.E. de Croon, and Vijay Janapa Reddi. Tiny robot learning: Challenges and directions for machine learning in resource-constrained robots. In 2022 IEEE 4th International Conference on Artificial Intelligence Circuits and Systems (AICAS), pages 296–299, 2022. doi: 10.1109/AICAS54282.2022.9870000.
[6] Craig W. Reynolds. Flocks, herds and schools: A distributed behavioral model. In Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques, pages 25–34. ACM, 1987. doi: 10.1145/37401.37406.
[7] Craig W. Reynolds. Steering behaviors for autonomous characters. In Proceedings of the Game Developers Conference 1999, pages 763–782, San Jose, CA, USA, 1999. Miller Freeman Game Group.
[8] Iain D Couzin, Jens Krause, Richard James, Graeme D Ruxton, and Nigel R Franks. Collective memory and spatial sorting in animal groups. Journal of Theoretical Biology, 218(1):1–11, 2002. ISSN 0022-5193. doi: https://doi.org/10.1006/jtbi.2002.3065.
Shrestha et al.: Preprint submitted to Elsevier
Page 20 of 26
[9] R. Olfati-Saber. Flocking for multi-agent dynamic systems: algorithms and theory. IEEE Transactions on Automatic Control, 51(3):401–420, 2006. doi: 10.1109/TAC.2005.864190.
[10] H.G. Tanner, A. Jadbabaie, and G.J. Pappas. Stable flocking of mobile agents, part i: fixed topology. In 42nd IEEE International Conference on Decision and Control (IEEE Cat. No.03CH37475), volume 2, pages 2010–2015 Vol.2, 2003. doi: 10.1109/CDC.2003.1272910.
[11] Gábor Vásárhelyi, Csaba Virágh, Gergő Somorjai, Tamás Nepusz, Agoston E. Eiben, and Tamás Vicsek. Optimized flocking of autonomous drones in confined environments. Science Robotics, 3(20):eaat3536, 2018. doi: 10.1126/scirobotics.aat3536.
[12] James B. Rawlings, David Q. Mayne, and Moritz M. Diehl. Model Predictive Control: Theory, Computation, and Design. Nob Hill Publishing, 2nd edition, 2017.
[13] Ruben Van Parys and Goele Pipeleers. Distributed mpc for multi-vehicle systems moving in formation. Robotics and Autonomous Systems, 97:144–152, 2017. ISSN 0921-8890. doi: 10.1016/j.robot.2017.08.009.
[14] Carlos E. Luis, Marijan Vukosavljev, and Angela P. Schoellig. Online trajectory generation with distributed model predictive control for multi-robot motion planning. IEEE Robotics and Automation Letters, 5(2):604–611, 2020. doi: 10.1109/LRA.2020.2964159.
[15] Andrea Testa, Andrea Camisa, and Giuseppe Notarstefano. Choirbot: A ros 2 toolbox for cooperative robotics. IEEE Robotics and Automation Letters, 6(2):2714–2720, 2021. doi: 10.1109/LRA.2021.3061366.
[16] Lorenzo Pichierri, Andrea Testa, and Giuseppe Notarstefano. Crazychoir: Flying swarms of crazyflie quadrotors in ros 2. IEEE Robotics and Automation Letters, 8(8):4713–4720, 2023. doi: 10.1109/LRA.2023.3286814.
[17] Robin Verschueren, Gianluca Frison, Dimitris Kouzoupis, Jonathan Frey, Niels van Duijkeren, Andrea Zanelli, Branimir Novoselnik, Thivaharan Albin, Rien Quirynen, and Moritz Diehl. acados – a modular open-source framework for fast embedded optimal control. Mathematical Programming Computation, 2021. doi: 10.1007/s12532-021-00208-8.
[18] Xin Zhou, Xiangyong Wen, Zhepei Wang, Yuman Gao, Haojia Li, Qianhao Wang, Tiankai Yang, Haojian Lu, Yanjun Cao, Chao Xu, and Fei Gao. Swarm of micro flying robots in the wild. Science Robotics, 7(66):eabm5954, 2022. doi: 10.1126/scirobotics.abm5954.
[19] Charbel Toumieh and Dario Floreano. High-speed motion planning for aerial swarms in unknown and cluttered environments. IEEE Transactions on Robotics, 40:3642–3656, 2024. doi: 10.1109/TRO.2024.3429193.
[20] Kota Kondo, Claudius T. Tewari, Andrea Tagliabue, Jesus Tordesillas, Parker C. Lusk, Mason B. Peterson, and Jonathan P. How. Primer: Perception-aware robust learning-based multiagent trajectory planner. In 2025 IEEE International Conference on Robotics and Automation (ICRA), pages 14154–14160, 2025. doi: 10.1109/ICRA55743.2025.11128011.
[21] Baskin Şenbaşlar and Gaurav S. Sukhatme. Dream: Decentralized real-time asynchronous probabilistic trajectory planning for collision-free multirobot navigation in cluttered environments. IEEE Transactions on Robotics, 41:573–592, 2025. doi: 10.1109/TRO.2024.3509015.
[22] Charbel Toumieh and Alain Lambert. Decentralized multi-agent planning using model predictive control and time-aware safe corridors. IEEE Robotics and Automation Letters, 7(4):11110–11117, 2022. doi: 10.1109/LRA.2022.3196777.
[23] Enrica Soria, Fabrizio Schiano, and Dario Floreano. Predictive control of aerial swarms in cluttered environments. Nature Machine Intelligence, 3(6):545–554, 2021. doi: 10.1038/s42256-021-00341-y.
[24] Enrica Soria, Fabrizio Schiano, and Dario Floreano. Distributed predictive drone swarms in cluttered environments. IEEE Robotics and Automation Letters, 7(1):73–80, 2022. doi: 10.1109/LRA.2021.3118091.
[25] Aneek Nag, Shuo Huang, Andreas Themelis, and Kaoru Yamamoto. Flock navigation with dynamic hierarchy and subjective weights using nonlinear mpc. In 2022 IEEE Conference on Control Technology and Applications (CCTA), pages 1135–1140, 2022. doi: 10.1109/CCTA49430.2022.9966067.
[26] Aneek Nag and Kaoru Yamamoto. Distributed control for flock navigation using nonlinear model predictive control. Advanced Robotics, 38(9-10):619–631, 2024. doi: 10.1080/01691864.2023.2299859.
[27] Nuthasith Gerdpratoom and Kaoru Yamamoto. Decentralized nonlinear model predictive control-based flock navigation with real-time obstacle avoidance in unknown obstructed environments. Frontiers in Robotics and AI, 12, 2025. ISSN 2296-9144. doi: 10.3389/frobt.2025.1540808. URL https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2025.1540808.
[28] Fanbo Kong, Hao Chen, Huiming Li, Jiarun Yan, Xiangke Wang, and Jianwei Fang. Flocking with obstacle avoidance for fixed-wing unmanned aerial vehicles via nonlinear model predictive control. In 2023 42nd Chinese Control Conference (CCC), pages 5957–5962, 2023. doi:10.23919/CCC58697.2023.10240689.
[29] Aaron D. Ames, Xiangru Xu, Jessy W. Grizzle, and Paulo Tabuada. Control barrier function based quadratic programs for safety critical systems. IEEE Transactions on Automatic Control, 62(8):3861–3876, 2017. doi: 10.1109/TAC.2016.2638961.
[30] Amir Salimi Lafmejani and Spring Berman. Nonlinear mpc for collision-free and deadlock-free navigation of multiple nonholonomic mobile robots. Robotics and Autonomous Systems, 141:103774, 2021. ISSN 0921-8890. doi: 10.1016/j.robot.2021.103774.
[31] Björn Lindqvist, Sina Sharif Mansouri, Ali-akbar Agha-mohammadi, and George Nikolakopoulos. Nonlinear mpc for collision avoidance and control of uavs with dynamic obstacles. IEEE Robotics and Automation Letters, 5(4):6001–6008, 2020. doi: 10.1109/LRA.2020.3010730.
[32] Ayush Agrawal and Koushil Sreenath. Discrete control barrier functions for safety-critical control of discrete systems with application to bipedal robot navigation. In Robotics: Science and Systems XIII, Cambridge, Massachusetts, 2017. doi: 10.15607/RSS.2017.XIII.073.
[33] Jun Zeng, Bike Zhang, and Koushil Sreenath. Safety-critical model predictive control with discrete-time control barrier function. In 2021 American Control Conference (ACC), pages 3882–3889, 2021. doi: 10.23919/ACC50511.2021.9483029.
[34] Jun Zeng, Zhongyu Li, and Koushil Sreenath. Enhancing feasibility and safety of nonlinear model predictive control with discrete-time control barrier functions. In 2021 60th IEEE Conference on Decision and Control (CDC), pages 6137–6144, 2021. doi: 10.1109/CDC45484.2021.9683174.
[35] Jun Zeng, Bike Zhang, Zhongyu Li, and Koushil Sreenath. Safety-critical control using optimal-decay control barrier function with guaranteed point-wise feasibility. In 2021 American Control Conference (ACC), pages 3856–3863, 2021. doi: 10.23919/ACC50511.2021.9482626.
[36] Nhat Nguyen Minh, Stephen McIlvanna, Yuzhu Sun, Yan Jin, and Mien Van. Enhancing mobile robot navigation safety and efficiency through nmpc with relaxed cbf in dynamic environments. In 2024 IEEE 20th International Conference on Automation Science and Engineering (CASE), pages 2308–2313, 2024. doi: 10.1109/CASE59546.2024.10711662.
Shrestha et al.: Preprint submitted to Elsevier
Page 21 of 26
[37] Kim P. Wabersich and Melanie N. Zeilinger. Predictive control barrier functions: Enhanced safety mechanisms for learning-based control. IEEE Transactions on Automatic Control, 68(5):2638–2651, 2023. doi: 10.1109/TAC.2022.3175628.
[38] Alexander Katriniok, Erfan Shakhesi, and W.P.M.H. Heemels. Discrete-time control barrier functions for guaranteed recursive feasibility in nonlinear mpc: An application to lane merging. In 2023 62nd IEEE Conference on Decision and Control (CDC), pages 3776–3783, 2023. doi: 10.1109/CDC49753.2023.10384157.
[39] Zetao Lu, Kaijun Feng, and Jun Xu. Robot safe planning in dynamic environments based on mpc using control barrier function. In 2024 China Automation Congress (CAC), pages 3358–3363, 2024. doi: 10.1109/CAC63892.2024.10864636.
[40] Wei Xiao and Calin Belta. Control barrier functions for systems with high relative degree. In 2019 IEEE 58th Conference on Decision and Control (CDC), pages 474–479, 2019. doi: 10.1109/CDC40024.2019.9029455.
[41] Quan Nguyen and Koushil Sreenath. Exponential control barrier functions for enforcing high relative-degree safety-critical constraints. In 2016 American Control Conference (ACC), pages 322–328, 2016. doi: 10.1109/ACC.2016.7524935.
[42] Jur van den Berg, Stephen J. Guy, Ming Lin, and Dinesh Manocha. Reciprocal n-body collision avoidance. In Robotics Research: The 14th International Symposium ISRR, volume 70 of Springer Tracts in Advanced Robotics, pages 3–19. Springer, 2011. doi: 10.1007/978-3-642-19457-3_1.
[43] Dingjiang Zhou, Zijian Wang, Saptarshi Bandyopadhyay, and Mac Schwager. Fast, on-line collision avoidance for dynamic vehicles using buffered voronoi cells. IEEE Robotics and Automation Letters, 2(2):1047–1054, 2017. doi: 10.1109/LRA.2017.2656241.
[44] Li Wang, Aaron D. Ames, and Magnus Egerstedt. Safety barrier certificates for collisions-free multirobot systems. IEEE Transactions on Robotics, 33(3):661–674, 2017. doi: 10.1109/TRO.2017.2659727.
[45] Pravin Mali, K. Harikumar, Arun Kumar Singh, K. Madhava Krishna, and P.B. Sujit. Incorporating prediction in control barrier function based distributive multi-robot collision avoidance. In 2021 European Control Conference (ECC), pages 2394–2399, 2021. doi: 10.23919/ECC54610.2021.9655081.
[46] Chao Wang, Shuyuan Zhang, and Lei Wang. Distributed safety-critical mpc for multi-agent formation control and obstacle avoidance. In 2025 IEEE 64th Conference on Decision and Control (CDC), pages 3288–3295, 2025. doi: 10.1109/CDC57313.2025.11312786.
[47] Rohan Chandra, Vrushabh Zinage, Efstathios Bakolas, Peter Stone, and Joydeep Biswas. Deadlock-free, safe, and decentralized multi-robot navigation in social mini-games via discrete-time control barrier functions. Autonomous Robots, 49(2):12, 2025. doi: 10.1007/s10514-025-10194-8.
[48] Manohari Goarin, Guanrui Li, Alessandro Saviolo, and Giuseppe Loianno. Decentralized nonlinear model predictive control for safe collision avoidance in quadrotor teams with limited detection range. In 2025 IEEE International Conference on Robotics and Automation (ICRA), pages 5387–5393, 2025. doi: 10.1109/ICRA55743.2025.11128389.
[49] I. Mammadli, P. Shrestha, J. Pande, F. Novkoski, S. Mohapatra, M. Noirhomme, A. Maier, N. Vandewalle, and A. S. Smith. Physics-informed digital twin and onboard control of a brainbot for intelligent active matter. Physical Review Research, 8:033164, Aug 2026. doi: 10.1103/rd1t-h2v6.
[50] F. Novkoski, M. Mélard, M. Delens, F. Wéry, M. Noirhomme, J. Pande, A. Maier, A.-S. Smith, and N. Vandewalle. Graspion: An open-source, programmable brainbot for active matter research. Review of Scientific Instruments, 97(1):014704, 01 2026. ISSN 0034-6748. doi: 10.1063/5.0303152.
[51] Jihao Huang, Zhitao Liu, Jun Zeng, Xuemin Chi, and Hongye Su. Obstacle avoidance for unicycle-modelled mobile robots with time-varying control barrier functions. In IECON 2023- 49th Annual Conference of the IEEE Industrial Electronics Society, pages 1–6, 2023. doi: 10.1109/IECON51785.2023.10312269.
[52] M. Ballerini, N. Cabibbo, R. Candelier, A. Cavagna, E. Cisbani, I. Giardina, V. Lecomte, A. Orlandi, G. Parisi, A. Procaccini, M. Viale, and V. Zdravkovic. Interaction ruling animal collective behavior depends on topological rather than metric distance: Evidence from a field study. Proceedings of the National Academy of Sciences, 105(4):1232–1237, 2008. doi: 10.1073/pnas.0711437105.
[53] A. Strandburg-Peshkin, C. R. Twomey, N. W. F. Bode, A. B. Kao, Y. Katz, C. C. Ioannou, S. B. Rosenthal, C. J. Torney, H. S. Wu, S. A. Levin, and I. D. Couzin. Visual sensory networks and effective information transfer in animal groups. Current Biology, 23(17):R709–R711, 2013. doi: 10.1016/j.cub.2013.07.059.
[54] Zhifu Chen and Tianguang Chu. Multi-agent system model with mixed coupling topologies for pattern formation and formation splitting. Mathematical and Computer Modelling of Dynamical Systems, 19(4):388–400, 2013. doi: 10.1080/13873954.2012.750614.
[55] Tamás Vicsek and Anna Zafeiris. Collective motion. Physics reports, 517(3-4):71–140, 2012.
[56] Dimitri P. Bertsekas and John N. Tsitsiklis. Parallel and Distributed Computation: Numerical Methods. Athena Scientific, 2015. ISBN 1-886529-15-9.
[57] Jon Louis Bentley. Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9):509–517, 1975. doi: 10.1145/361002.361007.
[58] Jerome H. Friedman, Jon Louis Bentley, and Raphael Ari Finkel. An algorithm for finding best matches in logarithmic expected time. ACM Transactions on Mathematical Software, 3(3):209–226, 1977. doi: 10.1145/355744.355745.
[59] Joel A E Andersson, Joris Gillis, Greg Horn, James B Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi: 10.1007/s12532-018-0139-4.
[60] Gianluca Frison and Moritz Diehl. Hpipm: a high-performance quadratic programming framework for model predictive control. IFAC-PapersOnLine, 53(2):6563–6569, 2020. ISSN 2405-8963. doi: 10.1016/j.ifacol.2020.12.073. 21st IFAC World Congress.
[61] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In The 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2623–2631, 2019. doi: 10.1145/3292500.3330701.
[62] Brian L Partridge and Tony J Pitcher. The sensory basis of fish schools: relative roles of lateral line and vision. Journal of comparative physiology, 135(4):315–325, 1980. doi: 10.1007/BF00657647.
Shrestha et al.: Preprint submitted to Elsevier
Page 22 of 26
[63] Florian Berlinger, Melvin Gauci, and Radhika Nagpal. Implicit coordination for 3d underwater collective behaviors in a fish-inspired robot swarm. Science Robotics, 6(50):eabd8668, 2021. doi: 10.1126/scirobotics.abd8668.
[64] Kazusa Beppu, Ziane Izri, Tasuku Sato, Yoko Yamanishi, Yutaka Sumino, and Yusuke T. Maeda. Edge current and pairing order transition in chiral bacterial vortices. Proceedings of the National Academy of Sciences, 118(39):e2107461118, 2021. doi: 10.1073/pnas.2107461118.
Shrestha et al.: Preprint submitted to Elsevier
Page 23 of 26
A. Collective behaviors with static obstacles
Figs. 8 and 9 repeat the four panels of Fig. 5 in cluttered arenas, with two and with twelve static obstacles. Each mode keeps the same qualitative behavior while the controller routes the swarm around the obstacles.
(a)

(b)

(c)

(d)

— World boundary
Light
Robot
Static obstacle
Active collision
Figure 8: Collective behaviors with two static obstacles (LA Slack Dt-CBF formulation, ), one behavior per row. (a) Phototaxis, (b) phototaxis with the Reynolds coupling removed, (c) phototactic orbiting, and (d) cohesion without a stimulus. Columns are snapshots at t = 0, 225, 450, 675 and 900 s. The red disks are the static obstacles and the orange field is the light source. Supplementary video 2 shows these four behaviors in the two-obstacle arena.
Shrestha et al.: Preprint submitted to Elsevier
Page 24 of 26
(a)

(b)

(c)

(d)

World boundary
Light
Robot
Static obstacle
Active collision
Figure 9: Collective behaviors with twelve static obstacles (LA Slack Dt-CBF formulation, ), one behavior per row. (a) Phototaxis, (b) phototaxis with the Reynolds coupling removed, (c) phototactic orbiting, and (d) cohesion without a stimulus. Columns are snapshots at t = 0, 225, 450, 675 and 900 s. The red disks are the static obstacles and the orange field is the light source. Supplementary video 3 shows these four behaviors in the cluttered arena.
Shrestha et al.: Preprint submitted to Elsevier
Page 25 of 26
B. Supplementary data
Table 3 lists the complete set of controller, safety, environment, and simulation parameters used to produce every result, so the setup of Section 3 is reproducible from the paper alone.
Table 3
Complete controller, safety, environment, and simulation parameters used for all experiments. Robot-scale lengths are in cm, the arena and sensing ranges in m, and speeds in m/s; cost and slack weights are dimensionless. Values are those of the deployed LA Slack Dt-CBF; the cost weights, horizon, arena and platform limits are shared by every formulation, while , , , and the slack weights are re-tuned per formulation (Section 3.1). The angular-rate bounds are asymmetric, reflecting the vibration-driven platform's differing left- and right-turn authority.
| Parameter | Value |
|---|---|
| Model and actuation bounds | |
| Arena | |
| Position bounds | [-0.4, 0.4] m |
| Linear speed | [0.01, 0.15] m/s |
| Angular rate | [-3.463, 1.432] rad/s |
| Robot semi-axes | 3 cm, 1.5 cm |
| Cost weights (dimensionless) | |
| Position, heading | 60, 80 |
| Speed, turn rate | 1.5, 1.5 |
| Control effort | 0.01 |
| Cohesion, alignment | 2.0, 5.0 |
| Slack quadratic | |
| Slack linear | |
| Safety and barrier-CBF | |
| Safe distance | 7 cm |
| Decay (inter-robot) | 0.9 |
| Decay (obstacle) | 0.9 |
| Look-ahead handle | 2.1 cm |
| Dt-HOCBF gains | 0.5, 0.5 |
| Dt-HOCBF obstacle gains | 0.5, 0.5 |
| Communication, sensing, environment | |
| Communication radius | 0.15 m |
| Max neighbors, obstacle slots | 5, 5 |
| Consensus iterations | 2 |
| Obstacle sensing range | 0.30 m |
| Obstacle radius | 3 cm |
| Obstacle counts (free/few/cluttered) | 0 / 2 / 12 |
| Light spread , orbit radius | 0.10 m, 0.25 m |
| Source speed | 0.15 m/s |
| Behavior look-ahead , ref. speed | 7 cm, 0.10 m/s |
| Simulation and evaluation | |
| Horizon , control step | 20, 0.1 s |
| Episode length | 9000 steps (900 s) |
| Random seeds | 10 |
| Integrator | ERK-4, 3 steps/interval |
| QP solver | acados SQP-RTI, HPIP M, Gauss-Newton |
Shrestha et al.: Preprint submitted to Elsevier
Page 26 of 26