\page install Installation
These instructions are for installing only Gazebo. If you're interested in using all the Gazebo libraries, not only Igniton Gazebo, check out this Gazebo installation.
We recommend following the binary install instructions to get up and running as quickly and painlessly as possible.
The source install instructions should be used if you need the very latest software improvements, if you need to modify the code, or if you plan to make a contribution.
Throughout this tutorial, be sure to replace <#>
with a number value, such as
5 or 6, depending on which version you need.
The binary install method will use pre-built packages which are typically available through a package management utility such as Apt. This approach eliminates the need to download and compile source code, and dependencies are handled for you. The downside of a binary install is that you won't be able to modify the code. See Source Install for information on installing Gazebo from source.
- Configure package repositories.
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
- Install Gazebo
sudo apt-get install libgz-sim<#>-dev
- On macOS, add OSRF packages:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap osrf/simulation
- Install Gazebo:
brew install gz-sim<#>
Install from source if you're interested in changing the source code or need a feature which hasn't been released yet.
- Install tools
sudo apt install -y build-essential cmake git gnupg lsb-release wget
- Enable the Gazebo software repositories:
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
- Clone repository
git clone https://github.com/gazebosim/gz-sim -b gz-sim<#>
- Install package dependencies (including other Gazebo libraries):
sudo apt -y install \
$(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | tr '\n' ' '))
- Configure and build.
cd gz-sim
mkdir build
cd build
cmake ../
make
- Clone the repository
git clone https://github.com/gazebosim/gz-sim -b gz-sim<#>
- Install dependencies
brew install --only-dependencies ignition-gazebo<#>
- Configure and build
cd gz-sim
mkdir build
cd build
cmake ..
make
- Optionally, install
sudo make install
API documentation and tutorials can be accessed at https://gazebosim.org/libs/gazebo
You can also generate the documentation from a clone of this repository by following these steps.
- You will need Doxygen. On Ubuntu Doxygen can be installed using
sudo apt-get install doxygen
- Clone the repository
git clone https://github.com/gazebosim/gz-sim
- Configure and build the documentation.
cd gz-sim
mkdir build
cd build
cmake ../
make doc
- View the documentation by running the following command from the
build
directory.
firefox doxygen/html/index.html
Follow these steps to run tests and static code analysis in your clone of this repository.
-
Follow the source install instructions.
-
Run tests.
make test
- Static code checker.
sudo apt-get update && sudo apt-get -y install cppcheck
make codecheck