buzz: an extensible programming language for self ... · pdf file1 buzz: an extensible...

Download Buzz: An Extensible Programming Language for Self ... · PDF file1 Buzz: An Extensible Programming Language for Self-Organizing Heterogeneous Robot Swarms Carlo Pinciroli, Adam Lee-Brown,

If you can't read please download the document

Upload: ngohanh

Post on 06-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 1

    Buzz: An Extensible Programming Language forSelf-Organizing Heterogeneous Robot Swarms

    Carlo Pinciroli, Adam Lee-Brown, Giovanni Beltrame

    AbstractWe present Buzz, a novel programming languagefor heterogeneous robot swarms. Buzz advocates a compositionalapproach, offering primitives to define swarm behaviors bothfrom the perspective of the single robot and of the overallswarm. Single-robot primitives include robot-specific instructionsand manipulation of neighborhood data. Swarm-based primitivesallow for the dynamic management of robot teams, and forsharing information globally across the swarm. Self-organizationstems from the completely decentralized mechanisms upon whichthe Buzz run-time platform is based. The language can beextended to add new primitives (thus supporting heterogeneousrobot swarms), and its run-time platform is designed to belaid on top of other frameworks, such as Robot OperatingSystem. We showcase the capabilities of Buzz by providingcode examples, and analyze scalability and robustness of therun-time platform through realistic simulated experiments withrepresentative swarm algorithms.

    Index Termscontrol architectures and programming, dis-tributed robot systems, swarm robotics, swarm engineering

    I. INTRODUCTION

    SWARM robotics systems [1] are envisioned for large-scaleapplication scenarios that require reliable, scalable, andautonomous behaviors. Among the many hurdles towards real-world deployment of these systems, one of the most importantis the lack of dedicated tools, especially regarding software [2].In particular, one problem that has received little attentionin the literature is programmability. The current practice ofswarm behavior development typically focuses on individualbehaviors and low-level interactions [3]. This approach forcesdevelopers to constantly reinvent the wheel to fit well-knownalgorithms into new applications, resulting in a slow and error-prone development process.

    In this paper, we introduce Buzz, a novel programminglanguage specifically designed for robot swarms. To drive thedesign of Buzz, we identified key requirements a successfulprogramming language for swarm robotics must meet.

    First, the language must allow the programmer to work at asuitable level of abstraction. The complexity of concentratingon individual robots and their interactions, i.e., a bottom-up approach, increases steeply with the size of the swarm.Conversely, a purely top-down approach, i.e., focused on thebehaviour of the swarm as a whole, might lack expressivepower to fine-tune specific robot behaviors. We believe that alanguage for robot swarms must combine both bottom-up and

    C. Pinciroli and G. Beltrame are with the Department of Computerand Software Engineering, Ecole Polytechnique de Montreal, PO Box6079, Succ. Centre-ville Montreal, Quebec, Canada H3C 3A7. E-mail:{carlo.pinciroli,giovanni.beltrame}@polymtl.ca

    A. Lee-Brown is with the School of Electrical and Electronic Engineering,Royal Melbourne Institute of Technology, 124 La Trobe St, Melbourne VIC3000, Australia. E-mail: [email protected]

    top-down primitives, allowing the developer to pick the mostcomfortable level of abstraction to express a swarm algorithm.

    Second, the language must enable a compositional ap-proach, by providing predictable primitives that can be com-bined intuitively into more complex algorithms and constructs.

    Third, the language must prove generic enough to (i) expressthe most common algorithms for swarm coordination, such asflocking, task allocation, and collective decision making; and(ii) support heterogeneous swarms.

    Fourth, the run-time platform of the language must ensureacceptable levels of scalability (for increasing swarm sizes)and robustness (in case of temporary communication issues).Currently, the management of the low-level aspects and cornercases concerning these issues constitutes a sizable portion ofthe development process of swarm behaviors. Alleviating thisburden with a scalable and robust run-time platform is crucialfor real-world deployment of swarm behaviors.

    The main contribution of this paper is the design andimplementation of Buzz, a programming language that meetsthe requirements discussed above. The text is organized asfollows. In Sec. II, we present the design principles wefollowed. In Sec. III, we introduce the Buzz syntax. In Sec. IVwe illustrate the run-time platform. In Sec. V we report anumber of scripts meant to showcase the capabilities of Buzz,in particular its conciseness and generality. In Sec. VI weanalyze the scalability and robustness of the Buzz run-time.In Sec. VII we discuss related work, outlining similarities anddifferences of Buzz with respect to existing languages andframeworks. Finally, in Sec. VIII we draw concluding remarks.

    II. DESIGN PRINCIPLES

    The design of Buzz was based on a set of high-levelprinciples, that are described in the following.Discrete swarm, step-wise execution. A swarm is consideredas a discrete collection of devices, each running the Buzzvirtual machine (BVM), and executing the same Buzz script.Script execution proceeds independently on each robot in astep-wise fashion. Each time-step is divided in five phases:1) Sensor readings are collected and stored in the BVM;2) Incoming messages are collected and processed by theBVM; 3) A portion of the Buzz script is executed; 4) Themessages in the BVM output queue are sent (as many aspossible, according to the available payload size; see Sec. IV);5) Actuator values are collected from the BVM state andapplied. The length of a time-step is constant over the life-time of the script, although it does not need to be the samefor every robot. If the execution time of a step is shorter thanthe allotted time, the robot sleeps for a period. If the execution

    arX

    iv:1

    507.

    0594

    6v1

    [cs

    .RO

    ] 2

    1 Ju

    l 201

    5

  • 2

    is longer, a warning message is printed on the screen and theexecution proceeds.Predictable and composable syntax. Buzz employs a simple,imperative syntax inspired by languages such as Python, Lua,and JavaScript. While this syntax ensures a short learningcurve, it also allows for predictable and composable scripts.By predictable, we mean that a programmer can easily inferthe results of the execution of a program by reading its code.Composability refers to the ability to structure a complexprogram into simpler elements, such as functions, classes, etc.that can later be used as modules.Support for heterogeneous robots. Buzz is explicitly de-signed to support heterogeneous robot swarms. To this aim,Buzz is conceived as an extension language, that is, a lan-guage that exports and enhances the capabilities of an alreadyexisting system. This design choice allows one to stack theBuzz run-time on top of well-known single-robot frameworkssuch as ROS,1 OROCOS,2 or YARP.3 The Buzz syntax andprimitives are minimal, concise, and powerful; the programmercan add new primitives and constructs that link to relevantfeatures of the underlying system.Swarm-level abstraction. One of the novel aspects of Buzz isthe ability to manage swarms of robots. The concept of swarmis a first-class language object [15]. Swarms can be createdand disbanded; new swarms can be created as a result of anoperation of intersection, union, or difference between twopre-existing swarms. Each swarm can be atomically assignedoperations to perform. Swarms can be employed to encodecomplex task coordination strategies.Situated communication. Each robot is assumed to beequipped with a device capable of situated communication [4].Such device broadcasts messages within a limited range andreceives messages from neighboring robots in direct, unob-structed line-of-sight. Upon receipt of a message, a robotalso detects the relative distance and angle of the messagesender. Situated communication has been used extensively inswarm robotics to achieve global coordination in algorithmsfor, e.g., pattern formation [5], flocking [6], exploration [7],and task allocation [8]. This communication modality can beachieved on-hardware with robots such as the Kilobot [9],the e-puck [10], and the marXbot [11], although with lim-ited payload size, and a dedicated module for low-cost 3Dcommunication was proposed in [12]. Alternatively, situatedcommunication can be satisfactorily realized through WiFi andGPS (for outdoor scenarios) or tracking systems such as Vicon(for indoor scenarios).Information sharing. Buzz provides two ways for robotsto share information: virtual stigmergy and neighbor queries.Virtual stigmergy is a data structure that allows the robots ina swarm to globally agree on the values of a set of variables.From an abstract point of view, virtual stigmergy is akin toa distributed key-value storage. Among its many potentialapplications, this structure may be employed to coordinatetask execution, e.g., mark the tasks that have already been

    1http://www.ros.org/2http://www.orocos.org/3http://wiki.icub.org/yarp/

    completed and/or share progress on the uncompleted ones.Neighbor queries allow a robot to inquire its direct neighborson the value of a certain variable. Upon receiving a request,the neighbors reply with the current value of the variable;these replies are then collected into a list by the robot whorequested the data. Neighbor queries are useful when robotsmust perform local data aggregation, such as calculatingaverages [13] or constructing spatial gradients.

    III. LANGUAGE DEFINITION

    A. Robot-wise operations and primitive types

    The simplest operations available in Buzz are robot-wiseoperations. These operations are executed by every robotindividually. Assignments, arithmetic operations, loops andbranches fall into this category. E.g.:# Assignment and arithmetic operationa = 3 + 7# Loopi = 0; while(i < a) i = i + 1# Branching