Skip to content

Installation Instructions for Revolve

Matteo De Carlo edited this page Aug 21, 2019 · 48 revisions

This page describes how to set and start up the Revolve framework. If you installed all the necessary prerequisites described in Installation Instructions for Gazebo, then you can proceed with the setup instructions on this page.

[ Ubuntu . Fedora . Mac OS X ]

Install prerequisites on 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               \
                         libyaml-cpp-dev              \
                         virtualenv                   \
                         python                       \
                         libcairo2-dev
  2. Go to the next step to install Revolve

Install prerequisites on 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  \
                     boost-python3-devel \
                     cairo-devel
  2. Go to the next step to install Revolve

Install prerequisites on Mac OS X

  1. Install most of the dependencies using brew:

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

     pip 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

Set up Revolve

  1. Clone the Revolve project locally:

    git clone https://github.com/ci-group/revolve.git
  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
  3. Create a Python virtual environment:

    cd $REV_HOME
    virtualenv --python python3 .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) pip install -r requirements.txt
  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