# Integrated Design Methodology of Automated Guided Vehicles Based on Swarm Robotics
## 3 Integrated Methodology for Designing AGVs
### PHASE 2: ROS Implementation  
The Robotics Operating System (ROS) is the first large-scale robotics collaborative project that provides a time-saving computer toolset in the development of a robot, or robotic system [39]. The main idea for creating a swarm of robots on ROS is to create a decentralized communication system made up of a set of individual robots. These robots represent the nodes of the ROS system and a communication topic to subscribe and publish information between them. Figure 8 represents the interactions of swarm robots in the ROS environment.  
Figure 8: Interactions of swarm robots in the ROS environment.  
Figure 7: Component-Function allocations.  
To implement the model developed on ROS, the swarm designer creates a workspace made up of different packages which describe the swarm structure and the functions provided by each robot. For the organization of ROS packages, it is a good practice to group them together for functional consistency [40]. It is possible to do this as a workspace. Figure 9 shows an architecture of a swarm robot package.  
In this workspace, a'src' directory is created in which a package directory that contains the files of a package can be created [41]:  
* The **build** directory is used for building packages and as such contains all object files.
* The **devel** directory contains the executables and the libraries resulting from the compilation of the packages and, therefore, specified as a target in the CMakeLists.txt file.
* The **install** directory only contains files that are explicitly installed through the installation directives specified in the CMakeLists.txt file of the packages.
* **CMakeLists.txt**: The file indicating how to compile and install the package
* **package.xml**: The ROS file describing the identity of the package and its dependencies.
* A robot description language: **URDF** for Universal Robot Description Format is an XML specification describing the kinematics of a robot, its dynamic characteristics, its geometry, and its sensors.
* **WORLD** file: this file describes the work environment. It can correspond to the context diagram (BDD) which defines the SysML environment.
* A node as an executable file in ROS package: ROS nodes use a client library to communicate with other nodes. Nodes can subscribe or publish to topics. Nodes can use or provide a service. The client libraries are rospy for python and roscpp for C++. These ROS nodes contain the algorithms that translate the individual functions of the robots.
* **Launch** file: In this file, the developer must request the other files (urdf file, world file, cpp functions, etc.) and initialize the initial parameters of the system (swarm size, area, etc.) to describe the collective behaviors of swarm robots.
* The graphical interface **GAZEBO** represents the final 3D view of the swarm system.
* The last step of the proposed design approach is to validate the AGV design by checking all the design requirements. This step will be illustrated in the case study subject of the next section.  
Figure 9: Organization of the workspace of a swarm member in ROS.