Potential issue: consistency is only eventual.
How long will it take to re-form the formation?

Potential issues on the transient behavior

Did not lose formation, neither connection, avoided the obstacle safely and keep going towards their goal.
Ensure guarantees on the transient behavior of the system, not only on the eventual one.
In control theory, there exist formal methods to specify both stability and safety conditions:
Control Theory is a branch of engineering and mathematics that deals with the behavior of dynamical systems with inputs (controls).
The main goal is to develop control strategies that modify the system’s behavior to achieve a desired state,
while minimizing delays or errors, while ensuring safety and control stability.
Control can only be applied with respect to the system’s temporal evolution.
A Control Loop is a feedback-driven mechanism that measures the current state of a system,
compares it to a desired set-point,
and automatically adjusts the control input to minimize the error between the two.
An automatic control system can operate in two ways: as an open-loop control or as a feedback (closed-loop) control.
The control input is determined without considering the current state of the system.
It relies on predefined control actions based on a model of the system.
The control input is continuously adjusted based on the current state of the system.
It uses feedback from the system to correct deviations from the desired state.


Lyapunov Theory provides tools to analyze the stability property of dynamical systems.
An autonomous dynamical system without a control input is described by the equation
$\dot{x} = f(x)$
Starting from an initial state $x_0$, there exist some trajectory from there, and we want to verify whether the system converges to a desired equilibrium point $x_e$.

Given a different function $\dot{x} = f(x)$ and a different trajectory:
Our goal is to ensure that the trajectory remains within a region of interest.
A Control-Affine System is a dynamical system described by the equation:
$\dot{x} = f(x) + g(x)u$
where:
The Lie Derivative represents how a scalar function $h(x)$ changes in time as the state evolves,
according to the system dynamics along a vector field $f: \mathbb{R}^n \to \mathbb{R}^n$.
It is represented as $L_f h(x)$
For a Control-Affine System $\dot{x} = f(x) + g(x)u$, the time derivative of $h(x)$ is:
$\dot{h}(x, u) = L_f h(x) + L_g h(x) u$
where:
This notation captures how $h(x)$ evolves due to both natural dynamics and control input over time.
A Control Lyapunov Function (CLF) is a scalar function that measures how “far” the system’s state is from a desired target set $\mathcal{X}_d$.
If we can design such a function so that it always decreases along the trajectories of the system,
then the state is driven towards $\mathcal{X}_d$ and the system can be stabilized by a suitable feedback control.
A continuously differentiable function $V: \mathbb{R}^n \to \mathbb{R}_{\geq 0}$ is a CLF for the target set $\mathcal{X}_d \subseteq \mathbb{R}^n$ if:
$L_f V(x) + L_g V(x) u \leq -cV(x)$
For a system $\dot{p} = u$ where we want to stabilize the position $p$ of a point at a desired location $p_d$.
We want to design a control input $u$ that drives $p$ towards $p_d$.
We then define:
Thus, $\dot{V}(p,u)=2(p-p_d)^\top u$ which links the control input $u$ to the rate of change of $V$.
Choosing a control input $u$ such that:
$u=-k(p-p_d)$ for some $k > 0$ ensures that $\dot{V} = -2k || p - p_d ||^2 \leq 0$
Which guarantees that $V(p)$ decreases exponentially over time, driving $p$ towards $p_d$ and stabilizing the system at the desired point.
A Control Barrier Function (CBF) is a scalar function that defines a safe set $\mathcal{C}$
within which the system’s state must remain to ensure safety.
We want $\mathcal{C}$ to be forward invariant, i.e., if the system starts or enters in $\mathcal{C}$, it remains in $\mathcal{C}$ for all future time.
A continuously differentiable function $h: \mathbb{R}^n \to \mathbb{R}$ is a CBF for
$\mathcal{C} = \{ x \mid h(x) \geq 0 \}$
Let $\alpha$ be an extended class-$\mathcal{K}$ function (continuous, strictly increasing, $\alpha(0)=0$).
$\alpha$ acts like a safety buffer: it limits how fast $h(x)$ can decrease,
so once the system is in the safe region, it is prevented from crossing the safety boundary.
Thus, if there exists $u \in \mathcal{U}$ such that:
$L_f h(x) + L_g h(x) u + \alpha(h(x)) \ge 0 \quad \forall x \in \mathcal{D} \supset \mathcal{C}$.
Then $\dot{h}(x,u) \ge -\alpha(h(x))$
For two agents $i, j$ with positions $p_i, p_j \in \mathbb{R}^d$, we define:
$h_{ij}(p) = || p_i - p_j ||^2 - D^2$ where $D$ is the minimum safe distance between them.
The safe set is: $\mathcal{C}_{ij} = \{ p \mid h_{ij}(p) \geq 0 \}$
Then we’ll compute the Lie Derivatives of $h_{ij}$ along $f$ and $g$ respectively:
$L_f h_{ij}(p) = 0$, $L_g h_{ij}(p)[u_i;u_j] = 2(p_i - p_j)^\top(u_i-u_j)$
To ensure collision avoidance, we need to find control inputs $u_i, u_j$ such that:
$2(p_i - p_j)^\top(u_i-u_j) + \alpha(h_{ij}(p)) \geq 0$
To get a control input that satisfies both CLF and CBF conditions,
in order to enforce both stability and safety,
we can use them as constraints in a quadratic optimization problem.
$\underset{u,s \ge 0}{\min} || u - u_{des} || + ws^2$
$s.t. \quad L_f V(x) + L_g V(x)u \leq -c V(x) + s$,
$L_f h_\ell(x) + L_g h_\ell(x) u + \alpha(h_\ell(x)) \ge 0 \quad \forall \ell$
Where:
The CLF is softened to ensure feasibility, while CBFs are enforced strictly to guarantee safety.
The QP is solved at each time step to compute the control input $u$ that balances stability and safety,
while minimizing deviation from the desired input.
Guarantees on transient behavior in safety-critical scenarios, e.g.: