This repository contains algorithms developed for the student paper proposed for Rector's award at University of Zagreb.
Title: Decentralized formation control for a multi-agent system of autonomous spherical robots
Authors: Antonella Barišić, Marko Križmančić
Abstract: In this work, a decentralized control algorithm based on Reynolds' rules is implemented on a multi-agent system of spherical robots. The algorithm procedurally generates motion patterns that resemble those characteristic for flocks of birds or schools of fish. Generated motion patterns allow robots to move in a closed space with static obstacles. A Bluetooth driver for controlling the robots has also been developed. The complete system is implemented using the ROS framework and Python programming language. The results of this work are demonstrated with experiments in a simulated environment, as well as in the real world using Sphero SPRK+ robots localized with OptiTrack.
I recently started a reorganization of the repository and the current version is be broken (unavailable outside packages are necessary). Unfortunately, I can't say when that might get fixed. In the meantime, check out an older version when everything was still in the same place: https://github.com/mkrizmancic/sphero_formation/tree/0ac14aad3dd1a0af26f191c017e213279eebd52e
Simply clone this repository inside ROS workspace and run catkin build
in workspace root.
Simulation part uses stage_ros simulator.
If you wish to use this with Sphero robots, you must also download this repository: https://github.com/antonellabarisic/sphero_sprk_ros.
OptiTrack is used for localization of robots. However, Spheros cannot be equipped with tracking markers, so only their LEDs are used for tracking. Each Sphero shows up as a single marker. In order to stream positions of single markers, you must also download this repository: https://github.com/mkrizmancic/mocap_optitrack/tree/new-and-old-support-updated.
Simulation:
- Set values for all desired parameters inside launch/setup_sim.launch.
- Set initial velocities in cfg/sphero_init_vel.cfg.
- In first terminal run
roscore
(optional) - In second terminal run
roslaunch sphero_formation setup_sim.launch
- In third terminal run
roslaunch sphero_formation reynolds_sim.launch
Real world:
- Set number of robots used in launch/drivers.launch.
(First n robots defined with MAC addresses in sphero_addresses.txt will be used.) - Set values for all other desired parameters inside launch/setup_real.launch.
- Set initial velocities in cfg/sphero_init_vel.cfg.
- In first terminal run
roscore
(optional) - In second terminal run
roslaunch sphero_formation drivers.launch
- In third terminal run
roslaunch sphero_formation setup_real.launch
- In fourth terminal run
roslaunch sphero_formation tracking.launch
- In fifth terminal run
roslaunch sphero_formation flocking.launch
Flocking algorithm parameters can be changed during runtime with rqt_reconfigure. GUI for changing parameters is launched from setup_*.launch
files.
Robots can be controlled manually with Logitech F710 joystick.
TODO: specify button mappings