Robotic swarm deployment task implemented using P colonies and Finite state machines

Published: 05-07-2016| Version 1 | DOI: 10.17632/wkwzb5mkpk.1
Catalin Buiu,
Andrei Florea


In this record we present two distinct robot control models designed to control a swarm of robots (in a distributed manner) with the objective of moving the robots in a random direction as long as they have neighbors nearby. Once there are no more neighbor robots nearby, each robot is programmed to stop and color itself in white. The first control model uses P colonies and is described in detail in Florea, A. G., & Buiu, C. (2016). Development of a software simulator for P colonies. Applications in robotics. International Journal of Unconventional Computing, 12(2-3), 189–205. The second control model uses the concept of State-less Event-driven Finite State Machine and the structure of this model is presented in diagram.png. In the following sections, we present a small description for each of the attached videos. 1_clone_10_circle This video demonstrates the use of the robot cloning function of the vrep_bridge script in order to create 9 distinct copies of the source robot and distribute them on a circle around the source robot. The copies are so positioned by a distribution function that can be adapted to other forms. This cloning function allows one to generate large swarms of robots with ease. 2_one_pcolony_for_three_kilobots In this video, we simulate a simple P minus colony using Lulu_Kilobot, on three different robots. At each subtraction, the robots move one step forward. At the beginning of the clip one can see the robot - P colony association table, where each robot has a distinct copy of the original P colony. 3_pswarm_5_robots_3_colonies This video demonstrates the flexibility offered by the config file of Lulu_Kilobot. From the config file we explicitly specify that the first two robots should use the go straight P colony. For the other colonies, we specify the number of robots that should be assigned, go left = 1 and go right = 2. From the robot - P colony association table, one can see that the first robot that is assigned a P colony uses the original P colony while the others use an independent copy of the P colony. 4_pcolony_10_robots_disperse This video demonstrates dispersion, which is a typical deployment scenario in swarm robotics. The robots should position themselves away from one another, so that each robot is at least at a minimum distance from each of its neighbours. All decisions are taken by the command module, on the basis of the received input data from msg_distance. A new direction of motion (and corresponding color) is randomly chosen if there are other robots closer than a pre-set threshold distance and otherwise the robots stop and set their color to white. 5_fsm_10_robots_disperse In this video we present the same dispersion algorithm as presented in the previous video but implemented using the Event-driven Finite State Machine control model.


Steps to reproduce

The software tools (open-source Python scripts) used for this controller are the Lulu Pswarm / P colony simulator (available at, the Lulu_Kilobot P swarm / P colony based robot controller (available at and the vrep_bridge library (available at that allows the P colony controller to interact with robots simulated in V-REP, a free for educational use robot simulator available at The Lulu simulator was included as a Python module in Lulu_Kilobot in order to test robot controllers based on P colonies and P swarms for swarms of up to 10 Kilobot robots. Instructions on how to start a simulation using a Lulu input file (input.lulu), a Lulu_Kilobot configuration file (config.lulu) and a V-REP scene (ttt extension) are given on the Lulu_kilobot Github page. The input P colony (input) file, swarm configuration (config) file and V-REP scene (.ttt) are available for each video in the associated .zip archive. The Event-driven Finite State Machine controller used in video 5_fsm_10_robots_disperse responds to a pre-defined set of events and executes the corresponding actions when the event is triggered, before entering a new state. All of the control logic is implemented in the event handlers. The control script for video 5_fsm_10_robots_disperse, is an adaptation of Lulu_Kilobot (included as and only requires a Lulu config file which contains the number of robots for the simulation. All of the event handlers are implemented within the script.