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.
Binary Install
Ubuntu
- Setup your computer to accept software from packages.osrfoundation.org: 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 Sensors # This installs ign-sensors3. Change the number after libignition-sensors to the version you wantsudo apt install libignition-sensors3-dev
Windows
Binary install is pending ignition-rendering
and ignition-sensors
being added to conda-forge.
Source Install
Source installation can be performed in UNIX systems by first installing the necessary prerequisites followed by building from source.
Prerequisites
Gazebo Sensors requires:
- Gazebo CMake
- Gazebo Math
- Gazebo Common
- Gazebo Transport
- Gazebo Rendering
- Gazebo Msgs
- SDFormat
- Protobuf3
Ubuntu
- Make sure you are running Ubuntu Bionic or above.
- Install the Prerequisites.
- Configure to use gcc8 if that is not the default compiler sudo apt-get install g++-8update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
- Clone the repository git clone https://github.com/gazebosim/gz-sensors
- Configure and build cd ign-sensors; mkdir build; cd build; cmake ..; make
- Optionally, install the library sudo make install
Windows
Install Prerequisites
First, follow the ign-cmake tutorial 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:
Install Gazebo dependencies, replacing <#>
with the desired versions:
Before ign-rendering becomes available on conda-forge, follow its tutorial to build it from source.
Build from source
- Activate the Conda environment created in the prerequisites: conda activate ign-ws
- Navigate to where you would like to build the library, and clone the repository. # Optionally, append `-b ign-sensors#` (replace # with a number) to check out a specific versiongit clone https://github.com/gazebosim/gz-sensors.git
- Configure and build cd ign-sensorsmkdir buildcd build
Before `ign-rendering` becomes available on conda-forge, we need to build it from source and specify the path containing `ignition-rendering-config.cmake` in `CMAKE_PREFIX_PATH`, for cmake to find `ign-rendering`. That path could be `ign-rendering-install-path\lib\cmake\ignition-rendering4`, for example.
- Optionally, install. You will likely need to run a terminal with admin privileges for this call to succeed. cmake --install . --config Release
Documentation
API and tutorials can be found at https://gazebosim.org/libs/sensors.
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-sensors
- Configure and build the documentation. cd ign-sensors; mkdir build; cd build; cmake ../; make doc
- View the documentation by running the following command from the build directory. firefox doxygen/html/index.html
Testing
Follow these steps to run tests and static code analysis in your clone of this repository.
- Run tests. make test
- Static code checker. make codecheck