1.3/install

From Gazebo Wiki
Jump to: navigation, search

Contents

Tutorial: Install

Important Notes: EVERYONE READ

  1. ROS Users:
    1. Only install Gazebo from here, and only follow tutorials from this website. Documentation on ros.org for Gazebo is old and not actively maintained.
    2. G-Turtle will be the last release of ROS to pull in version of Gazebo. As of H-Turtle, ROS will use the standalone version of Gazebo.
  2. If you are new to Gazebo or just want to use Gazebo as a stand-alone application, select the Pre-compiled binaries or Tarball instructions below.
  3. If you're still reading, select a download method below.

Pre-compiled binaries

Ubuntu Linux 12.04 (precise)

  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.

    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/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-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/gazebo.key -O - | sudo apt-key add -
    
  4. Update apt-get and install Gazebo.

    sudo apt-get update
    sudo apt-get install gazebo
    
  5. Check your installation

    . /usr/share/gazebo-1.3/setup.sh
    gazebo
    

Note: setup.sh can fails exporting paths. In this case, try adding it to .bashrc:

    echo "source /usr/share/gazebo-1.3/setup.sh" >> ~/.bashrc
    source ~/.bashrc

Gentoo

Note: This is a work in progress

sudo emerge --noreplace layman git
sudo layman -a ezod
sudo emerge gazebo

Issues:

  1. The official Portage tree doesn't have an ebuild for OGRE 1.7.1 or later yet, so you will also need to add the "gamerlay" overlay (which contains an ebuild for OGRE 1.7.3).
  2. Similarly, there is no ebuild for Player in the official tree, but one is available in the "science" overlay. Compiling with Player support is optional and controlled via the "player" USE flag.

Tarball

  1. Download the .tar.gz from the Repository page.
  2. Open a terminal and change directory to the location of the downloaded tarball.
  3. Unpack the tarball

    tar -xvf gazebo_1.3.0-0ubuntu5.tar.gz
    
  4. Change directory into the Gazebo sources

    cd gazebo-1.3.0
    
  5. Continue with the Compiling From Source section below

Mercurial

  1. Clone the repository

    hg clone https://bitbucket.org/osrf/gazebo gazebo
    
  2. Change directory in the repository

    cd gazebo
    
  3. Continue with the Compiling From Source section below

Compiling From Source

WARNING

The pre-compiled binaries install in /usr/bin/gazebo. By default, source installation will be performed in /usr/local/bin/gazebo. If you install the pre-compiled binaries on a system that has gazebo installed in /usr/local/bin, YOU MUST REMOVE gazebo from /usr/local (otherwise the os will try to load dynamic libs from your source install into your pre-compiled gazebo). It is a good idea to consider using CMAKE_INSTALL_PREFIX to install your compiled version in a different directory than /usr/local.

Instructions

  1. Download the source code using Mercurial or a Tarball.

  2. Install prerequisites. A clean Ubuntu system will need:

    sudo apt-get install build-essential libtinyxml-dev libtbb-dev libxml2-dev libqt4-dev pkg-config  libprotoc-dev libfreeimage-dev libprotobuf-dev protobuf-compiler libboost-all-dev freeglut3-dev cmake libogre-dev libtar-dev libcurl4-openssl-dev
    
  3. Create a build directory

    mkdir build
    
  4. Change directory in the new build directory

    cd build
    
  5. Configure Gazebo (choose either method a or b below)

    a. Release mode: This will generate optimized code, but will not have debug symbols. Use this mode if you don't need to use GDB.

       cmake ../
    

    b. Debug mode: This will generate code with debug symbols. Gazebo will run slower, but you'll be able to use GDB.

       cmake -DCMAKE_BUILD_TYPE=DEBUG ../
    
  6. The output from cmake ../ may generate a number of errors about missing packages. You must install these missing packages and re-run cmake ../. Make sure all the build errors are resolved before continuing (they should be there from the earlier step in which you installed prerequisites).

  7. Make note of your install path, which is output from cmake and should look like:

      -- Install path: /home/$USER/local
    

    You can specify the the install path on the command line by defining the CMAKE_INSTALL_PREFIX :

       cmake -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=/home/$USER/local ../
    
  8. Build Gazebo

    make
    

    Note: You can decrease compile time by using more cores

        make -jX
    

    Where X is the number of cores you want to use.

  9. Install Gazebo

    make install
    
  10. Setup environment variables

    If you decide to install gazebo in a local directory

    echo "export LD_LIBRARY_PATH=<install_path>/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
    echo "export PATH=<install_path>/local/bin:$PATH" >> ~/.bashrc
    echo "export PKG_CONFIG_PATH=<install_path>/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> ~/.bashrc
    echo "source <install_path>/share/gazebo-1.3/setup.sh" >> ~/.bashrc
    source ~/.bashrc
    

    If Gazebo was installed to /usr (which is the default) then:

    echo "source /usr/share/gazebo-1.3/setup.sh" >> ~/.bashrc
    source ~/.bashrc
    
  11. Now try running gazebo:

    gazebo
    
Personal tools
Namespaces

Variants
Actions
Navigation
DRC Simulator
Cloud Sim
FIRST Simulation
Gzweb
Toolbox