|
| 1 | +\page installation Installation |
| 2 | + |
| 3 | +We recommend following the binary install instructions to get up and running as quickly and painlessly as possible. |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +## Binary Install |
| 8 | + |
| 9 | +### Ubuntu |
| 10 | + |
| 11 | +1. Setup your computer to accept software from packages.osrfoundation.org: |
| 12 | + ``` |
| 13 | + sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' |
| 14 | + wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - |
| 15 | + sudo apt-get update |
| 16 | + ``` |
| 17 | + |
| 18 | +1. Install Ignition Sensors |
| 19 | + ``` |
| 20 | + # This installs ign-sensors3. Change the number after libignition-sensors to the version you want |
| 21 | + sudo apt install libignition-sensors3-dev |
| 22 | + ``` |
| 23 | + |
| 24 | +### Windows |
| 25 | + |
| 26 | +Binary install is pending `ignition-rendering` and `ignition-sensors` being added to conda-forge. |
| 27 | + |
| 28 | +## Source Install |
| 29 | + |
| 30 | +Source installation can be performed in UNIX systems by first installing the |
| 31 | +necessary prerequisites followed by building from source. |
| 32 | + |
| 33 | +### Prerequisites |
| 34 | + |
| 35 | +Ignition Sensors requires: |
| 36 | + |
| 37 | + * [Ignition CMake](https://ignitionrobotics.org/libs/cmake) |
| 38 | + * [Ignition Math](https://ignitionrobotics.org/libs/math) |
| 39 | + * [Ignition Common](https://ignitionrobotics.org/libs/common) |
| 40 | + * [Ignition Transport](https://ignitionrobotics.org/libs/transport) |
| 41 | + * [Ignition Rendering](https://ignitionrobotics.org/libs/rendering) |
| 42 | + * [Ignition Msgs](https://ignitionrobotics.org/libs/msgs) |
| 43 | + * [SDFormat](https://github.com/osrf/sdformat) |
| 44 | + * [Protobuf3](https://developers.google.com/protocol-buffers/) |
| 45 | + |
| 46 | +### Ubuntu |
| 47 | + |
| 48 | +1. Make sure you are running [Ubuntu Bionic](http://releases.ubuntu.com/18.04/) or above. |
| 49 | + |
| 50 | +2. Install the Prerequisites. |
| 51 | + |
| 52 | +3. Configure to use gcc8 if that is not the default compiler |
| 53 | + ``` |
| 54 | + sudo apt-get install g++-8 |
| 55 | + 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 |
| 56 | + ``` |
| 57 | + |
| 58 | +4. Clone the repository |
| 59 | + ``` |
| 60 | + git clone https://github.com/ignitionrobotics/ign-sensors |
| 61 | + ``` |
| 62 | + |
| 63 | +5. Configure and build |
| 64 | + ``` |
| 65 | + cd ign-sensors; mkdir build; cd build; cmake ..; make |
| 66 | + ``` |
| 67 | + |
| 68 | +6. Optionally, install the library |
| 69 | + ``` |
| 70 | + sudo make install |
| 71 | + ``` |
| 72 | + |
| 73 | +### Windows |
| 74 | + |
| 75 | +#### Install Prerequisites |
| 76 | + |
| 77 | +First, follow the [ign-cmake](https://github.com/ignitionrobotics/ign-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment. |
| 78 | + |
| 79 | +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`). |
| 80 | + |
| 81 | +Create if necessary, and activate a Conda environment: |
| 82 | + |
| 83 | +``` |
| 84 | +conda create -n ign-ws |
| 85 | +conda activate ign-ws |
| 86 | +``` |
| 87 | + |
| 88 | +Install Ignition dependencies, replacing `<#>` with the desired versions: |
| 89 | + |
| 90 | +``` |
| 91 | +conda install libignition-cmake<#> libignition-common<#> libignition-math<#> libignition-transport<#> libignition-msgs<#> libignition-plugin<#> --channel conda-forge |
| 92 | +``` |
| 93 | + |
| 94 | +Before [ign-rendering](https://github.com/ignitionrobotics/ign-rendering) becomes available on conda-forge, follow its tutorial to build it from source. |
| 95 | + |
| 96 | +#### Build from source |
| 97 | + |
| 98 | +1. Activate the Conda environment created in the prerequisites: |
| 99 | + ``` |
| 100 | + conda activate ign-ws |
| 101 | + ``` |
| 102 | + |
| 103 | +1. Navigate to where you would like to build the library, and clone the repository. |
| 104 | + ``` |
| 105 | + # Optionally, append `-b ign-sensors#` (replace # with a number) to check out a specific version |
| 106 | + git clone https://github.com/ignitionrobotics/ign-sensors.git |
| 107 | + ``` |
| 108 | + |
| 109 | +1. Configure and build |
| 110 | + ``` |
| 111 | + cd ign-sensors |
| 112 | + mkdir build |
| 113 | + cd build |
| 114 | + ``` |
| 115 | + |
| 116 | + 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. |
| 117 | + ``` |
| 118 | + cmake .. -DBUILD_TESTING=OFF -DCMAKE_PREFIX_PATH=path\containing\ignition-rendering-config # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install |
| 119 | + cmake --build . --config Release |
| 120 | + ``` |
| 121 | + |
| 122 | +1. Optionally, install. You will likely need to run a terminal with admin privileges for this call to succeed. |
| 123 | + ``` |
| 124 | + cmake --install . --config Release |
| 125 | + ``` |
| 126 | + |
| 127 | +# Documentation |
| 128 | + |
| 129 | +API and tutorials can be found at [https://ignitionrobotics.org/libs/sensors](https://ignitionrobotics.org/libs/sensors). |
| 130 | + |
| 131 | +You can also generate the documentation from a clone of this repository by following these steps. |
| 132 | + |
| 133 | +1. You will need Doxygen. On Ubuntu Doxygen can be installed using |
| 134 | + ``` |
| 135 | + sudo apt-get install doxygen |
| 136 | + ``` |
| 137 | + |
| 138 | +2. Clone the repository |
| 139 | + ``` |
| 140 | + git clone https://github.com/ignitionrobotics/ign-sensors |
| 141 | + ``` |
| 142 | + |
| 143 | +3. Configure and build the documentation. |
| 144 | + ``` |
| 145 | + cd ign-sensors; mkdir build; cd build; cmake ../; make doc |
| 146 | + ``` |
| 147 | + |
| 148 | +4. View the documentation by running the following command from the build directory. |
| 149 | + ``` |
| 150 | + firefox doxygen/html/index.html |
| 151 | + ``` |
| 152 | + |
| 153 | +# Testing |
| 154 | + |
| 155 | +Follow these steps to run tests and static code analysis in your clone of this repository. |
| 156 | + |
| 157 | +1. Run tests. |
| 158 | + ``` |
| 159 | + make test |
| 160 | + ``` |
| 161 | + |
| 162 | +2. Static code checker. |
| 163 | + ``` |
| 164 | + make codecheck |
| 165 | + ``` |
| 166 | + |
0 commit comments