These instructions are for installing only Gazebo Plugin. If you're interested in using all the Gazebo libraries, check out this Gazebo installation.
We recommend following the Binary Installation instructions to get up and running as quickly and painlessly as possible.
The Source Installation 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
Prerequisites
Ubuntu Focal or higher.
If you don't already have the lsb-release
package installed, please do so now:
Setup your computer to accept software from packages.osrfoundation.org:
Setup keys:
Binary Installation
On Ubuntu systems, apt-get
can be used to install gz-plugin
:
Source Installation
- Install Gazebo dependencies sudo apt-get install libgz-cmake4-dev libgz-tools2-dev libgz-utils3-cli-dev
- Install Gazebo Tools if you want to use the
gz plugin
command line tool:sudo apt-get install gz-tools2 - Clone the repository # Optionally, append `-b gz-plugin#` (replace # with a number) to check out a specific version# From version 2 use `gz-plugin#`, lower versions `ign-plugin#`git clone https://github.com/gazebosim/gz-plugin
- Configure and build cd gz-pluginmkdir buildcd buildcmake ..make
- Optionally, install sudo make install
macOS
Prerequisites
Gazebo Plugin and several of its dependencies can be installed on macOS with Homebrew using the osrf/simulation tap. Gazebo Plugin versions 1+ require macOS High Sierra (10.13) or later, while version 0 supports Sierra (10.12) or later.
Binary Installation
- Install Homebrew, which should also prompt you to install the XCode command-line tools ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Run the following commands brew tap osrf/simulationbrew install gz-plugin3
Source Installation
- Install dependencies brew tap osrf/simulationbrew install gz-plugin3 --only-dependencies
- Clone the repository # Optionally, append `-b gz-plugin#` (replace # with a number) to check out a specific version# From version 2 use `gz-plugin#`, lower versions `ign-plugin#`git clone https://github.com/gazebosim/gz-plugin
- Configure and build cd gz-pluginmkdir buildcd buildcmake ..make
- Optionally, install sudo make install
Windows
Prerequisites
First, follow the gz-cmake tutorial for installing Conda, Visual Studio, CMake, and other prerequisites, and also for 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 2 or 3, 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-plugin* --channel conda-forge --infoInstall dependencies, replacing
<#>
with the desired version:conda install libgz-cmake<#> --channel conda-forge- Navigate to where you would like to build the library, and clone the repository. # Optionally, append `-b gz-plugin#` (replace # with a number) to check out a specific version# From version 2 use `gz-plugin#`, lower versions `ign-plugin#`git clone https://github.com/gazebosim/gz-plugin
- Configure and build cd gz-pluginmkdir buildcd buildcmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\installcmake --build . --config Release
- Optionally, install cmake --install . --config Release
Documentation
API documentation and tutorials can be accessed at Gazebo website
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 # Optionally, append `-b gz-plugin#` (replace # with a number) to check out a specific version# From version 2 use `gz-plugin#`, lower versions `ign-plugin#`git clone https://github.com/gazebosim/gz-plugin
- Configure and build the documentation. cd gz-pluginmkdir buildcd buildcmake ..make doc
- View the documentation by running the following command from the
build
directory.firefox doxygen/html/index.html
Note Alternatively, documentation for gz-plugin
can be found within the source code, and also in the MIGRATION.md guide.
Test
Run tests as follows:
Tests are automatically built. To disable them, run cmake
as follows:
Test coverage
To run test coverage:
Install LCOV
sudo apt-get install lcovBuild with coverage
cd build/cmake .. -DCMAKE_BUILD_TYPE=coveragemake- Run tests make test
- Generate coverage make coverage
- View results firefox coverage/index.html