1.6/install


 * 1) Tutorial: Download and Install#


 * 1) 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. 1. ROS Groovy will be the last release of ROS to pull in its own version of Gazebo. As of ROS Hydro, ROS will use the standalone version of Gazebo. 1. If you are new to Gazebo or just want to use Gazebo as a stand-alone application in Ubuntu, select the Pre-compiled binaries instructions below. 1. If you're still reading, select the mercurial (recommended) or  tarball download method below.


 * 1) Pre-compiled binaries #


 * 1) Ubuntu Debians ###

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

1. Setup your computer to accept software from packages.osrfoundation.org.

**Ubuntu Linux 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/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list'

**Ubuntu Linux 12.10 (quantal)**

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/gazebo/ubuntu quantal main" > /etc/apt/sources.list.d/gazebo-latest.list'

1. 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 -

1. Update apt-get and install Gazebo.

sudo apt-get update sudo apt-get install gazebo

1. Check your installation

. /usr/share/gazebo/setup.sh       gzserver

1. The first time `gzserver` is executed requires the download of some models and it could take some time, please be patient. Wait until you see a message like `Publicized address: ...` and then execute a `gazebo client`:

gzclient

Note: setup.sh can fail exporting paths. In this case, try adding it to .bashrc: echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc source ~/.bashrc


 * 1) Compiling From Source #


 * 1) Prerequisites ###

Make sure you have removed the Ubuntu pre-compiled binaries before installing from source

sudo apt-get remove gazebo

If you have previously installed from source, be sure you are installing to the same path location or that you have removed the previous installation from source version manually.

As a side note, default install locations:
 * Pre-compiled Ubuntu Binaries : /usr/bin/gazebo
 * Default source install : /usr/local/bin/gazebo


 * 1) Download via Mercurial ###

This is the recommended method

1. Clone the repository

hg clone https://bitbucket.org/osrf/gazebo gazebo

1. Change directory in the repository

cd gazebo

The default branch is the development branch where you'll find the bleeding edge (and potentially unstable) code, your repo should already be on this branch by default. Check with the command:

hg branch

1. Continue with the Compile Instructions section below


 * 1) Download via Tarball ###

This method is not recommended

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

tar -xvf gazebo_1.6.0.tar.gz

1. Change directory into the Gazebo sources

cd gazebo-1.6.0

1. Continue with the Compile Instructions section below


 * 1) Compile Instructions ###

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

1. 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 sudo apt-get install libprotobuf-dev protobuf-compiler libboost-all-dev freeglut3-dev cmake libogre-dev libtar-dev sudo apt-get install libcurl4-openssl-dev libcegui-mk2-dev

Bullet Support (Optional) available since Gazebo 1.5. Bullet version 2.81 is needed for this. In an Ubuntu system (precise or quantal) the osrf repo can be used to install the proper package. Be sure of changing precise by quantal if you are using the later.

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list' sudo apt-get update sudo apt-get install libbullet-dev

URDF Support (Optional) support for the Universal Robot Description Format is available for robots that have been setup with ROS. To compile with URDF support, first install a recent version of ROS (>= Fuerte) and make sure /opt/ros/ROS_VERSION/setup.bash has been sourced in your terminal.

GUI test Support (Optional) To correctly parse the results of GUI regression tests, the xsltproc package is needed.

sudo apt-get install xsltproc

1. Create a build directory

mkdir build

1. Change directory in the new build directory

cd build

1. 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 ../ 1. The output from `cmake ../` may generate a number of errors and warnings about missing packages. You must install the missing packages that have errors 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). Warnings alert of optional packages that are missing.

1. 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 ../

1. 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. 1. Install Gazebo

sudo make install

1. Setup environment variables

If you decide to install gazebo in a local directory

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

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

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

1. Now try running gazebo:

gazebo

If Gazebo runs successfully, you're done!. If Gazebo was installed to `/usr` and running gazebo throws an error similar to:

gazebo: error while loading shared libraries: libgazebo_common.so.1: cannot open shared object file: No such file or directory

, then `/usr/local/lib` is not in load path (default behavior for Ubuntu). Run the following commands and then try running gazebo again:

echo '/usr/local/lib' | sudo tee /etc/ld.so.conf.d/gazebo.conf sudo ldconfig


 * 1) Uninstalling Source-based Install

If you need to uninstall Gazebo or switch back to a debian-based install of Gazebo when you currently have installed Gazebo from source, navigate to your source code directory's build folder and run make uninstall:

cd ~/gazebo-1.x.x/build sudo make uninstall