# An Aquatic Mobile Sensing USV Swarm with a Link Quality-Based Delay Tolerant Network
## 3 Proposed Architecture
### Network Elements
The USV software architecture, described in a hierarchical structure, is presented in Figure 5. The structure consists on three major layers, i.e., Path Planning Layer, Communication Layer, and Sensors and Actuators Layer, all implemented in ROS. The Path Planning Layer plans a feasible trajectory for the USV based on the general state of the mission. The mission, generally, can be a set of interest points to be visited and sensed by the swarm. A trajectory is defined by a set of waypoints from the USV's current position to the interest point. Since each USV is traveling in a dynamic environment, path re-planning is also needed to avoid moving obstacles, such as other USVs, and to switch destination points in order to maintain connectivity or to be more efficient at sensing all the interest points. Cooperative behavior for path planing is vital, and each USV should establish communication to ensure that it has all the swarm's navigation information. This task is handled by the Communication Layer. This layer is responsible for exchanging packets between all nodes and also the stations in the infrastructure. Generated paths will then be passed to the Sensors and Actuators Layer to calculate specific control commands for the USV. In more detail, a brief description of each module in the USV is described below:  
* **Navigation Data Acquisition:** This module is responsible for the update and synchronization of the swarm's navigation information given by the Communication Layer. Only the newest messages should be allowed to change position values, leading to less noise. This module is also responsible for updating the map using sensor fusion. Figure 4: Block diagram of the USV. * **Cooperative Path Planning:** This module manages the allocation of new sensing points, and calculates the trajectory avoiding obstacles on the map. The trajectory should be optimized in terms of total distance, connectivity constraints, and navigation time. The path planning algorithm can be viewed as a multiple traveling salesmen problem, and uses a _follow me_ approach, where each USV has to maintain connection with only one vehicle with a higher priority. Each USV only has to follow one vehicle and can only be followed by one vehicle. The Path Planning algorithm should maintain the connection of all the USVs in the swarm, so the swarm can be synchronized while performing a task. If one USV goes away from the swarm, another vehicle has to follow to maintain the connection between the swarm and this USV. When a USV stops communicating to the swarm, the lower priority USV drops its task and goes to the last location known of that vehicle. In a worst case scenario, all USVs' trajectories can be affected, and the swarm starts adjusting the trajectory to follow this USV to maintain connectivity. If, for some reason, the USV has no longer connectivity with the swarm, the packets are stored until new connections are established. At that time, if the packet reaches the expiration date, then the packet is deleted. This module and the rationale behind the swarm control and navigation are still under development. In this work we have decided to focus on the evaluation of communication strategies in an aquatic sensing platform formed by moving USVs. After each allocation of a new target, this module passes this information to the communication layer to be transmitted to other USVs, using the neighbors' announcements. * **Trajectory Modification in Real Time:** This module is responsible for changing the trajectory to the assigned target when it is necessary to deviate from some mobile obstacle, or to maintain network connectivity. The avoidance of moving obstacles is made by integrating the on board sensors' information and the shared positions. By fusing these data, we can reduce the noise of this information. This module is also responsible for communicating the next waypoint to the software structure shown in Figure 1 contemplated within the Thruster Controller module.