# Multi-Layered Interactive Target Guidance with Visual Safety in Convex-Shaped Obstacle Environments
## 3 Safety Layer for Visual Safety
### Visual Safety  
Finally, a controller is considered to guarantee visual safety. Given the nominal velocity for the camera robot \(V^{b}_{wc,nom}\) in (20), the following optimization problem is considered:  
\[V^{b}_{wc,opt} =\operatorname*{argmin}_{V^{b}_{wc}\in\mathbb{R}^{6}} \|V^{b}_{wc}-V^{b}_{wc,nom}\|^{2}\] (42a) subject to \[V^{b}_{wc}\in K_{fov}\cap K_{occ,k},\;\;\forall k=1,\dots,n_{ \mathcal{O}}. \tag{42b}\]  
Note that the cost function is a quadratic form. In addition, as will be confirmed later, the constraint (42b) is expressed as linear inequalities in terms of \(V^{b}_{wc}\). Therefore, the optimization problem is a QP problem. This implies that this optimization problem belongs to a class that allows for rapid solution computing, enabling real-time implementation of this controller. On the other hand, to obtain \(l_{c,k}\) and \(l_{o,k}\) used in the function \(h_{occ,k}\), it is necessary to find the nearest points between the obstacle, the robot, and the target object. Although nearest neighbor searches are generally time-consuming processes, for \(l_{c,k}\), an approximate value can be obtained quickly by using the depth information from the RGB-D sensor (By using a LiDAR sensor, it is possible to overcome the limited field of view of an RGB-D sensor. Sensor fusion of an RGB camera or RGB-D camera with LiDAR can make the implementation of the proposed method easier.). The block diagram of safety layer is presented in Figure 5. The QP block regulates inputs in a minimally invasive way to ensure visual safety by solving the QP problem in (42). If the QP block does not change the input, \(g_{co}(t)\) converges to the target trajectory \(g_{nav}(t)\)[31]. If the state-dependent admissible input set \(K_{for}\cap K_{occ,k}\) in (42b) becomes empty for some \(x_{pe}\in\mathcal{D}_{for}\cap\mathcal{D}_{occ}\), the existence of the optimal solution of (42) will no longer be guaranteed. The admissible input set \(K_{for}\cap K_{occ,k}\) depends not only on the poses \(g_{uo}\) and \(g_{uv}\) but also on the arrangement of obstacles, making it difficult to analyze the admissible input set. In this context, \(K_{for}\cap K_{occ,k}\) is considered in a situation with only one obstacle. In this case, the following result is obtained. Proposition 3: _Suppose that \(n_{\mathcal{O}}=1\), and the parameters of the pursuit-evasion system (5)-(7) and the control barrier functions \(h_{\text{fov}}\) and \(h_{\text{occ},k}\) satisfy_  
\[\frac{3\sqrt[3]{4k_{c}}}{4} \geq v_{max}+\sqrt{\Delta_{for}}, \tag{43}\] \[\Delta_{for} >\gamma. \tag{44}\]  
_Then, the admissible input set \(K_{for}(x_{pe})\cap K_{occ,k}(x_{pe})\) is not empty for any \(x_{pe}\in\mathcal{D}_{for}\cap\mathcal{D}_{occ,k}^{\gamma}\)._  
Proof: From (32) and (37), the elements of \(K_{for}\cap K_{occ,k}\) are the input \(V_{uc}^{b}=[(v_{wc}^{b})^{T}(\omega_{wc}^{b})^{T}]^{T}\) that satisfy the following inequalities:  
\[2p_{co}^{T}(e^{\delta\theta_{ox}}v_{wo}^{b}-v_{wc}^{b}-\hat{ \omega}_{wc}^{b}p_{co})\geq-2h_{for}, \tag{45}\] \[\left(\mathbf{e}_{c,k}+\left(1-\frac{\gamma}{\|p_{co}\|^{2}} \right)\mathbf{e}_{co}\right)^{T}e^{\delta\theta_{av}}v_{uc}^{b}+\left( \mathbf{e}_{o,k}-\left(1-\frac{\gamma}{\|p_{co}\|^{2}}\right)\mathbf{e}_{co} \right)^{T}e^{\delta\theta_{av}}v_{wo}^{b}\geq-h_{occ,k}. \tag{46}\]  
First, a controller that satisfies (45) is considered. To this end, let \(\mathbf{u}_{Tp}\) be a unit vector so that it is orthogonal to \(\mathbf{e}_{co}\) and decompose \(Tp_{co}\) into  
\[Tp_{co}=(Tp_{co})^{T}e^{-\hat{\xi}\theta_{av}}\mathbf{e}_{co}e^{-\hat{\xi} \theta_{av}}\mathbf{e}_{co}+(Tp_{co})^{T}e^{-\hat{\xi}\theta_{av}}\mathbf{u}_{ Tp}e^{-\hat{\xi}\theta_{av}}\mathbf{u}_{Tp}. \tag{47}\]  
Figure 5: The block diagram of the safety layer.