## 3 Methods
### Cascade Leader-Follower Structure  
The leader-follower structure is a frequently used method for formation control for groups of robots. The \(l-\varphi\) method, which controls the followers to keep desired distances and bearing angles to the leader, can be represented as:  
\[\begin{cases}\lim_{t\to\infty}[l(t)-l^{d}]&=0\\ \lim_{t\to\infty}[\varphi(t)-\varphi^{d}]&=0\end{cases} \tag{7}\]  
where \(l^{d}\) and \(l(t)\) are desired and current distances to the leader respectively; and \(\varphi^{d}\) and \(\varphi(t)\) are the desired and current bearing angles to the leader, respectively. In our case, one cannot see the leader all the time. Consequently, instead of following the leader, we make the members form the desired formation by following a particular agent in the v-TVCS with the assistance of simple communications.  
To cope with this task, the swarm leader, which defines the reference frame for the others, must first broadcast its heading direction. Other members in leader's v-TVCS will receive this message, combine it with other state messages and then rebroadcast it in their v-TVCS again. Since we aim at building a V-shape formation, this means the leader will divide the swarm into two parts: the left part and the right part. As shown in Figure 4, the desired bearings for the two parts are different. The angle of the formatted V-shape formation is \(\gamma\), members of the left part will keep the relative bearing angle to the leader or closest right top member with the same role of \(-\gamma/2\), while the right part will keep the desired bearing between the leader or closest left top member with the same role of \(\gamma/2\). Because the desired bearings are different for the two parts, the messages communicated between swarm members should be the received leader's heading, the agent's own heading, and the role of which part it belongs. At the initial stage, if one can see the leader, it is able to determine the part role by evaluating the initial  
Figure 3: Finite state machine of designed behavior based approach.  
leader bearing minus the heading error with the leader. Otherwise, if the leader is not in one's field of view, it will synchronize its role from the broadcasting of the closest member in its v-TVCS.  
In the case a member cannot see anyone in its visual field, it will search others by rotating with a certain forward speed with turning. Thus, the actions in \(S_{1}\) can be simply defined as:  
\[\begin{cases}v=v_{r}\\ \omega=\omega_{r}\end{cases} \tag{8}\]  
where \(v_{r}\in(0,v_{max})\) and \(\omega_{r}\in(0,\omega_{max})\) are random forward speed and turn speed, respectively.  
Figure 5 shows the relationship with leader and follower. According to Equation (1), the kinematic equations for follower \(i\) are established:  
\[\begin{cases}\Delta l=v_{i}\cos(\theta)-v_{l}\cos\varphi+d\omega_{i}\sin( \theta)\\ \Delta\varphi=\frac{1}{l}(v_{l}\sin\varphi-v_{i}\sin(\theta)+d\omega_{i}\cos( \theta)-l\omega_{l})\\ \Delta\alpha_{i}=\omega_{i}\end{cases} \tag{9}\]  
where \(\alpha_{i}\) is the heading error with the leader, \(\theta=\varphi+\alpha_{i}\). On the other hand, according to the feedback control law, we have:  
\[\begin{cases}\Delta l=k_{l}(l_{d}-l)\\ \Delta\varphi=k_{\varphi}(\varphi_{d}-\varphi)\end{cases} \tag{10}\]  
where \(k_{l}\) and \(k_{\varphi}\) are feedback coefficients.  
By combining Equations (9) and (10), we can get the control inputs for formation:  
\[\begin{cases}\omega_{i}=\frac{\cos\theta}{d}[k_{\varphi}l(\varphi_{d}-\varphi) -v_{l}\sin\varphi+l\omega_{l}+p\sin\theta]\\ v_{i}=p-d\omega_{i}\tan\theta\end{cases} \tag{11}\]  
where \(p=v_{l}\cos\varphi+k_{l}(l_{d}-l)/\cos\theta\).  
Figure 4: Desired bearing angle of two parts.