Coder Social home page Coder Social logo

kilombo's Introduction

Kilombo - C kilobot simulator

Authors: Fredrik Jansson, Matthew Hartley, Martin Hinsch, Tjelvar Olsson, Ivica Slavkov, Noemí Carranza

For an extended list of those contributing to the simulator and related paper, see here.

Contact: Fredrik Jansson: [email protected] Matthew Hartley: [email protected]

This repository holds the code for Kilombo, a C based Kilobot simulator. The simulator was developed in the Swarm Organ project, and is distributed under the MIT license (see the file LICENSE for details). Installation instructions follow below. For detailed usage instruction and programming documentation, see docs/manual.md and the example bots in examples/.

A preprint of an article about the simultator is available on arXiv. If the Kilombo simulator is used for academic purposes, we would highly appreciate citations of this article and the GitHub repository. ArXiv 1511.04285

Any feedback on the simulator is welcome, contact the authors listed above. If the simulator turns out to be useful for you, we would like to hear it - please write us a short mail to let us know.

Prerequisites

You'll need to have:

  • git
  • cmake
  • SDL 1.X (including headers for building, i.e. devel packages under linux)
  • the Jansson library (though it's in many package managers. Again, get the development package)
  • the Check unit testing library

Additionally, to compile the code for real kilobots as well, the following are needed:

  • avr-gcc (c compiler for the AVR microcontroller, to compile for the kilobot)
  • Kilolib (the official Kilobot library)

Debian-based Linux systems

sudo apt-get install build-essential git gcc-avr gdb-avr binutils-avr avr-libc avrdude libsdl1.2-dev libjansson-dev libsubunit-dev cmake check

OSX systems

Standard development tools, includeing git and a c compiler, can be obtained by installing xcode. In addition, several libraries are needed, which can be obtained using the package manager brew. A tutorial: http://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/

With brew installed, install the libraries.

cmake: brew install cmake

check library: brew install check

SDL library: brew install sdl

AVR toolchain, (Optional, needed for real kilobots): brew tap osx-cross/avr brew install avr-libc

For the brew-installed libraries to be found, the following lines can be added to .bash_profile: export C_INCLUDE_PATH=/usr/local/include/:$C_INCLUDE_PATH export LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH

Build instructions

Make a build directory:

mkdir build
cd build

Run cmake:

cmake ..

Install:

sudo make install

This installs the kilobot simulator in a system-wide location, by default under /usr/local/lib and /usr/local/include.

Compile and run examples

cd examples cd orbit make # or make -f Makefile.osx on OSX ./orbit -b start_positions.json

The example makefiles are set up to build the code for the simulator by default. By running make hex the same source code is compiled for the real Kilobot. This requires the avr-gcc toolchain and the official Kilolib to be installed (see prerequisites above).

Setup for compiling programs for the real Kilobots

Kilolib

git clone https://github.com/acornejo/kilolib
cd kilolib
make

add export KILOHEADERS=/path/to/kilolib/ to .bash_profile or another suitable configureation file, or provide the path in the Makefile for the bot program. For the setting to take effect, open a new terminal or source .bash_profile.

To compile the example programs for real robots: cd examples/orbit # or another example make hex

Third-party code

The simulator uses the SDL_GFX library by Andreas Schiffler (distributed under the zlib license). The source code for the sdl_gfx library is bundled with the simulator due to its unreliable availability in various Linux distributions. It is located in the directory src/gfx, and is automatically compiled with the rest of the source code.

The simulator also includes the API definitions of kilolib, the C library for the physical kilobot robot. These are located in the file src/kilolib.h, with minor, simulator-specific changes. The full kilolib source code is here: https://github.com/acornejo/kilolib .

kilombo's People

Contributors

fjansson avatar tjelvar-olsson avatar mhinsch avatar mrmh2 avatar islavkov avatar davxy avatar jorrenbosga avatar ncarher avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.