These instructions are for installing only Ignition Physics. If you're interested in using all the Ignition libraries, check out this Ignition installation.
We recommend following the Binary Installation instructions to get up and running as quickly and painlessly as possible.
The Source Installation instructions are generally recommended for developers who want access to the latest features, develop your own feature or make a contribution to our codebase.
Ubuntu
Prerequisites
Ignition Physics uses several C++17 features which are not available in the version of gcc supplied with Ubuntu Xenial, so Ubuntu Bionic or later is required.
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 ignition-plugin
:
Be sure to replace <#>
with a number value, such as 1
or 2
, depending on which version you need.
Source Installation
- Install dependencies sudo apt-add-repository -s "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -c -s) main"sudo apt-get build-dep -y ignition-physics<#>-dev
Be sure to replace <#>
with a number value, such as 1
or 2
, depending on which version you need.
- Use gcc-8 sudo apt updatesudo apt-get -y install g++-8sudo update-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/ignitionrobotics/ign-physics -b ign-physics<#>
Be sure to replace <#>
with a number value, such as 1
or 2
, depending on which version you need.
- Configure and build cd ign-physicsmkdir buildcd buildcmake ..make
- Optionally, install sudo make install
macOS
Prerequisites
Ignition Physics and several of its dependencies can be installed on macOS with Homebrew using the osrf/simulation tap. Ignition Physics uses several C++17 features which are not available in macOS High Sierra (10.13) and earlier, so macOS Mojave (10.14) with XCode 10.1 are the minimum system requirements.
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 ignition-physics<#>
Be sure to replace <#>
with a number value, such as 1
or 2
, depending on which version you need.
Source Installation
- Install dependencies brew tap osrf/simulationbrew install ignition-physics2 --only-dependencies
- Clone the repository git clone https://github.com/ignitionrobotics/ign-physics -b ign-physics<#>
Be sure to replace <#>
with a number value, such as 1
or 2
, depending on which version you need.
- Configure and build cd ign-physicsmkdir buildcd buildcmake ..make
- Optionally, install sudo make install
Windows
Currently, on Windows, DART is not supported, pending resolution of dartsim/dart#1522 and conda-forge/dartsim-feedstock#2. Only Trivial Physics Engine (TPE) is supported at the moment.
Prerequisites
First, follow the ign-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
Source Installation
This assumes you have created and activated a Conda environment while installing the Prerequisites.
Install Ignition dependencies:
You can view available versions and their dependencies:
conda search libignition-physics* --channel conda-forge --info
- Navigate to where you would like to build the library, and clone the repository. # Optionally, append `-b ign-physics#` (replace # with a number) to check out a specific versiongit clone https://github.com/ignitionrobotics/ign-physics.git
- Configure and build cd ign-physicsmkdir buildcd buildcmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\installcmake --build . --config Release
- Optionally, install cmake --install . --config Release
Documentation
API and tutorials can be found at https://ignitionrobotics.org/libs/physics.
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/ignitionrobotics/ign-physics -b ign-physics2
- Configure and build the documentation. cd ign-physicsmkdir buildcd buildcmake ..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.
- Follow the source install instruction.
- Run tests. make test
- Static code checker. make codecheck