SwarmCon is a minimalistic version of the WhyCon localization system intended for swarm applications. While the core of the SwarmCon system is the same as the WhyCon one, it was designed to have as least dependencies as possible. Moreover, the SwarmCon is especially intended for external localization of ground-robot swarms. Thus, unlike WhyCon, SwarmCon can distinguish between individual robots and calculate their heading.
This repo features a simple install script ./setup.sh
for ubuntu/debian based linux distributions.
All the following libraries are probably in your packages.
- libsdl1.2-dev for graphical user interface.
- libsdl-ttf2.0-dev to print stuff in the GUI.
- libncurses5-dev to print stuff on the terminal.
- luvcview or guvcview to set-up the camera.
Most common parameters should be changed by editing src/config.h
and recompiling the program
$ cd src
$ make
The program has a few flags to change its behaviour
--nogui
: don't show the GUI--savevideo
: save video--savelog
: save log
The program writes all the locations to http://localhost:6666
. This can easily be read using the script swarmcon_server.py
- Install the required libraries.
- Check the available resolutions, framerates and formats of your USB camera by running guvcview -L.
- Run guvcview and adjust your camera settings (exposure, brightness etc).
- Download the software from GitHub and go to the src directory.
- Adjust the camera resolution in the file config.h.
- Compile the software - just type make.
- Download, resize and print one circular pattern
- Try a test run - you need to run the binary from the bin directory. Run
./swarmcon /dev/videoX 1
, where X is the number of the camera and 1 tells the system to track one pattern. - You should see the image with some numbers below the circle. Pressing D shows the segmentation result.
- At this point, you can also change camera brightness, exposure, contrast by pressing (SHIFT) b, e, c respectively. These settings are stored in etc/camera.cfg and reloaded on restart.
- Open your browser to view localhost:6666. You should see the circle position.
- Calibrate your camera using the MATLAB (or Octave) calibration toolbox and put the Calib_Results.m in the etc directory. (this step is not necessary, but it improves localization precision)
- Go to the etc directory and call
create.sh N M
to generate patterns for NxM robots. - Print the generated file pattern_n_m.pdf, put the eliptical markers on your robots and place the remaining four circular markers at the corners of their operation space.
- Modify the dimensions of the operation space in the config.h.
- If you have resized the markers (their default size is 30mm), then adjust the their diameter in the config.h file.
- Run
make
to recompile, put your camera facing down, overhead your swarm. - Go to bin directory and run
./swarmcon /dev/videoX Y
, where X is the number of your camera and Y is the number of patterns you want to track, i.e.Y = (N * M) + 4
. - Once all the patterns are found, press a and the four outermost patterns will be used to calculate the coordinate system.
- Each pattern will have four numbers - ID, heading and x,y in mm.
- Pressing +,- changes the number of localized patterns.
- To create a log of the robot positions, simply run swarmcon with the flag
--savelog
. - If your camera supports the MJPEG format, then the system can create a video in the output folder with the flag
--savevideo
. - If your camera does not support MJPEG, swarmcon will save the video feed as a serie of bitmaps, that you can process later as well.
- You can run swarmcon video_file_name Y to process that video in the same way as when using the camera, i.e. video_file_name instead of /dev/videoX.
- Processing a saved video rather than the camera feed is likely to provide more precise results.
- Running the system with a --nogui argument e.g.
./swarmcon /dev/video0 1 --nogui
causes text-only output - this can speed-up postprocessing.
- At this point, you can start experimenting with the system by adding whatever features you might think useful.
- We have tried to comment the code so an experienced programmer should be able to alter the system accordingly. However, if you have any questions regarding the code, feel free to contact Tom Krajnik or Matias Nitsche. The Code has been modified, these are only the original authors and they might not be able to answer
- If you use this localization system for your research, please don't forget to cite at least one relevant paper from these bibtex records.
- Have fun!
The WhyCon system was developed as a joint project between the University of Buenos Aires, Czech Technical University and University of Lincoln in UK. The main contributors were Matias Nitsche, Tom Krajnik and Jan Faigl. WhyCon was first presented on International Conference on Advanced Robotics 2013 [1], later in the Journal of Intelligent and Robotics Systems [2] and finally at the Workshop on Open Source Aerial Robotics during the International Conference on Intelligent Robotic Systems, 2015 [3]. Its early version was also presented at the International Conference of Robotics and Automation, 2013 [4]. If you decide to use this software for your research, please cite WhyCon using the one of the references provided in this bibtex file.
- T. Krajník, M. Nitsche et al.: External localization system for mobile robotics. International Conference on Advanced Robotics (ICAR), 2013. [bibtex].
- T. Krajník, M. Nitsche et al.: A Practical Multirobot Localization System. Journal of Intelligent and Robotic Systems (JINT), 2014. [bibtex].
- M. Nitsche, T. Krajník et al.: WhyCon: An Efficent, Marker-based Localization System. IROS Workshop on Open Source Aerial Robotics, 2015. [bibtex].
- J. Faigl, T. Krajník et al.: Low-cost embedded system for relative localization in robotic swarms. International Conference on Robotics and Automation (ICRA), 2013. [bibtex].
The development of WhyCon was supported by EU within its Seventh Framework Programme project ICT-600623 STRANDS. The Czech Republic and Argentina have given support through projects 7AMB12AR022, ARC/11/11, 13-18316P and 17-27006Y STRoLL - Spatio-Temporal Representations for Mobile Robot Navigation. We sincerely acknowledge Jean Pierre Moreau for his excellent libraries for numerical analysis that we use in our project.