## 4 Consensus Algorithm for Optimal Obstacle Avoidance
The following lemma is established for proving both the asymptotic stability and optimality of the obstacle avoidance consensus algorithm. **Lemma 1**. : _A nonlinear controlled dynamical system [20] is modeled as_  
\[\dot{\mathbf{X}}(\mathbf{t})=\mathbf{f}\big{(}\mathbf{\dot{X}}(\mathbf{t}),\mathbf{U}(\mathbf{t})\big{)}, \ \mathbf{\dot{X}}(\mathbf{0})=\mathbf{\dot{X}}_{\mathbf{0}},\mathbf{t}\geq\mathbf{0}, \tag{12}\]_where \(\mathbf{f(0,0)=0}\) and the cost function is_  
\[J\big{(}\hat{X}_{0},\mathbf{U}(\cdot)\big{)}\triangleq\int_{0}^{\infty}T(\hat{X}(t), \mathbf{U}(t))dt. \tag{13}\]  
In Equation (13), \(\mathbf{U}(\cdot)\) denotes an admissible control. The open sets are defined as \(\mathbf{D}\in\mathbb{R}^{n}\) and \(\mathbf{\Omega}\in\mathbb{R}^{m}\). Moreover, the continuous differentiable function \(\mathbf{V}:\mathbf{D}\to\mathbb{R}\) and control law \(\phi:\mathbf{D}\to\mathbf{\Omega}\) exist. Thus,  
\[\mathbf{V}(\mathbf{0}) =\mathbf{0} \tag{14}\] \[\phi(\mathbf{0}) =\mathbf{0}\] (15) \[V\big{(}\hat{X}\big{)}>0,\hat{X}\in\mathbf{D},\hat{X}\
eq\mathbf{0}\] (16) \[V\big{(}\hat{X}\big{)}f(\hat{X},\phi(\hat{X}))<0,\hat{X}\in\mathbf{D},\hat{X}\
eq\mathbf{0}\] (17) \[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]0 (18) \[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]1  
In Equation (19), \(\mathbf{H}(\hat{X},\mathbf{U})\triangleq\mathbf{T}(\hat{X},\mathbf{U})+\mathbf{V}^{\prime}(\hat{ X})f(\hat{X},\mathbf{U})\) is the Hamiltonian function and \({}^{\prime}\) indicates partial differentiation with respect to \(\hat{X}\). The state feedback control law has the following form:  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]2  
The solution \(\hat{X}(t)\equiv\mathbf{0}\) of the closed-loop system is locally asymptotically stable and it has a neighborhood with the origin \(\mathbf{D_{0}\subset D}\); thus,  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]3  
Moreover, if \(\hat{X}_{0}\in\mathbf{D_{0}}\), the feedback control \(\mathbf{U}(\cdot)=\phi(\hat{X}(\cdot))\) minimizes \(\mathbf{J}(\hat{X}_{0},\mathbf{U}(\cdot))\) so that  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]4  
where \(S(\hat{X}_{0})\) represents the set of asymptotically stabilizing controllers for each initial condition \(\hat{X}_{0}\in\mathbf{D}\). Finally,  
if \(\mathbf{D}\in\mathbb{R}^{n}\), \(\mathbf{\Omega}\in\mathbb{R}^{m}\), and  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]5  
the solution \(\hat{X}(t)\equiv\mathbf{0}\) of the closed-loop system is globally asymptotically stable. **Proof. ** Omitted. See reference [23]. \(\square\)  
This lemma emphasizes that the steady-state solution of the Hamilton-Jacobi-Bellman equation is a Lyapunov function for the nonlinear system, thereby ensuring the stability and optimality of the system. The following theorem expresses the main result of this study. **Theorem 1. **_For a system of MAUVs (3) that is established by the three hypotheses with parameters \(\mathbf{w_{p}}\) and \(\mathbf{w_{c}}\), the feedback control law in which_  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]6  
_is an optimal control for the consensus problem (7) with \[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]7  
_in Equation (9)._  
In Equation (25), the potential obstacle avoidance function \(g(\hat{X})\) is defined as  
\[\mathbf{R}_{1}=\mathbf{w}_{\mathbf{c}}^{2}\mathbf{I}_{\mathbf{n}}\otimes\mathbf{I}_{\mathbf{m}} \tag{9}\]8  
Furthermore,  
\[m(x_{i})=