Skip to content

Installation Instructions for Revolve

Aart Stuurman edited this page Sep 14, 2021 · 67 revisions

This page describes how to set and start up the Revolve framework.

1. Install simulator prerequisites

Installed all the necessary prerequisites described in Installation Instructions for Gazebo, then you can proceed with the setup instructions on this page.

2. Install revolve prerequisites

Most branches now have Multineat as a hard depencency, you may need to install it system wise:

mkdir cmake-build-multineat
cd cmake-build-multineat
cmake ../thirdparty/MultiNEAT -DCMAKE_BUILD_TYPE=Release
make -j4
make install

Other OS specific instructions can be found below: [ Ubuntu . Fedora . Mac OS X ]

Ubuntu

  1. Install the required dependencies for Revolve:

    sudo apt-get install git                          \
                         cmake                        \
                         libprotoc-dev                \
                         protobuf-compiler            \
                         libboost-thread-dev          \
                         libboost-signals-dev         \
                         libboost-system-dev          \
                         libboost-filesystem-dev      \
                         libboost-program-options-dev \
                         libboost-regex-dev           \
                         libboost-iostreams-dev       \
                         libgsl-dev                   \
                         libignition-cmake-dev        \
                         libignition-common-dev       \
                         libignition-math4-dev        \
                         libignition-msgs-dev         \
                         libignition-fuel-tools1-dev  \
                         libignition-transport4-dev   \
                         libsdformat6-dev             \
                         libsimbody-dev               \
                         libnlopt-dev                 \
                         libyaml-cpp-dev              \
                         virtualenv                   \
                         python3.7                    \
                         python3.7-dev                \
                         graphviz                     \
                         libcairo2-dev                \
                         python3-cairocffi            \
                         libeigen3-dev
    #TODO boost-python3-devel

    Depending on your Ubuntu version some packages may be unable to locate. This may or may not be a problem, just keep track of these package names.

  2. Go to the next step to install Revolve

Fedora

  1. Install the required dependencies for Revolve:

    sudo dnf install cmake               \
                     extra-cmake-modules \
                     protobuf-devel      \
                     protobuf-c-devel    \
                     boost-devel         \
                     gsl-devel           \
                     yaml-cpp-devel      \
                     gazebo-devel        \
                     bullet-devel        \
                     python3-virtualenv  \
                     NLopt-devel         \
                     boost-python3-devel \
                     python3-devel       \
                     cairo-devel
  2. Go to the next step to install Revolve

Mac OS X

  1. Install most of the dependencies using brew:

    brew install boost               \
                 cmake               \
                 git                 \
                 gsl                 \
                 protobuf protobuf-c \
                 sdformat6           \
                 eigen               \
                 yaml-cpp            \
                 boost-python3       \
                 opencv              \
                 libpqxx
  2. Install virtualenv:

     MN_BUILD=boost pip3 install virtualenv

If you get troubles installing pycairo, this could be the issue:

libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
  1. Go to the next step to install Revolve

3. Install Revolve

  1. Clone the Revolve project locally:

    git clone https://github.com/ci-group/revolve.git --recursive

    Note Missing libraries or packages in later steps can indicate that something went wrong here! Make sure you cloned recursively.

  2. Build the C++ part of the project:

    cd revolve/
    export REV_HOME=`pwd`    
    mkdir -p build && cd build
    cmake .. -DCMAKE_BUILD_TYPE="Release"
    make -j4

    For Mac: There is a known issue in gazebo11. https://github.com/osrf/homebrew-simulation/issues/1486. Before building, set the following:

    export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/tbb@2020_u3
    export CPATH=${CPATH}:/usr/local/opt/tbb@2020_u3/include
    export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/tbb@2020_u3/lib
    

    More for Mac: This tutorial recommends installing gazebo11. Revolve is programmed for gazebo10, but with a small change you can use 11. In revolve/gazebo/CMakeLists.txt search for find_package(gazebo 10 and change 10 to 11. There should be two occurences in the file. After this everything should work fine.

    Note: pkg-config errors during cmake can be caused by a wrong search path for the required *.pc file(s). To check the default search path use the following command: pkg-config --variable pc_path pkg-config. To change the current search path use: export PKG_CONFIG_PATH=<directory_of_*.pc_file(s)>

  3. Create a Python virtual environment:

    cd $REV_HOME
    virtualenv --python python3.7 .venv
    source .venv/bin/activate

    Note: Keep in mind that your virtual environment should be set for Python 3, not Python 2.

    After you source the Python virtual environment, on the very left side of the active line in your terminal, the (.venv) marking will appear. This designates that the virtual environment is active. In all future terminal commands that should be run from the virtual environment, this marking will be added at the beginning of the command to acknowledge this.

    Warning: (.venv) should not be copied with the command!

    (.venv) MN_BUILD=boost pip install -r requirements.tx

    If you failed to build pycairo in ubuntu, try with the following commands:

    sudo apt-get install pkg-config
    sudo apt-get install libcairo2-dev
    

    If at the next steps multineat cannot be found by python, the following steps might solve your problem:

    • cd .venv/lib/python*/site-packages/multineat
    • pwd
    • note absolute path and use it in the next step
    • cd ../../../../..
    • cd .venv/lib64/python*/site-packages/multineat
    • ln -s <abspath_from_earlier>/_multineat.so _multineat.so

    The _multineat library was installed in the wrong directory, so you just made a symbolic link from the correct directory to the library file.

  4. Verify the build

    (.venv) ./revolve.py

    The result of this command should be visible in the terminal:

    Created Supervisor with:
            - manager command: None ['--restore-directory', 'output/20190211165349']
            - gazebo command: gzserver ['--verbose']
            - world file: worlds/gait-learning.world
            - gazebo plugin dir: .../projects/revolve-simulator-upgraded/revolve/build/lib
            - gazebo models dir: .../projects/revolve-simulator-upgraded/revolve/models
    
    NOTE: launching only a simulator, not a manager script!
    
    Launching the simulator...
    [simulator-launch] Gazebo multi-robot simulator, version 6.5.1
    [simulator-launch] Copyright (C) 2012-2015 Open Source Robotics Foundation.
    [simulator-launch] Released under the Apache 2 License.
    [simulator-launch] http://gazebosim.org
    [simulator-launch] 
    [simulator-launch] Gazebo multi-robot simulator, version 6.5.1
    [simulator-launch] Copyright (C) 2012-2015 Open Source Robotics Foundation.
    [simulator-launch] Released under the Apache 2 License.
    [simulator-launch] http://gazebosim.org
    [simulator-launch] 
    [simulator-launch] [Msg] transport::init() host:0
    [simulator-launch] [Msg] transport::init() hostlocalhost:11345
    [simulator-launch] [Msg] Waiting for master.
    [simulator-launch] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
    [simulator-launch] [Msg] Publicized address: 192.168.1.47
    [simulator-launch] World plugin loaded.
    

    You can stop the execution with Control+C keyboard shortcut.

  5. Verify the build with a visualised simulator

    (.venv) ./revolve.py --simulator-cmd=gazebo

    The result of this command should be:

    Created Supervisor with:
            - manager command: None ['--simulator-cmd=gazebo', '--restore-directory', 'output/20190211165447']
            - gazebo command: gazebo ['--verbose']
            - world file: worlds/gait-learning.world
            - gazebo plugin dir: .../projects/revolve-simulator-upgraded/revolve/build/lib
            - gazebo models dir: .../projects/revolve-simulator-upgraded/revolve/models
    
    NOTE: launching only a simulator, not a manager script!
    
    Launching the simulator...
    [simulator-launch] Gazebo multi-robot simulator, version 6.5.1
    [simulator-launch] Copyright (C) 2012-2015 Open Source Robotics Foundation.
    [simulator-launch] Released under the Apache 2 License.
    [simulator-launch] http://gazebosim.org
    [simulator-launch] 
    [simulator-launch] Gazebo multi-robot simulator, version 6.5.1
    [simulator-launch] Copyright (C) 2012-2015 Open Source Robotics Foundation.
    [simulator-launch] Released under the Apache 2 License.
    [simulator-launch] http://gazebosim.org
    
    [simulator-launch] [Msg] transport::init() host:0
    [simulator-launch] [Msg] transport::init() hostlocalhost:11345
    [simulator-launch] [Msg] Waiting for master.
    [simulator-launch] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
    [simulator-launch] [Msg] Publicized address: 192.168.1.47
    [simulator-launch] World plugin loaded.
    libpng warning: iCCP: known incorrect sRGB profile
    

Congratulations! You Revolve kit is set up and running. Now you can start running existing experiments or start writing your own.

Note: We can pass various different parameters to Revolve to change the behaviour of execution. If you want to have a full overview of all possible parameters, type ./revolve.py --help.


See next: Tutorials


_________________
/ Premature      \
| optimization   |
| is the root of |
| all evil.      |
|                |
\ -- D.E. Knuth  /
-----------------
    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
Clone this wiki locally