Computer Simulation of a Group of Mobile Robots in Special Software Tools

The problem of controlling a group of special robots for application in the high-risk conditions (for example, for fire extinguishing, search for hazardous substances, or elimination of consequences of emergencies) is solved. According to the task, robots operate in the industrial and urban environment, i.e., the movement of robots is planar. Various strategies of group interaction between robots are analyzed; a literature review is conducted. Due to the task specifics, a decentralized management strategy has been selected. For solving the problem, a movement algorithm of a group of mobile robots with a subsequent visual check of the resulting algorithm operation is proposed. Implementation of the algorithm's work is performed in the MATLAB environment. For preliminary algorithm verification and modeling of various dangerous cases, a model of robot group using the Mobile Robotics Simulation Toolbox of MATLAB was made. For a more detailed and accurate analysis of the real robot’s behavior, a model in the ROS package has been developed. That model interacts with the developed algorithm through the ROS Toolbox package of MATLAB. This software can be used for the training of engineering staff in the field of mathematical modeling, group control, and multi-agent systems. As a result of verification, the program and the model successfully solve the task. Yet, the model in the ROS package requires greater computational power because of the large number of complex calculations.


Introduction
Robots are used in many fields of human activity, such as industrial production, zones of radioactive and chemical contamination, warfare conditions, and space exploration [1][2][3][4][5]. Mobile robots are taking an increasingly important role in the tasks handled by various departments, such as Emergencies Ministry, FSB, and others. Usage of robots allows us to solve problems of search and withdrawal of different hazardous substances, to perform complex technological operations, including those dangerous for people with minimal operator participation [1], [2][3][4][5][6].
In various researches, it is proved that the application of single robots can appear ineffective in solving complex problems. For such issues, it is required to use groups of cooperating robots [1], [2]. It is caused by if using robots in the group, the acting radius increases due to the distribution of robots in all operating zone. The number of possible executed operations can be increased by providing robots in a group with various equipment. Moreover, if one robot goes out of order, the rest can distribute tasks among themselves, then the task assigned to the group can be successfully fulfilled [5][6][7].
From the economic point of view, the serial production of robots for group work is more profitable than single production [1], [7][8].
However, the task of controlling a whole group of robots is more complicated than controlling a single one. Thus, the theory of group control of robots is at the stage of development and active research [1], [7][8][9].

Research objective
The objective of this work is:  Development and testing of visual mathematical models of a group of mobile robots operating in an urban industrial environment; To achieve the goal, it is necessary to solve the following problems:  selecting a strategy for group management;  selecting algorithms and their implementation for the motion task in the industrial and urban environment;  creating a model of a group of mobile robots in the Simscape Multibody package with the additional Mobile Robotics Simulation Toolbox for mobile robots;  creating a model of a group of mobile robots in ROS while interacting with the developed robot control system via ROS Toolbox add for MATLAB.
This work is conducted within grant No. 16-29-04178 of the Russian Foundation for Fundamental Research, "Development of algorithms for combining and jointly processing navigation and visual information in a group of heterogeneous robots." Assume that the operating area for mobile robots is obtained (e.g., with a UAV) (Fig. 1), and that the robot's initial locations are known, as well as the location of the target points for the robot to reach. There are no sudden changes in the operating zone, and the surface is flat. Such an environment is called industrial-city. The group management task with the optimization criteria as the shortest distance to each target point (i.e., each robot selects the nearest target) should be solved. The motion is planar, controlled by two coordinates and an angle. The robots move without sliding. Target points and the environment are stationary [1]. An example of the task implementation is the functioning of a group of mobile robots in a manufacturing facility or urban environment in case of emergency response, fire extinguishing, etc. Task provides characteristics of the operating area and the location of the target points (e.g., they were obtained by other reconnaissance robots).

Description of the main parts of the program to the task performance
Based on a literature review for a group of mobile robots moving in a complex environment, we decided to implement decentralized collective management of the group. When operating under the set conditions, one of the robots may be disabled, which is not critical for the selected control strategy [10][11][12]. Also, the task solved by each robot will be relatively simple, due to only optimizing its actions, and providing sufficient intellectual level of each robot is not difficult [12].
For solving the problem, we implemented the program in MATLAB for further visualization in Simscape Multibody and ROS. The program's algorithm is shown in Fig. 2 [1].

Area discretization
Area is divided into square samples, i.e., the operating zone is a grid or square matrix whose values contain information about the state of the corresponding square in the area [13].

Graph construction
It is known that the shortest trajectory on a plane with the obstacles is a fractured trajectory passing through obstacle corners [3,14]. Therefore, according to the known area plan, its model can be formed as a graph whose edges correspond to all straightways of motion and are weighted by their length, and the tops -by convex corners of obstacles. The initial and final location of the mobile robot should be defined on the graph. The points corresponding to the graph tops should be spaced away from the obstacles regarding the overall dimensions of the control object [15]. The problem of building a global trajectory is to find on the global graph the shortest path between the tops corresponding to the initial and final positions.
The tops of the graph are all free cells of the discrete area obtained earlier, and its edges are the possible directions of movement between them.

Determining the shortest distances
That subtask is solved using the Dijkstra algorithm. The Dijkstra algorithm is a graph algorithm that finds the shortest paths from one of the tops of the graph to all the others. The algorithm operates only for the graphs without negative weight ribs [16].
The search will be conducted for the first top (the robot's base point). And the shortest distances of interest will be the distances to the target points.

Distribution of targets for robots
The solution of this subtask based on an accelerated algorithm of collective goal distribution [1]. This algorithm is developed using an iterative procedure of collective action optimization.

Construction of a global trajectory of each robot in a group
A model for building a global trajectory for each robot based on specified control points (graph tops) of the route (Fig. 3) [18][19] was created in Simulink. For this task, we will use Simscape Multibody, which allows conducting simulation with physical laws in the environment [19].
On the upper part of the figure placed a robot's control system. On the input of block Chart from the Stateflow library enters the coordinates of points through which the robot should pass. The matrix of these coordinates is a result of operating the group control task program and is a regular variable matrix in MATLAB variable space. This block outputs the coordinates of the point the robot should reach. The CONTROL subsystem implements the primary control law of the robot, which is the calculation of the angle robot should turn to, and the distance robot should pass. These values are compared to the current values of angle and distance, and the control system ensures the matching of these values by issuing corresponding control actions on the model of the robot's wheels. After the pairing, outputs the next signal, which generates in the Chart block coordinates of the next point unless it is the endpoint of the matrix and trajectory.

Creating a local trajectory for each robot in the group
The global trajectory is only a recommended future trajectory and cannot be directly transferred to the executive system. The movement along the global trajectory should be done considering the situation in the local area surrounding the robot, which usually coincides with the vision system view area [1].

Model description
A special Mobile Robotics Simulation Toolbox [20] was developed in MATLAB to simulate work with tasks for mobile robots. The Toolbox contains specialized blocks for solving direct and inverse tasks of kinematics, as well as for modeling motion with different sensors. These units are represented various types of mobile robots, such as differential robots, robots with steering wheels, and Omni-wheels.
The obtained model as the blocks in the package is shown in Fig. 4. To simplify the task, a differential robot has been selected to increase the speed of simulation.
The Model contains blocks of the kinematic model of differential robot, distance sensor block (lidar), and two visualization blocks -on the Figure graphic, and for visualization in Simscape Multibody.
To ensure group interaction, an additional Chart block may be required, which will contain the coordinates of all robots in the group. According to the algorithm, the block will regulate group interaction. For example, when one robot goes out of order, its coordinates either do not change for a long time, or there is no signal. Then the nearest working robot to the target point of the broken one adds this target point to the matrix, calculating the route to it.

Example of the resulting model operation
A large number of experiments were conducted to verify the program's operation under the developed algorithm. To illustrate, we will consider an example of the program's operation for the case N=M, where N is the number of robots, and M is the number of target points. The program can also solve the task of group control, both for the case of N>M, and for N<M. Fig. 5. shows an example of an operating zone in which five robots are functioning. They are assigned for five targets.
The running program receives robots start points, map database, and coordinates of target points. The obtained coordinate matrixes are transmitted to the input of the Simulink model, where the motion is visually processed.
The blue contour area in the picture is the real objects in the room (walls, partitions), the red contour is the area enlarged by the robot dimensions, so the robot can be considered a material point when moving through such a mapping database.   Given example shows that the task of group control has been successfully solved, in particular at the given initial position and target points, mobile robots have performed movement between them, as shown by the model in Simscape Multibody.
For further development of engineering courses, it is possible to use the developed model for other numbers of robots and different types of mobile robots (for example, a robot with steering wheels or with Omni-wheels).

Model description
Model development is carried out in ROS on Linux using the Gazebo visualization package. The work is using interaction with the previously developed program in MATLAB. Interaction is provided with the kit for MATLAB ROS Toolbox [21].
Robot models in ROS are initially described in the *.urdf file, where described blocks: visual (visual characteristics), collision (friction and object interaction area), inertial (inertial characteristics of the robot). Combinations of the robot's components are carried out through blocks joint. The file containing all the mentioned components is described in xml language [22][23].
Initial visualization of the resulting robot based on the urdf file is performed in rviz package. It allows to verify the physical model and to set up interaction with different sensors (camera, lidar, gyroscope, etc.). Examples of robots in the rviz package are shown in Fig.7.   Fig. 7. Models of mobile robots in the rviz package.
The rviz package is only a means of visualizing the model, not a means of simulating or motion modeling. For these purposes, the standard gazebo package is required.
To run all necessary files in gazebo, launch files are required. They describe all the required data to create a working space. They also specify the type of map, the necessity to visualize sensors' actions, the location and orientation of the robot, and various other options for setting up [23]. An example of a launch file for one robot is shown on Fig. 8.
An example of placing a robot in the gazebo is shown in Fig. 9.
For interaction with the obtained model, ROS uses the addition of MATLAB ROS Toolbox. ROS is forming data of positioning in the /state_robot and transferring them to MATLAB. Then from the model to Simulink, data about necessary movements are transferred to the /cmd_vel, which is perceived by the gazebo robot model. A scheme in MATLAB is shown in Fig. 10.
For further work with engineering courses, it is possible to create other types of mobile robots by upgrading urdf files, launch files, and models of attachments.

Example of the resulting model operation
The model is in the final stage of debugging. The general algorithm of motion and interaction between MATLAB and ROS is executed, and the full visual part of walls and marks of initial and endpoints will be completed in the future.
An example of the location of 3 robots for motion is shown in Fig. 11.

Conclusion
This work conducted a study of group management algorithms, and for the task was chosen decentralized management strategy. For verification of the correctness of the group control task, a mathematical model of a group of robots in the industrial city environment was constructed for visual evaluation.
The first model was compiled in MATLAB with Mobile Robotics Simulation Toolbox. It shows high accuracy and speed of modeling and is entirely suitable for the task.
The second model is made in ROS, which connects via ROS Toolbox with a previously written program in MATLAB. This model considers a larger number of possible physical features and is more realistic. But when operating, it shows low modeling speed. The model is very complex and needs further improvement.
The received program complex with modifications for specific tasks can be used for the visual decision-making process for a group management task in the industrial and city environment at the research of various objects of interest, and also for liquidation of consequences of multiple accidents in the conditions of the severe danger for the person.
Also, based on this material, it is possible to create a large number of training courses, advanced courses, etc. This course will be useful for specialists in the field of robotics, automatic control systems, simulation of complex technical systems, etc. Modernization is simple, and the number of possible areas is vast. Such courses do not require specialized software, except MATLAB and ROS package on Linux.