These instructions are for installing only Gazebo Rendering. If you're interested in using all the Gazebo libraries, 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, you need to modify the code, or you plan to make a contribution.
Ubuntu
Binary Installation
Install dependencies:
Setup your computer to accept software from packages.osrfoundation.org:
Setup keys:
Install:
Be sure to replace <#>
with a number value, such as 7
or 8
, depending on which version you need.
Source Installation
Prerequisites
Ubuntu Focal 20.04 or above:
Install dependencies:
Supported Rendering Engines
Gazebo Rendering will look for rendering libraries installed in the system and build the relevant plugins if dependencies are found.
OGRE 1.x
OGRE-Next 2.x
Add OSRF packages if you have not done so already:
Install OGRE-Next 2.3 debs
OptiX (experimental)
Download and install by following instructions on NVIDIA website
CUDA: http://docs.nvidia.com/cuda
OptiX: https://developer.nvidia.com/optix
Update LD_LIBRARY_PATH
and add an OPTIX_INSTALL_DIR
environment variables so that gz-rendering can find Optix, e.g. if you installed version 4.0.2 in HOME/optix:
Note: If you encounter errors about different exception specifiers in optix math when building Gazebo Rendering OptiX plugin, edit [optix_install_dir]/include/optixu/optixu_math_namespace.h
and comment out the section that defines fminf
, fmaxf, and copysignf
(for optix sdk 4.0.2, comment out lines 167-206).
Build from Source
- Clone the repository # Optionally, append `-b gz-rendering#` (replace # with a number) to check out a specific versiongit clone http://github.com/gazebosim/gz-rendering
- Configure and build Replacecd gz-renderingmkdir buildcd buildcmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dirmake
/path/to/install/dir
to whatever directory you want to install this package to - Optionally, install make install
Windows
Install Prerequisites
First, follow the source installation tutorial until step 5 included for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment.
Navigate to condabin
if necessary to use the conda
command (i.e., if Conda is not in your PATH
environment variable. You can find the location of condabin
in Anaconda Prompt, where conda
).
Create if necessary, and activate a Conda environment:
Binary Installation
Be sure to replace <#>
with a number value, such as 7 or 8, depending on which version you need.
Source Installation
This assumes you have created and activated a Conda environment while installing the Prerequisites.
Install Gazebo dependencies:
You can view available versions and their dependencies:
conda search libgz-rendering* --channel conda-forge --infoInstall dependencies, replacing
<#>
with the desired versions:conda install libgz-cmake<#> libgz-common<#> libgz-math<#> libgz-plugin<#> --channel conda-forge- Navigate to where you would like to build the library, and clone the repository. # Optionally, append `-b gz-rendering#` (replace # with a number) to check out a specific versiongit clone https://github.com/gazebosim/gz-rendering.git
- Configure and build cd gz-renderingmkdir buildcd buildcmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\installcmake --build . --config Release
- Optionally, install cmake --install . --config Release
macOS
Binary Installation
Install Homebrew.
Add OSRF packages:
Install Gazebo Rendering:
Be sure to replace <#>
with a number value, such as 8 or 9, depending on which version you need.
Source Installation
- Clone the repository Be sure to replacegit clone https://github.com/gazebosim/gz-rendering -b gz-rendering<#>
<#>
with a number value, such as 7 or 8, depending on which version you need. - Install dependencies Be sure to replacebrew install --only-dependencies gz-rendering<#>
<#>
with a number value, such as 7 or 8, depending on which version you need. - Configure and build cd gz-renderingmkdir buildcd buildcmake ..make
- Optionally, install sudo make install
Documentation
API documentation can be generated using Doxygen
Build documentation
View documentation
Testing
Tests can be run by building the test
target:
Most tests can be run against multiple render engine configurations (if available). To control the testing configuration, use the following environment variables:
A full invocation of a test would be
Additionally, each test is registered with ctest
for each engine/backend configuration available at build time. These can then be filtered with the ctest
command line.