Buzz: A New Programming Language for Robot Swarms

Buzz: A New Programming Language for Robot Swarms

May be you have seen ants working together in a large scale to achieve a common goal. It looks very interesting but more than that it is very challenging job. By seeing them first question comes in our mind that How they are communicating and coordinating to each other to accomplish the target? And how they are dividing workload with each ant?

The same question arises in researchers minds when they think about robot swarms. Among the many hurdles towards real world deployment of these systems, one of the most important is the lack of dedicated tools, especially regarding programmability. The current practice of swarm behavior development typically focuses on individual behaviors and low-level interactions. And Current approach forces developers to constantly ‘reinvent the wheel’ to fit well-known algorithms into new applications, resulting in a slow and error prone development process. To solve this problem researchers thought that to communicate, coordinate and program at large scale robot swarms a specific language is required.

Researchers from Ecole Polytechnique de Montr´eal, Canada and Royal Melbourne Institute of Technology, Australia presented a novel programming language, ‘Buzz’ for robot swarms. They presented the design principle, Buzz syntax and illustrated the capability of Buzz in terms of its conciseness and generality. They also analyzed the scalability and robustness of the Buzz run-time.


Some facts about the Buzz:

  • Scripting Languages: Buzz is a dynamically typed language that offers the following types: nil, integer, floating-point, string, table, closure, swarm, and virtual stigmergy. The nil, integer, floating-point, and string types work analogously to other scripting languages such as Python or Lua. The swarm and virtual stigmergy types are introduced new in Buzz.
  • Compositional approach: Buzz advocates a compositional approach, offering primitives to define swarm behaviors both from the perspective of the single robot and of the overall swarm.
  • Mixed programming approach: Buzz allows programmers to work in Top-down logic as well as in Bottom-Up logic.
  • Support: Buzz supports heterogeneous (and obviously homogeneous also) robot swarms.
  • Extension Language: Buzz is conceived as an extension language, that is, a language that exports and enhances the capabilities of an already existing system. This design choice allows one to stack the Buzz run-time on top of well-known single-robot frameworks such as ROS, OROCOS, or YARP.
  • Swarm-level abstraction: One of the novel aspects of Buzz is the ability to manage swarms of robots. The concept of swarm is a first-class language object. Swarms can be created and disbanded; new swarms can be created as a result of an operation of intersection, union, or difference between two pre-existing swarms.

How it works?

A swarm is considered as a discrete collection of devices, each running the Buzz virtual machine (BVM), and executing the same Buzz script. Script execution proceeds independently on each robot in a step-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 the BVM
  3. A portion of the Buzz script is executed
  4. The messages in the BVM output queue are sent (as many as possible, according to the available payload size
  5. Actuator values are collected from the BVM state and applied

Buzz provides two ways for robots to share information: virtual stigmergy and neighbor queries. Virtual stigmergy is a data structure that allows the robots in a swarm to globally agree on the values of a set of variables. Neighbor queries allow a robot to inquire its direct neighbors on 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 who requested the data.

Buzz lets the programmer subdivide the robots into multiple teams. In Buzz parlance, each team is called a swarm. Buzz treats swarms as first-class objects. To create a swarm, the programmer must provide a unique identifier, which is known and shared by all the robots in the created swarm. The returned value is a class-like structure of type swarm. Once a swarm is created, it is initially empty. To have robots join a swarm, two methods are available: select() and join(). With the former, the programmer can specify a condition, evaluated by each robot individually, for joining a swarm; with the latter, a robot joins a swarm unconditionally. To leave a swarm, Buzz offers the analogous methods unselect() and leave(). A robot can check whether it belongs to a swarm through the method in().


Researchers believe that one of the most important aspects of Buzz is its potential to become an enabler for future research on real-world, complex swarm robotics systems that allows researchers to compare, share, and reuse swarm behaviors.

In future they are planning to create a library of well-known swarm behaviors, which will be offered open-source to practitioners as part of the Buzz distribution.


Abstract—We present Buzz, a novel programming language for heterogeneous robot swarms. Buzz advocates a compositional approach, offering primitives to define swarm behaviors both from the perspective of the single robot and of the overall swarm. Single-robot primitives include robot-specific instructions and manipulation of neighborhood data. Swarm-based primitives allow for the dynamic management of robot teams, and for sharing information globally across the swarm. Self-organization stems from the completely decentralized mechanisms upon which the Buzz run-time platform is based. The language can be extended to add new primitives (thus supporting heterogeneous robot swarms), and its run-time platform is designed to be laid on top of other frameworks, such as Robot Operating System. We showcase the capabilities of Buzz by providing code examples, and analyze scalability and robustness of the run-time platform through realistic simulated experiments with representative swarm algorithms.


  • Reference: “Buzz: An Extensible Programming Language for Self-Organizing Heterogeneous Robot “, Swarms Carlo Pinciroli, Adam Lee-Brown, Giovanni Beltrame. arXiv:1507.05946
  • Explore Further: Controlling Swarms of Robots with a Finger
  • Image: Kilobot (Harvard University)

Leave a Reply

Your email address will not be published. Required fields are marked *