This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

ROS-Based Multi-Agent Systems COntrol Simulation Testbed (MASCOT)

Arvind Pandit, Akash Njattuvetty, and Ameer K. Mulla Arvind Pandit and Ameer K. Mulla are with the Department of Electrical Engineering, Indian Institute of Technology Dharwad, Karnataka, India. Email: arvind.pandit.21@iitdh.ac.in, ameer@iitdh.ac.inAkash Njattuvetty is with the Department of Electrical Engineering, Indian Institute of Technology Madras, Chennai, India. Email: akashn2772@gmail.com
Abstract

This paper presents a simulation testbed developed for testing and demonstration of decentralized control algorithms designed for multi-agent systems. Aimed at bridging a gap between theory and practical deployment of such algorithms, this testbed provides a simulator with multi-agent systems having quadcopter agents. It is used to test the control algorithms designed assuming simple agent dynamics like a single or double integrator. This is based on the fact that under certain assumptions, quadcopter dynamics can be modeled as a double integrator system. A gazebo simulator with a physics engine as ODE (Open Dynamics Engine) is used for simulating the dynamics of the quadcopter. Robot Operating System is used to develop communication networks and motion control algorithms for the different agents in the simulation testbed. The performance of the test bed is analyzed by implementing linear control laws such as position control, leaderless consensus, leader-follower consensus, and non-linear control law for min-max time consensus. This work is published as an open-source ROS package under MIT license at https://github.com/Avi241/mascot. A docker image is also developed for easy setup of the system.

I Introduction

Distributed control of multi-agent systems has been a very active area of research over the last couple of decades, starting from the asymptotic consensus laws proposed in [1], various distributed control laws for finite-time consensus [2], formation control [3], trajectory tracking [4], applications like survey, search and rescue [5], non-cooperative tasks like pursuit-evasion [6] etc. The primary reason for the popularity of multi-agent systems is that multi-agent systems are much more capable than individual agents and can achieve complex objectives using simple agents. Most of such control algorithms are designed assuming simple dynamics of agents, for example, single integrator, double integrator [7], non-holonomic Dubin’s vehicle model, etc. These agent models are popular mainly because the dynamics of various robots and autonomous vehicles, under a few assumptions, may be simplified to such models.

With the developments in the field of robotics and communication, Unmanned Aerial and Ground Vehicles (UAVs and UGVs) are being used in various applications related to agriculture [8], disaster response [9], crowd monitoring, event monitoring, and recording [10] and so on. While UGVs and fixed-wing UAVs are used for certain specific applications, quadcopters are used more widely due to their advantages such as high maneuverability, 6-DoF, easy availability, etc[11]. These advantages make the quadcopters suitable for deploying multi-agent co-operative control algorithms in the testing stage. In most cases, even though multiple quadcopters are used, their control is either centralized or each agent is controlled independently.

The use of distributed control can potentially increase the capabilities and efficiency of multi-agent systems. However, such control laws are seldom used, primarily because of the problems encountered during deploying the control algorithms on physical systems. Even though it is shown that quadcopter dynamics can be approximated to a double integrator, before deploying the control laws designed for double-integrator on quadcopters [12], it is essential to ensure that the simplifying assumptions are satisfied by the actual system and the control parameters need to be tuned appropriately. Extensive simulations are necessary for appropriate tuning of the controllers before actual deployment on physical systems to ensure that the systems remain stable and the controller will work as desired. A good testing platform with a simple user interface can address this problem. MASCOT is designed to be such a testing platform. In the current version, MASCOT uses quadcopters as agents to simulate multi-agent systems. The lower-level controllers of the quadcopters are tuned so that the user can consider the agents to have double integrator dynamics in the primary directions and test the control algorithms. By adjusting the control parameters of the lower-level controllers, practical scenarios like relaxing the assumptions may be created.

There are few MATLAB-based quadcopter simulators that are either for the single quadcopter or lack the environmental dynamics and visuals[13]. MATLAB provides a few toolboxes which help for testing the algorithms but there are limitations of MATLAB such as inter-process communications, physical dynamics, code porting from simulation to hardware, etc. Some authors have demonstrated the control algorithms using realistic simulation environments and /or hardware test-beds. [12, 14]. However, these efforts are limited to specific control algorithms and are not easily accessible to other researchers. Moreover, such hardware testbeds come with physical limitations such as a number of agents, space, cost, as well as the potential risk of damage to the vehicles and the surroundings.

MASCOT is developed using open-source software, the Robot Operating System (ROS) [15] and Gazebo. Gazebo with its ODE (Open Dynamics Engines) provides a simulation environment with various real-world physical dynamics such as collision, gravity, mass, inertia, wind effects, and many more which are very tedious to configure in MATLAB. Moreover, ROS supports low-level drivers and programming in C++, making it very convenient to directly deploy the simulation codes on physical systems, which are not straightforward in MATLAB. ROS also provides a rich set of open-source packages for different applications which helps researchers to modify and use the code as per their needs. MASCOT retains all of the advantages of ROS while simplifying the user interface by providing simple text files for configuring the agents and control laws for simulations. While this paper describes the simulations of multi-agent systems with double integrator agents, simulating systems with single integrator agents, non-holonomic agents and heterogeneous systems are equally easy on MASCOT.

The rest of the paper is organized as follows. In Section II, we discuss the quadcopter dynamics. Section III describes the structure and features of the designed simulation testbed along with the tools used in the development. In Section IV, various use cases of the testbed are discussed with the simulations carried out using MASCOT. We conclude in V with some remarks on the applications and future developments planned for the test-bed.

II Preliminaries

In this section, first, we describe the preliminaries of the dynamics of a quadcopter and review how a quadcopter can be represented using double integrator dynamics. A few preliminaries used in distributed control of multi-agent systems are also discussed.

II-A Frame of References

Figure 1 shows the standard definitions [16] of the reference frames used in this simulation. {E}\{E\} is the Earth reference frame having its zz-axis facing upward in the space. The body coordinate frame, {B}\{B\} is attached to the center of the quadcopter having its zz-axis facing downwards in the space. {B}\{B^{\prime}\} reference frame is attached to the body having its origin same as {B}\{B\} and xByBx^{B^{\prime}}y^{B^{\prime}} plane is parallel to xEyEx^{E}y^{E}.

Refer to caption
Figure 1: Quadcopter reference frames setup

The angles θp\theta_{p} (pitch), θr\theta_{r} (roll), and θy\theta_{y} (yaw) represents the rotation of the body along xx, yy, and zz-axis of the reference frame respectively. As xByBx^{B^{\prime}}y^{B^{\prime}} plane is parallel to xEyEx^{E}y^{E} thus {B}\{B^{\prime}\} can only rotate along the z-axis with angle θp\theta_{p}. The change in orientation between {B}\{B^{\prime}\} and {E} is given by a rotation matrix

𝐑BE=[cθysθy0sθycθy0001]\mathbf{R}_{B^{\prime}}^{E}=\begin{bmatrix}c\theta_{y}&s\theta_{y}&0\\ -s\theta_{y}&c\theta_{y}&0\\ 0&0&1\end{bmatrix}

where c(.)cos(.)c(.)\coloneqq\cos{(.)} and s(.)sin(.)s(.)\coloneqq\sin{(.)}

II-B Quadcopter Dynamics

The upward thrust along the zB-z^{B} axis is given by

Ti=bω¯i2T_{i}=b\bar{\omega}_{i}^{2}

where ωi\omega_{i} is the angular velocity of the rotor and b>0b>0 is a lift constant that depends on the air density, number of blades, cube of rotor blade radius, and chord length of the blade. According to Newton’s second law of motion, the translation dynamics of the quadcopter in {E}\{E\} is given by

m𝐯˙E=[00mg]T𝐑BE[00T]TB𝐯m\dot{\mathbf{v}}^{E}=\begin{bmatrix}0&0&mg\end{bmatrix}^{T}-\mathbf{R}_{B}^{E}\begin{bmatrix}0&0&T\end{bmatrix}^{T}-B\mathbf{v} (1)

where 𝐯\mathbf{v} is the velocity of quadcopter in {E} given by 𝐯=[vxEvyEvzE]T3\mathbf{v}=\begin{bmatrix}{v_{x}}^{E}&{v_{y}}^{E}&{v_{z}}^{E}\end{bmatrix}^{T}\in\mathbb{R}^{3} , BB is aerodynamics friction and T=ΣTiT=\Sigma T_{i} is total upward thrust generated by the rotors in zB-z^{B} direction, gg is the gravitational acceleration, and mm is the mass of quadcopter. In (1), first term represents the gravitational force acting in zE-z^{E} direction, second term represents the total upward thrust generated in zB-z^{B} direction in {B}\{B\} and rotated in {E}\{E\}.

The rotation in each axis is obtained by varying pairwise differences in rotor thrust. Torque about xx and yy axes is given by

τx=dT4dT2=db(ω¯42ω¯22)\tau_{x}=dT_{4}-dT_{2}=db(\bar{\omega}_{4}^{2}-\bar{\omega}_{2}^{2})
τy=dT1dT3=db(ω¯12ω¯32)\tau_{y}=dT_{1}-dT_{3}=db(\bar{\omega}_{1}^{2}-\bar{\omega}_{3}^{2})

The torque applied to each motor is opposed by aerodynamic drag and exerts a reaction torque on the frame which is given by Qi=kω¯iQ_{i}=k\bar{\omega}_{i} where kk depends on the same factors as bb. The total reaction torque about zz-axis is given by

τz=Q1Q2+Q3Q4=k(ω¯12+ω¯32ω¯22ω¯42)\tau_{z}=Q_{1}-Q_{2}+Q_{3}-Q_{4}=k\left(\bar{\omega}_{1}^{2}+\bar{\omega}_{3}^{2}-\bar{\omega}_{2}^{2}-\bar{\omega}_{4}^{2}\right) (2)

The total torque applied to the quadcopter body is 𝚪=[τxτyτz]\mathbf{\Gamma}=\begin{bmatrix}{\tau}_{x}&{\tau}_{y}&{\tau}_{z}\end{bmatrix}. By Euler’s equation of motion rotational acceleration is given is by

J𝝎˙=𝝎×J𝝎+𝚪J\bm{\dot{\omega}}=-\bm{\omega}\bm{\times}J\bm{\omega}+\mathbf{\Gamma} (3)

where J is the 3×33\times 3 inertia matrix of the quadcopter and ω\omega is a angular velocity vector of the quadcopter body frame. Overall quadcopter motion equation [16] is obtained by integrating equations (1) and (2) which is given by

[𝐓𝚪]T\displaystyle\begin{bmatrix}\mathbf{T}&\mathbf{\Gamma}\end{bmatrix}^{T} =A[ω¯12ω¯22ω¯32ω¯42]T\displaystyle=A\begin{bmatrix}\bar{\omega}_{1}^{2}&\bar{\omega}_{2}^{2}&\bar{\omega}_{3}^{2}&\bar{\omega}_{4}^{2}\end{bmatrix}^{T} (4)

where A=[bbbb0db0dbdb0db0kkkk]A=\begin{bmatrix}-b&-b&-b&-b\\ 0&-db&0&db\\ db&0&-db&0\\ k&-k&k&-k\end{bmatrix} is a constant invertible matrix since b,k,d>0b,k,d>0.

II-C Quadcopter Dynamics as Double Integrators

The overall motion in the plane xByBx^{B^{\prime}}y^{B^{\prime}} is obtained by pitching and rolling the quadcopter by an angle θp\theta_{p} and θr\theta_{r}. The total force acting on a quadcopter is given by

𝐟B=𝐑x(θr)𝐑y(θp)[00T]T\mathbf{f}^{B^{\prime}}=\mathbf{R}{x}\left(\theta{r}\right)\mathbf{R}{y}\left(\theta{p}\right)\begin{bmatrix}0&0&T\end{bmatrix}^{T} (5)

where,

𝐑x(θr)=[1000cθrsθr0sθrcθr],𝐑y(θp)=[cθp0sθp010sθp0cθp]\displaystyle\mathbf{R}{x}\left(\theta{r}\right)=\begin{bmatrix}1&0&0\\ 0&c\theta_{r}&s\theta_{r}\\ 0&-s\theta_{r}&c\theta_{r}\end{bmatrix},~{}\mathbf{R}{y}\left(\theta{p}\right)=\begin{bmatrix}c\theta_{p}&0&s\theta_{p}\\ 0&1&0\\ -s\theta_{p}&0&c\theta_{p}\end{bmatrix}

are the Rotation matrix about xx and yy axes respectively.
Simplifying (5) we get 𝐟B\mathbf{f}^{B^{\prime}} as

𝐟B=[TsinθpTsinθrcosθpTcosθrcosθp]T\mathbf{f}^{B^{\prime}}=\begin{bmatrix}T\sin{\theta_{p}}&T\sin{\theta_{r}}\cos{\theta_{p}}&T\cos{\theta_{r}}\cos{\theta_{p}}\end{bmatrix}^{T}

for small θp\theta_{p} and θr\theta_{r} the above equation can be approximated by

𝐟B[TθpTθrT]T\mathbf{f}^{B^{\prime}}\approx\begin{bmatrix}T\theta_{p}&T\theta_{r}&T\end{bmatrix}^{T}

i.e fxBTθpf_{x}^{B^{\prime}}\approx T\theta_{p} and fyBTθrf_{y}^{B^{\prime}}\approx T\theta_{r}
According to Newton’s Second law of motion F=maF=ma, we can write

maxB=Tθpma_{x}^{B^{\prime}}=T\theta_{p}
θp=mTaxB,θr=mTayB\theta_{p}=\dfrac{m}{T}a_{x}^{B^{\prime}},~{}~{}\theta_{r}=\dfrac{m}{T}a_{y}^{B^{\prime}}

where axBa_{x}^{B^{\prime}} is ayBa_{y}^{B^{\prime}} is acceleration of quadcopter in {B}\{B^{\prime}\} frame.
As the controller will receive the position and velocity in {E}\{E\} frame so it will compute the acceleration in {E}\{E\} frame which needs to be rotated to the {B}\{B^{\prime}\} frame.

𝐟B=𝐑EB𝐟𝐄\mathbf{f}^{B^{\prime}}=\mathbf{R}_{E}^{B^{\prime}}\mathbf{f^{E}}
m𝐚B=𝐑EBm𝐚𝐄m\mathbf{a}^{B^{\prime}}=\mathbf{R}_{E}^{B^{\prime}}m\mathbf{a^{E}}
𝐚B=𝐑EB𝐚𝐄\mathbf{a}^{B^{\prime}}=\mathbf{R}_{E}^{B^{\prime}}\mathbf{a^{E}}

This equation shows the motion of the quadcopter in xByBx^{B^{\prime}}y^{B^{\prime}} plane.

Remark 1

While the discussion above describes the motion of the quadcopter in xByBx^{B^{\prime}}y^{B^{\prime}} plane as a double integrator, motion along zB-z^{B^{\prime}} is directly dependent on the thrust generated by the rotors in {B} frame given by T=ΣTiT=\Sigma T_{i}, which is naturally a double integrator.

II-D Preliminaries of Distributed Control

A homogeneous multi-agent system is a collection of nn agents with identical dynamics communicating with each other over a communication graph 𝒢=(𝒱,)\mathcal{G}=(\mathcal{V},\mathcal{E}), where the set of vertices 𝒱={αi,i=1,,n}\mathcal{V}=\{\alpha_{i},~{}i=1,...,n\} represents the agents and the edges (αi,αj)(\alpha_{i},\alpha_{j})\in\mathcal{E} denote the communication from agent αi\alpha_{i} to αj\alpha_{j}. The communication graph 𝒢\mathcal{G} is undirected if (αi,αj)(αj,αi)(\alpha_{i},\alpha_{j})\in\mathcal{E}\implies(\alpha_{j},\alpha_{i})\in\mathcal{E} otherwise it is directed. A path in a graph is a sequence of edges. An undirected graph is said to be connected if it has a path from each agent to every other agent. A directed graph is said to contain a directed spanning tree if there is an agent αr\alpha_{r} (called root) such that there is a directed path from αr\alpha_{r} to every other agent. Set of neighbours for each agent is given by 𝒩i:={j𝒱:(αi,αj)}\mathcal{N}_{i}:=\{j\in\mathcal{V}:(\alpha_{i},\alpha_{j})\in\mathcal{E}\}. The Laplacian matrix \mathcal{L} of a graph 𝒢\mathcal{G} is given by n=[lij]n×n;lij=aij,ij,lii=j=1,jinaij\mathcal{L}_{n}=\left[l{ij}\right]\in\mathbb{R}^{n\times n};l_{ij}=-a_{ij},i\neq j,l_{ii}=\sum_{j=1,j\neq i}^{n}a_{ij}, where aija_{ij} is the weight of the edge (αi,αj)(\alpha_{i},\alpha_{j}). Some control algorithms use leader-follower configuration of the multi-agent systems in which, the set of agents is divided into a set of leader 𝐋\mathbf{L} and a set of followers 𝐅\mathbf{F}.

In this paper, agents are assumed to have double-integrator dynamics, given by

𝐱¨iE(t)=𝐟iE(t)\ddot{\mathbf{x}}_{i}^{E}(t)=\mathbf{f}_{i}^{E}(t) (6)

where 𝐱iE=[𝐩iE𝐯iE]2d\mathbf{x}_{i}^{E}=\begin{bmatrix}\mathbf{p}^{E}_{i}\\ \mathbf{v}^{E}_{i}\end{bmatrix}\in\mathbb{R}^{2d} is the state vector of αi\alpha_{i} and 𝐟iEd\mathbf{f}^{E}_{i}\in\mathbb{R}^{d} denotes the input to αi\alpha_{i}. The vectors 𝐩iE\mathbf{p}^{E}_{i} and 𝐯iE\mathbf{v}^{E}_{i} denote the position and velocity of αi\alpha_{i}, respectively, in {E}\{E\} frame.

III MASCOT: Structure and Features

The testbed presented in this paper ”MASCOT” is based on open source tools, ROS and Gazebo. For the demonstration purpose, we have adapted the AR drone Gazebo plugin [17] to represent quadcopter agents. Using the discussion presented in Section II, the control plugin of the AR drone is modified such that the agents can be treated as double integrators.

III-A Tools Used

III-A1 Robot Operating System (ROS)

ROS is an open-source framework that helps researchers and developers build and reuse code between robotics applications. ROS provides a distributive architecture that eliminates the problem of a single node handling all the tasks. ROS supports low-level drivers and programming in various languages such as Python, C++, Java, and Lisp. This makes it convenient to directly deploy the codes written for simulation on the physical systems. Visualization and debugging tools such as Rviz and rqt make it very easy to keep track of the process[15]. The basic architecture of ROS is shown in Fig. 2.

Refer to caption
Figure 2: ROS Architecture

III-A2 Gazebo

The gazebo is a 3D simulation platform that provides robots, sensors, and environment models which are required for robot development. It uses Open Dynamics Engine (ODE) for real-time simulations and graphics. Gazebo supports a wide range of sensors such as LRF,2D/3D camera, Depth Camera, and Force-Torque Sensor. APIs provided in Gazebo enable users to create robots, sensors, and environment control as a plug-in.

III-A3 Quadcopter Simulation Package

The quadcopter model used in MASCOT is based on the tum-simulator AR Parrot Drone Gazebo simulation package [17] developed by the Computer Vision Group at the Technical University of Munich. The lower level controller is modified and tuned so that the quadcopters can be treated as a double integrator system for control algorithm implementation, and added topics and controls required for the implemented model. A general control script is written for the implementation of the different use cases discussed in Section IV;

III-B Control Block

Refer to caption
Figure 3: Control Block diagram

Figure 3 shows the Control block diagram of the system. The low-level control of the quadcopter is achieved by four independent controllers given below:

  • Heading Control

  • Altitude Control

  • Pitch and Roll angle control

  • Position Control

III-B1 Altitude Control

The Altitude of the quadcopter is achieved by the total Thrust TT generated by all the rotors. This thrust is controlled by the following proportional-derivative controller.

T=Kpz(pzpz)+Kdz(p˙zp˙z)+ω0T=K_{p_{z}}\left(p_{z}^{*}-p_{z}\right)+K_{d_{z}}\left(\dot{p}_{z}^{*}-\dot{p}{z}\right)+\omega_{0}

where pzp_{z} is the current altitude, pzp_{z}^{*} is the desired altitude, KpK_{p}, KdK_{d} are proportional, derivative gains respectively and ω0\omega_{0} is the rotor speed bias which generates a trust to counter the weight of quadcopter

III-B2 Heading Control

The heading is a yaw angle θy\theta_{y} which represents the angle between xBx^{B} and xEx^{E} about zEz^{E}axis. To control this angle we generate a required torque τz\tau_{z} which is given by the following proportional-derivative controller.

τz=Kpy(θyθy)+Kdy(θ˙yθ˙y)\tau_{z}=K_{p_{y}}\left(\theta_{y}^{*}-\theta_{y}\right)+K_{d_{y}}\left(\dot{\theta}_{y}^{*}-\dot{\theta}_{y}\right)

where θy\theta_{y} is a current yaw angle, θy\theta_{y}^{*} is the desired yaw angle and KpK_{p},KdK_{d} are proportional,derivative gains respectively.

III-B3 Controlling θr\theta_{r} and θp\theta_{p}

The roll angle θr\theta_{r} represents the angle between yBy^{B^{\prime}} and yBy^{B} about xBx^{B^{\prime}} axis.To control this angle we generate a required torque τr\tau_{r} which is given by the following proportional-derivative controller.

τx=Kpr(θrθr)+Kdr(θ˙rθ˙r)\tau_{x}=K_{p_{r}}\left(\theta_{r}^{*}-\theta_{r}\right)+K_{d_{r}}\left(\dot{\theta}_{r}^{*}-\dot{\theta}_{r}\right)

where θr\theta_{r} is a current roll angle,θr\theta_{r}^{*} is the desired roll angle and KprK_{p_{r}}, KdrK_{d_{r}} are proportional,derivative gains respectively.

The pitch angle θy\theta_{y} represents the angle between xBx^{B^{\prime}} and xBx^{B} about yBy^{B^{\prime}} axis.To control this angle we generate a required torque τp\tau_{p} which is given by the following proportional-derivative controller.

τy=Kpp(θpθp)+Kdp(θ˙pθ˙p)\tau_{y}=K_{p_{p}}\left(\theta_{p}^{*}-\theta_{p}\right)+K_{d_{p}}\left(\dot{\theta}_{p}^{*}-\dot{\theta}_{p}\right)

where θp\theta_{p} is a current pitch angle,θp\theta_{p}^{*} is the desired pitch angle and KppK_{p_{p}}, KdpK_{d_{p}} are proportional,derivative gains respectively.

Remark 2

With the change in θp\theta_{p} and θr\theta_{r} there is also a reduction in the vertical component of the total thrust T by the factor of the cosine of θp\theta_{p} and θr\theta_{r}. As per our assumption for a very small angle, this reduction is not much which is rapidly corrected by an Altitude control loop.

III-B4 Position Control

The position of the quadcopter in xByBx^{B^{\prime}}y^{B^{\prime}} plane is controlled independently by the proportional-derivative controller for each axis.

ax=Kpx(pxpx)+Kdx(p˙xp˙x)a_{x}=K_{p_{x}}\left(p_{x}^{*}-p_{x}\right)+K_{d_{x}}\left(\dot{p}_{x}^{*}-\dot{p}{x}\right)
ay=Kpy(pypy)+Kdy(p˙yp˙y)a_{y}=K_{p_{y}}\left(p_{y}^{*}-p_{y}\right)+K_{d_{y}}\left(\dot{p}_{y}^{*}-\dot{p}{y}\right)

Note: Here the axa_{x} and aya_{y} computed is in {E} as feedback position and velocity is also in {E} frame.

III-C Architecture and Features of MASCOT

The simulation architecture of MASCOT is shown in Fig. 4.

Refer to caption
Figure 4: System Architecture

In this system, the Gazebo simulator simulates the model and its sensors with the system plugin. Gazebo’s internal scheduler provides the ROS interfaces. This ROS interface enables a user to manipulate the properties of the simulation environment over ROS, as well as spawn and introspect on the state of models in the environment. ROS works as a middleware that runs the independent controller of individual robots spawned in Gazebo environments, ROS provides the intercommunication channel within the nodes, where all the controller nodes communicate with each other and Gazebo over the TCPROS protocol and exchange the information. The control node is written in python for the high-level control of the quadcopter the low-level control and plugin are developed in C++ which provides the tuned low-level control of the quadcopter. If needed user can modify or tune this low-level control.

III-D Configuring the Simulation

For simulating the multi-agent systems using MASCOT, users can provide configuration parameters and control laws using a plain text configuration file, which is used by the internal programs for the initialization and simulation of the quadrotor.

The configurable parameters required are as follows:

  • Robot: Details of the Robots to be simulated

    • Number: No. of Agents to be spawned in Gazebo.

    • IntialPosition: Flag to enable random initial position or specified initial position.

    • Position: Initial Position of Robot (x,y,z).

  • Control: Controls laws to be used

    • Custom-Control: Flag to Enable Custom Control.

    • Tutorial Examples: Flag to Enable Tutorial.

      1. 1.

        Waypoint Navigation:

        • *

          P-Gain: Proportial Gain , Default = 1.0

        • *

          D-Gain: Differential Gain , Default = 1.0

      2. 2.

        Consensus: Flag to Enable Consensus Control.

        • *

          Leader: Specify the robot number that to be leader, 0-for leaderless consensus.

        • *

          Communication Graph: Flag for communication graph

        • *

          L-mat: Laplacian Matrix.

      3. 3.

        Min-max Consensus: Enable Min-max Consensus Control.

  • Output: Configuration of output

    • Velocity : Enable it to generate the velocity plot.

    • Position : Enable it to generate the position plot.

    • Save-plot : Enable to save the plots.

    • Show-plot : Enable it to show plots.

    • Save-data : Enable to save as numpy-array

A user needs to specify their control laws by setting the Custom-Control flag (set as default) as plain text using python syntax. The user can use the states of the quadcopter such as position, velocity, acceleration, and orientation in the control algorithm and can publish the acceleration command which is an output of the control algorithm. Few demos are made available as tutorials for the users which are described in Section IV below.

Theoretically, there is no limit on the number of agents in MASCOT, however, the simulation performance may be affected based on the number of agents and computer specifications. The effective control of the quadcopters depends on the system specifications as well as the computational complexity of the algorithm being tested.

IV Examples

In this section, the simulation results of MASCOT are demonstrated using a few examples of linear as well as non-linear distributed control laws designed for multi-agent systems. A fewer number of agents are used for clarity of figures. All the Algorithms are tested on the Personal Computer with Intel i7 running at 2.8 GHz and 16 GB RAM. The OS used is Ubuntu 20.04.4 with ROS Noetic and Python 3.8.10.

Refer to caption
(a) Initial position of quadcopters at t = 0 s
Refer to caption
(b) Final position of quadcopters after consensus at t = 80 s
Figure 5: Visualization in Gazebo

IV-A Waypoint Navigation

The quadcopter is initialized at a (0,0,1)(0,0,1) position and the different waypoints are given in the xEyEx^{E}y^{E} plane. From Figure 6, it can be inferred that the quadcopter achieves its goal position with a very small overshoot, which depends on the parameters of the controller.

Refer to caption
(a) Position in X-axis
Refer to caption
(b) Position in Y-axis
Figure 6: Quadcopter Position Plots.

IV-B Consensus Algorithms

We demonstrate two consensus algorithms that have linear control laws [18]: 1) for leaderless asymptotic consensus, and 2) leader-follower configuration i.e. consensus tracking In a leaderless case, four agent system is considered which are initialized at random positions, while in leader-follower configuration a ten-agent system is considered with α4L\alpha_{4}\in\textbf{L}.

The control algorithms used is as follows:

fiE={j=1naij(𝐩jE𝐩iE)βviE if αi𝐅0 if αi𝐋\textbf{f}_{i}^{E}=\left\{\begin{array}[]{l}\sum_{j=1}^{n}a_{ij}\left(\mathbf{p}{j}^{E}-\mathbf{p}{i}^{E}\right)-\beta\textbf{v}_{i}^{E}\text{ if }\alpha_{i}\in\mathbf{F}\\ \\ 0\text{ if }\alpha_{i}\in\mathbf{L}\end{array}\right. (7)

where β\beta is a positive constant. Note that, in a leaderless case, all the agents are assumed to be followers. All the quadcopters run their controllers simultaneously and plugin under their respective namespace. Figure 5 shows the visualization of the convergence of quadcopters in the Gazebo simulator. For the leaderless case, Fig. 7(a) shows the trajectory followed by all the quadcopters to reach the consensus point. Fig. 8 shows the convergence of the position of the quadcopter in the xEx^{E} and yEy^{E} axis. For leader-follower configuration Fig. 7(b) shows the trajectory followed by the follower and Fig. 9 show the convergence of the position of the Quadcopter in the xEx^{E} and yEy^{E}-axis.

Refer to caption
(a) Leaderless Control plot
Refer to caption
(b) Leader Follower plot
Figure 7: Consensus Control Position Plots.
Refer to caption
(a) Position in X-axis
Refer to caption
(b) Position in Y-axis
Figure 8: Quadcopter Leaderless Control Plots.
Refer to caption
(a) Position in X-axis
Refer to caption
(b) Position in Y-axis
Figure 9: Quadcopter Leader Consensus Control Plots.

IV-C Min-max time Consensus Control

To demonstrate the simulations of non-linear distributed control laws, a min-max time consensus tracking algorithm proposed in [19] is used. This control algorithm extracts a directed spanning tree from the communication graph between the agents and treats each edge as a leader-follower pair. The root of the spanning tree gives the reference trajectory for consensus tracking. The agents are assumed to have bounded inputs. Using the difference of states between the leader (αp\alpha_{p}) and the follower (αc\alpha_{c}) in each edge, a distributed bang-bang control law is given for the following agents:

𝐟cE=βcsign(2(βcβp)(𝐩c𝐩p)+(𝐯c𝐯p)2sign(𝐯c𝐯p))\mathbf{f}^{E}_{c}=\beta_{c}\text{sign}(2(\beta_{c}-\beta_{p})(\mathbf{p}_{c}-\mathbf{p}_{p})+(\mathbf{v}_{c}-\mathbf{v}_{p})^{2}\text{sign}(\mathbf{v}_{c}-\mathbf{v}_{p})) (8)

where βp\beta_{p} and βc\beta_{c} are the input bounds of αp\alpha_{p} and αc\alpha_{c} respectively.

For simulation, a four-agent system is used with α1\alpha_{1} as the root agent. Figure 10 shows the test result for this control.

Refer to caption
(a) Position in X-axis
Refer to caption
(b) Position in Y-axis
Figure 10: Quadcopter minmax Consensus Control Plots.

V Conclusion and Future Work

MASCOT is a simulation testbed developed for testing distributed control laws designed for multiagent systems with double integrator agents on quadcopter models, various linear, as well as non-linear control laws, can be tested and few of them are demonstrated in this article. This shows the integrity of the developed testbed and also a guide to using it. Further, this testbed can be expanded for other homogeneous and heterogeneous multiagent systems. As the system is open-source and expandable different interface modules can be developed for MATLAB and Simulink which can help researchers to test their algorithms more efficiently.

References

  • [1] T. Li and J.-F. Zhang, “Asymptotically optimal decentralized control for large population stochastic multiagent systems,” IEEE Transactions on Automatic Control, vol. 53, no. 7, pp. 1643–1660, 2008.
  • [2] S. Li, H. Du, and X. Lin, “Finite-time consensus algorithm for multi-agent systems with double-integrator dynamics,” Automatica, vol. 47, no. 8, pp. 1706–1712, 2011.
  • [3] F. Dörfler and B. Francis, “Formation control of autonomous robots based on cooperative behavior,” in 2009 European Control Conference (ECC).   IEEE, 2009, pp. 2432–2437.
  • [4] V. Cichella, I. Kaminer, V. Dobrokhodov, E. Xargay, R. Choe, N. Hovakimyan, A. P. Aguiar, and A. M. Pascoal, “Cooperative path following of multiple multirotors over time-varying networks,” IEEE Transactions on Automation Science and Engineering, vol. 12, no. 3, pp. 945–957, 2015.
  • [5] D. S. Drew, “Multi-agent systems for search and rescue applications,” Current Robotics Reports, vol. 2, no. 2, pp. 189–200, 2021.
  • [6] C. H. Yong and R. Miikkulainen, “Coevolution of role-based cooperation in multiagent systems,” IEEE Transactions on Autonomous Mental Development, vol. 1, no. 3, pp. 170–186, 2009.
  • [7] A. Ajorlou, A. Momeni, and A. G. Aghdam, “A class of bounded distributed control strategies for connectivity preservation in multi-agent systems,” IEEE Transactions on Automatic Control, vol. 55, no. 12, pp. 2828–2833, 2010.
  • [8] P. Skobelev, D. Budaev, N. Gusev, and G. Voschuk, “Designing multi-agent swarm of uav for precise agriculture,” in International Conference on Practical Applications of Agents and Multi-Agent Systems.   Springer, 2018, pp. 47–59.
  • [9] D. Massaguer, V. Balasubramanian, S. Mehrotra, and N. Venkatasubramanian, “Multi-agent simulation of disaster response,” in ATDM workshop in AAMAS, vol. 2006, 2006.
  • [10] D. A. Guastella, V. Campss, and M.-P. Gleizes, “A cooperative multi-agent system for crowd sensing based estimation in smart cities,” IEEE Access, vol. 8, pp. 183 051–183 070, 2020.
  • [11] R. Mahony, V. Kumar, and P. Corke, “Multirotor aerial vehicles: Modeling, estimation, and control of quadrotor,” IEEE Robotics and Automation magazine, vol. 19, no. 3, pp. 20–32, 2012.
  • [12] A. Joshi, N. Limbu, I. Ahuja, A. K. Mulla, H. Chung, and D. Chakraborty, “Implementation of distributed consensus on an outdoor testbed,” in 2016 European Control Conference (ECC), 2016, pp. 2146–2151.
  • [13] P. Lu and Q. Geng, “Real-time simulation system for uav based on matlab/simulink,” in 2011 IEEE 2nd International Conference on Computing, Control and Industrial Engineering, vol. 1, 2011, pp. 399–404.
  • [14] A. Joshi, V. Sawant, D. Chakraborty, and H. Chung, “Implementation of min-max time consensus tracking on a multi-quadrotor testbed,” in 2019 18th European Control Conference (ECC).   IEEE, 2019, pp. 1073–1078.
  • [15] Stanford Artificial Intelligence Laboratory et al., “Robotic operating system.” [Online]. Available: https://www.ros.org
  • [16] P. I. Corke and O. Khatib, Robotics, vision and control: fundamental algorithms in MATLAB.   Springer, 2011, vol. 73.
  • [17] T. C. V. Group, “Tum simulator,” https://github.com/tum-vision/tum_simulator, 2012.
  • [18] W. Ren and R. W. Beard, Distributed consensus in multi-vehicle cooperative control.   Springer, 2008, vol. 27.
  • [19] A. K. Mulla and D. Chakraborty, “Min–max time consensus tracking with communication guarantee,” IEEE Transactions on Automatic Control, vol. 63, no. 1, pp. 132–144, 2017.