DRC/Install

From Gazebo Wiki
Jump to: navigation, search

Contents

DRC Simulator Installation

This page explains how to install the DRC Simulator.

Pre-compiled binaries

Ubuntu Linux

Note: as of drcsim 2.2.0, binary packages are available for 64-bit systems only. A 32-bit version is still available as source, but 64-bit is required to run the BDI walking controller.

First time setup

If this is your first time installing the simulator, there's some system configuration that you need to do.

  1. Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

  2. Setup your computer to accept software from packages.osrfoundation.org and packages.ros.org (the DRC Simulator uses some parts of ROS).

    Ubuntu 12.04 (precise)

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
    sudo sh -c 'echo "deb http://packages.osrfoundation.org/drc/ubuntu precise main" > /etc/apt/sources.list.d/drc-latest.list'
    

    Ubuntu 12.10 (quantal) (since drcsim-2.2)

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu quantal main" > /etc/apt/sources.list.d/ros-latest.list'
    sudo sh -c 'echo "deb http://packages.osrfoundation.org/drc/ubuntu quantal main" > /etc/apt/sources.list.d/drc-latest.list'
    
  3. Retrieve and install the keys for the ROS and DRC repositories.

    wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
    wget http://packages.osrfoundation.org/drc.key -O - | sudo apt-key add -
    
  4. Update apt-get and install the DRC Simulator.

    sudo apt-get update
    sudo apt-get install drcsim
    

Upgrading

If you have a previous version of the simulator installed, upgrading is easy:

    sudo apt-get update
    sudo apt-get install gazebo drcsim

Note that we explicitly mention gazebo in the install line to ensure that we'll get the newest version of it, too.

Running

Now that everything is installed, here's how to run it:

  1. Configure your environment. You need to do this in every shell where you run drcsim software (you might want to add it to your ~/.bashrc or equivalent).

    source /usr/share/drcsim/setup.sh
    

    For drcsim < 1.3.0: you need to source the setup file from a versioned directory. E.g., for drcsim 1.2.X, you would do this:

    # OLDER VERSIONS ONLY
    source /usr/share/drcsim-1.2/setup.sh
    

    If you get "Warning: failed to find Gazebo's setup.sh. You will need to source it manually.", do as described here

  2. To run the DRC Simulator, try the default launch file:

    roslaunch atlas_utils atlas.launch
    

    For drcsim < 1.3.0: The package and launch file had a different name:

    # OLDER VERSIONS ONLY
    roslaunch drc_robot_utils drc_robot.launch
    

Note that the robot launches with an extremely simple controller running only on the ankle joints, and thus will appear to "wobble" back and forth, and may eventually fall down. If this happens, click "Edit->Reset Model Poses" to set the robot back on its feet. This simplistic "standing" controller is just a placeholder; it is meant to be replaced by your own control software.

Also, at the time of writing, the simulation will start with the robot "pinned" to the world for 10 (simulated seconds) before the controllers will engage.

Other platforms (TODO)

Please help us by contributing patches and configuration to build packages on your favorite platform!

Compiling from source

Ubuntu Linux

Here we'll explain how to build both gazebo and drcsim from source. You could just build drcsim from source starting with the binary installation of gazebo, if you like.

  1. Configure your system to install packages from ROS Fuerte. E.g., on precise:

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
    wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
    
  2. Install compile-time prerequisites:

    sudo apt-get update
    # Install gazebo's dependencies
    sudo apt-get install -y cmake debhelper libfreeimage-dev libprotoc-dev \
                         libprotobuf-dev protobuf-compiler freeglut3-dev \
                         libcurl4-openssl-dev libtinyxml-dev libtar-dev \
                         libtbb-dev libogre-dev libxml2-dev pkg-config \
                         libqt4-dev ros-fuerte-urdfdom ros-fuerte-console-bridge \
                         libltdl-dev libboost-thread-dev libboost-signals-dev \
                         libboost-system-dev libboost-filesystem-dev \
                         libboost-program-options-dev libboost-regex-dev \
                         libboost-iostreams-dev robot-player-dev libcegui-mk2-dev \
                         libavformat-dev libavcodec-dev libswscale-dev libbullet-dev
    # Install osrf-common's dependencies
    sudo apt-get install -y cmake debhelper ros-fuerte-ros ros-fuerte-ros-comm
    # Install sandia-hand's dependencies
    sudo apt-get install -y cmake debhelper ros-fuerte-xacro ros-fuerte-ros \
                         libboost-dev ros-fuerte-image-common \
                         ros-fuerte-ros-comm ros-fuerte-common-msgs \
                         avr-libc gcc-avr libqt4-dev
    # Install drcsim's dependencies
    sudo apt-get install -y cmake debhelper ros-fuerte-pr2-mechanism \
                         ros-fuerte-std-msgs ros-fuerte-common-msgs \
                         ros-fuerte-image-common ros-fuerte-geometry \
                         ros-fuerte-pr2-controllers ros-fuerte-geometry-experimental \
                         ros-fuerte-robot-model-visualization ros-fuerte-image-pipeline \
                         ros-fuerte-image-transport-plugins
    
  3. Retrieve the code for gazebo, osrf-common, sandia-hand, and drcsim

    Release tarballs: The best place to go for the code is the distribution archive, which has a source .tar.bz2 file for each version that has been released. It's usually best to pick the latest versions of each package from that archive.

    Repository: If you're feeling brave (or if you plan to do development with this software, you can get the latest code from the Mercurial repositories:

    hg clone https://bitbucket.org/osrf/gazebo
    hg clone https://bitbucket.org/osrf/osrf-common
    hg clone https://bitbucket.org/osrf/sandia-hand
    hg clone https://bitbucket.org/osrf/drcsim
    

    You'll probably want to be using particular branches of each repository; if you need help on this issue, post to the Q&A forum.

  4. Configure, build, and install gazebo, telling it to look in /opt/ros/fuerte, which is where it'll find urdfdom. If you have an N-core machine, you'll get a faster build by passing -jN, e.g. make -j8. Also, local installations are possible, using the standard CMAKE_INSTALL_PREFIX variable; we don't cover that use case here as it involves setting a number of environment variables.

    cd gazebo
    mkdir build
    cd build
    CMAKE_PREFIX_PATH=/opt/ros/fuerte cmake ..
    make
    sudo make install
    
  5. Configure, build, and install osrf-common:

    cd osrf-common
    . /opt/ros/fuerte/setup.sh
    # osrf-common needs to be in ROS_PACKAGE_PATH when it builds
    export ROS_PACKAGE_PATH=`pwd`:$ROS_PACKAGE_PATH
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    
  6. Configure, build, and install sandia-hand:

    cd sandia-hand
    . /opt/ros/fuerte/setup.sh
    # osrf-common and sandia-hand needd to be in ROS_PACKAGE_PATH when building
    export ROS_PACKAGE_PATH=`pwd`:`pwd`/../osrf-common:$ROS_PACKAGE_PATH
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    
  7. Configure, build, and install drcsim, first pulling in ROS's and gazebo's configuration.

    cd drcsim
    mkdir build
    cd build
    . /opt/ros/fuerte/setup.sh
    . /usr/local/share/gazebo/setup.sh
    cmake ..
    make
    sudo make install
    
  8. To run the DRC Simulator, first source the drcsim shell configuration file, then launch it:

    . /usr/local/share/drcsim/setup.sh
    roslaunch atlas_utils atlas.launch
    
    # for drcsim < 1.3, insert version number at 1.x, e.g.:
    #   . /usr/local/share/drcsim-1.2/setup.sh
    # for drcsim < 1.0.3, uncomment below if you have good internet connection to use the online model database
    #   export GAZEBO_MODEL_DATABASE_URI=http://gazebosim.org/models
    # for drcsim < 1.3, the package and launch files are named differently:
    #   roslaunch drc_robot_utils drc_robot.launch
    

    Note that if you installed dependencies manually, make sure to set your LD_LIBRARY_PATH to point to them. For example, if ogre library files were installed as /home/john/local/my_libraries/libOgre*.so, then you should export LD_LIBRARY_PATH=/home/john/local/my_libraries:${LD_LIBRARY_PATH}. Similarly, if you compiled gazebo with urdf support from ros-fuerte-urdfdom* and ros-fuerte-console-bridge packages, you'll have to

    export LD_LIBRARY_PATH=/opt/ros/fuerte/lib:${LD_LIBRARY_PATH}
    

Other platforms (TODO)

Please help us by contributing patches and configuration to build from source on your favorite platform!

Personal tools
Namespaces

Variants
Actions
Navigation
DRC Simulator
Cloud Sim
Toolbox