Skip to content
/ roborobo4 Public template

Roborobo v.4 - super fast multi-robot simulator for evolutionary swarm robotics and multi-agent learning. Combines ease-of-use (python interface) with speed (C++ core engine).

Notifications You must be signed in to change notification settings

nekonaute/roborobo4

Repository files navigation

Roborobo.4

Roborobo is a fast and simple 2D mobile robot simulator loosely based on low-cost mobile robots such as khepera or epuck models. It is targeted for fast single and multi-robots simulation for evolutionary robotics and machine learning in multi-agent systems, collective and swarm robotics.

Roborobo combines speed of development and speed of execution. Roborobo can be programmed with python 3.x, with all the core functions written in C++ for super fast execution.

Version

Roborobo version 4 is currently the only supported version. Current official release is (from: roborobo.cpp):

  • gVersion = 20210321
  • gCurrentBuildInfo = Shangri-La build

Contributors

Main contributors

  • Nicolas Bredeche: main roborobo developper and project initiator (since 2009)

  • http://pages.isir.upmc.fr/~bredeche/

  • contact: nicolas.bredeche(at)sorbonne-universite.fr

  • Paul Ecoffet: pyRoborobo, the python interface to Roborobo (2020-2021)

  • Evert Haasdijk: properties management library (2010-2012)

Other contributors

  • Jean-Marc Montanier, Berend Weel, Amine Boumaza, Andreas Steyven, Leo Cazenille, Theotime Grohens, and a few others!

How to cite Roborobo in your work

If you use Roborobo in your work, please cite the following paper:

N. Bredeche, J.-M. Montanier, B. Weel, and E. Haasdijk. Roborobo! a fast robot simulator for swarm and collective robotics. CoRR, abs/1304.2888, 2013.

Link to the paper on Arxiv: http://arxiv.org/abs/1304.2888

Scientific papers that cite Roborobo: https://scholar.google.fr/scholar?cites=7785979290259259170


INSTALLATION

Roborobo basic dependencies are:

  • a C++ compiler (GCC or CLANG)
  • Python 3.x

Supported platforms:

  • Linux-based
  • MacOS X

Linux and MacOS installation instructions are described below. Other platforms are not officially supported, but Roborobo was previously shown to run on: MS Windows, Raspbian and Pandora.

Remark: if you get a lot of warnings during compilation, this is probably due to already installed pip packages shadowing the newly installed conda packages (e.g. with pybind). Work around for pyBind that may work: conda install -c conda-forge "pybind11>2.6". However the best way is to delete the pip packages and make a clean install of roborobo again_

Linux

Create a conda environment:

conda create --name roborobo numpy pybind11 
conda activate roborobo

Install Python dependencies for Roborobo (numpy, pybind11, sphinx, ...)

conda install numpy setuptools
conda install -c conda-forge pybind11
conda install sphinx recommonmark sphinx_rtd_theme numpydoc

# or if you prefer to use pip instead of Conda: 
# pip install -U pybind11
# pip install -U numpy
# pip install -U sphinx

Install C++ dependencies for Roborobo (Cmake, SDL2, boost and eigen):

sudo apt install git build-essential cmake 
sudo apt-get install libsdl2-dev libsdl2-image-dev libboost-dev libeigen3-dev

Get your local copy of Roborobo:

git clone https://github.com/nekonaute/roborobo4.git

Compile and install Roborobo:

# conda activate roborobo (if not already activated)
cd roborobo4
# deprecated: python setup.py install --force --user
python3 -m pip install . --force --user -v

Check the QUICK START section below for running a Roborobo example.

Mac OS

Create a conda environment:

conda create --name roborobo numpy pybind11 
conda activate roborobo

Install Python dependencies for Roborobo (numpy, pybind11, sphinx, ...)

conda install numpy setuptools
conda install -c conda-forge pybind11
conda install sphinx recommonmark sphinx_rtd_theme numpydoc

# or if you prefer to use pip instead of Conda: 
# pip install -U pybind11
# pip install -U numpy
# pip install -U sphinx

Install C++ dependencies for Roborobo (Cmake, SDL2, boost and eigen):

brew install cmake 
brew install sdl2
brew install sdl2_image
brew install boost
brew install eigen

Get your local copy of Roborobo:

git clone https://github.com/nekonaute/roborobo4.git

Compile and install Roborobo:

# conda activate roborobo (if not already activated)
cd roborobo4
# deprecated: python setup.py install --force --user
python3 -m pip install . --force --user -v

Check the QUICK START section below for running a Roborobo example.


QUICK START

It is highly suggested to use the python interface to Roborobo, which we refer to as pyRoborobo. If you prefer to develop your project in C++, it also possible (check below). pyRoborobo is built as an interface to Roborobo, and though there is of course a cost to use Python instead of pure C++, we empirically consider it worth the ease of development in the context of academic research. For example, the Boids example runs at ~400 fps (pure C++) and ~200 fps (pyRoborobo) on a Macbook pro 13 (early 2019 model).

Roborobo (C++) and pyRoborobo (Python) both uses three important directories, that should be accessible from where your code (C++ binary or python script) is run.

  • data contains image and resources for setting a roborobo environment
  • config contains configuration files for running a roborobo environment
  • logs will contain log files generated during a roborobo run

While running an example, type "h" when the focus is on the Roborobo window. Help tips will be displayed in the console.

Running a Python example

Activate conda environment (if not done already):

conda activate roborobo

Compile and install Roborobo (if not done already):

cd <your_roborobo_folder>
# python setup.py clean --all -- only if want to rebuild all from scratch
# deprecated: python setup.py install --force --user
python3 -m pip install . --force --user -v

Run a pyRoborobo example:

cd <your_roborobo_folder>/pyRoborobo_dev/examples/
python tutorial.py

Many other examples are available in the pyRoborobo_dev/examples folder.

Build the pyRoborobo API documentation (optional)

Build Roborobo's python API documentation:

# conda activate roborobo (if not already activated)
python setup.py build_sphinx

The pyRoborobo API documentation is now in build/sphinx/html/index.html

Running a C++ example (optional)

If you installed Roborobo for the first time, setup the directory structure for running Roborobo:

Setup the directory structure for both C++ and Python development (done only once):

# Roborobo C++ code
cd <your_roborobo_folder>/build
ln -s ../data
ln -s ../config
ln -s ../logs

Activate conda environment (if not done already):

conda activate roborobo

Compile and install Roborobo (to be done every time you modify the C++ code:

cd <your_roborobo_folder>
# python setup.py clean --all --user _only if want to rebuild all from scratch_
# deprecated: python setup.py install --force --user
python3 -m pip install . --force --user -v

Run a roborobo example:

cd <your_roborobo_folder>/build
./roborobo -l config/Tutorial.properties

Roborobo (C++) examples are in the <your_roborobo_folder>/prj directory. Note that project selection is achieved from the configuration file (config/filename.properties)

What next?

  • Check _OVERVIEW.TXT for a quick introduction.
  • Check _FAQ.TXT for trouble shooting and frequently asked questions.
  • Check the examples, and learn by doing.

Troubleshooting

Roborobo is regularly tested on the most recent Ubuntu LTS. While you should not encounter any problems with an up-to-date Linux distribution, it may be different with non-standard, outdated and/or badly managed Linux distributions. The following covers the most common errors. Note that before trying to fix things, you should be 100% sure that you followed exactly the installation steps provided above.

  • First, be sure that conda uses the same Python version as the default one used in the terminal.
    • To check which versions are used:
      • for Python in Conda: conda list | grep python
      • for Python in Terminal: python3 --version
    • To force conda to use a specific version of Python: conda create (...) python==3.12. Updating conda to the latest version if needed.
    • To force that the python or python3 alias points to the expected python version, re-define the alias in your profile file. E.g.: with bash, edit the .bashrc file and add the following line at the end: alias python='/usr/bin/python3.xx' with xx the preferred version. Restart the terminal after modification.
  • When executing conda activate roborobo * error: the shell (e.g. bash) is not configured.
    • solution 1: conda init bash. This may fail if your bash profile has been badly written. Fix: clean your bash profile
    • solution 2: use another shell. E.g. tcsh. I.e. restart installation from scratch. In the terminal, type tcsh before the command conda activate roborobo (during installation, and afterwards when coding).
  • When executing python3 -m pip install . --force --user -v
    • => error during execution "could NOT find SDL2" (hidden somewhere in the very long list of messages)
    • system install of SDL2 (must be super user). See apt commands above.
  • When executing python3 -m pip install . --force --user -v
    • error referring to Sphinx (Sphinx is used for generating the documentation)
      • easy fix (recommended): remove reference to Sphinx in setup.py (delete line 7 and remove 'build_sphinx': BuildDoc from line 64)
      • easy fix (not recommended): switch to a different version of Python (e.g. away from 3.10)
  • When executing python3 -m pip install . --force --user -v
    • error: problem with missing MESA/GLX (this is related to the OpenGL graphic library and its open-source implementation in Linux systems).
    • solution (see above): apt-get install -y mesa-utils libgl1-mesa-glx
  • When executing python setup.py install --force --use -v
    • error: "setup.py install is deprecated." (this should not happen if you follow the tutorial)
    • You tried to run setup.py. Contrary to what the message says, setup.py isn't deprecated but can no longer be used directly.
    • Solution (see above): python3 -m pip install . --force --user -v
    • Comment: it can be pretty long. Be sure to use the -v option for verbose mode.
  • When executing python setup.py install --force --use -v
    • error: "func.h:55:58: error: expected template-name before '<' token" or "Deprecated function in roborobo4/include/contrib/zsu/func.h, line 55"
    • cause: recent compiler may spot a deprecated function in roborobo4/include/contrib/zsu/func.h, line 55
    • solution: roborobo4/include/contrib/zsu/func.h, line 55, replace:
      • new: class unary_function_binder: public std::__unary_function<_Result, _Arg>
      • old: class unary_function_binder: public std::unary_function<_Result, _Arg>
  • When executing python3 tutorial.py (or any other examples)
    • error: "no module name 'pyRoborobo'"
    • first, be sure to check that you followed every step of the installation tutorial. If this is the case, then try the following.
    • Solution 1: be sure that you have activated the conda environment (prefix of prompt should read something like (roborobo))
    • Solution 2: this may be a tricky problem of mismatch Python versions from Conda and command-line. Use same python versions (i.e.: update Conda, or use specific Python version in command line). Comment: Conda's Python and default Python command uses different versions. Check with conda list | grep python and python --version. They should be the same.
  • When executing python tutorial.py (or any other examples)
    • error looks like: ImportError: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0
    • fix looks like: solution: export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7
  • As of early 2024, Mac M2 does not seem to be able to run Roborobo. You may use Virtualbox to install a Linux OS but this is still in beta for Mac M1/M2 as of early 2024. Check dedicated topic on virtualbox forum for updates on the topic. Alternatively, you can use Parallels Desktop (but it is not free).

Thank you for using Roborobo!

About

Roborobo v.4 - super fast multi-robot simulator for evolutionary swarm robotics and multi-agent learning. Combines ease-of-use (python interface) with speed (C++ core engine).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published