|
14 | 14 |
|
15 | 15 | ## Installation |
16 | 16 |
|
17 | | -At the moment we do not provide any binary for `gz-sim-yarp-plugins`, so you need to compile it from source, either |
18 | | -installing the dependencies with conda-forge on Linux, macOS or Windows, or apt on Ubuntu. |
| 17 | +### conda (recommended) |
19 | 18 |
|
20 | | -### Compile from source using conda-forge dependencies on Linux, macOS or Windows |
| 19 | +You can easily install the C++ and Python library with via [`conda-forge`](https://conda-forge.org) using the following command: |
21 | 20 |
|
22 | | -Create and activate an environment with the required dependencies: |
23 | | - |
24 | | -~~~ |
25 | | -mamba create -c conda-forge -n gsypdev libgz-sim8 yarp ycm-cmake-modules cmake ninja pkg-config cmake compilers gtest |
26 | | -mamba activate gsypdev |
27 | | -~~~ |
28 | | - |
29 | | -All the commands in this README should be executed in a terminal with the activated environment. |
30 | | - |
31 | | -Then, compile gz-sim-yarp-plugins itself, using the following commands on Linux and macOS: |
32 | | - |
33 | | -~~~ |
34 | | -git clone https://github.dev/robotology/gz-sim-yarp-plugins |
35 | | -mkdir build |
36 | | -cd build |
37 | | -cmake -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX .. |
38 | | -ninja |
39 | | -ninja install |
40 | | -~~~ |
41 | | - |
42 | | -or the following commands on Windows: |
43 | | - |
44 | | -~~~ |
45 | | -git clone https://github.dev/robotology/gz-sim-yarp-plugins |
46 | | -mkdir build |
47 | | -cd build |
48 | | -cmake -GNinja -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library -DCMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library .. |
49 | | -ninja |
50 | | -ninja install |
51 | | -~~~ |
52 | | - |
53 | | -### Compile from source using apt dependencies on Linux, macOS or Windows |
54 | | - |
55 | | -First install some necessary dependencies from apt |
56 | | - |
57 | | -~~~ |
58 | | -sudo apt-get update |
59 | | -sudo apt-get install lsb-release wget gnupg cmake pkg-config ninja-build build-essential libgtest-dev |
60 | | -~~~ |
61 | | - |
62 | | -Then install Gazebo Harmonic: |
| 21 | +```bash |
| 22 | +conda install -c conda-forge gz-sim-yarp-plugins |
| 23 | +``` |
63 | 24 |
|
64 | | -~~~ |
65 | | -sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg |
66 | | -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null |
67 | | -sudo apt-get update |
68 | | -sudo apt-get install gz-harmonic |
69 | | -~~~ |
| 25 | +If you are not familiar with conda or conda-forge, you can read an introduction document in [conda-forge overview](https://github.com/robotology/robotology-superbuild/blob/master/doc/conda-forge.md#conda-forge-overview). |
70 | 26 |
|
71 | | -Then, you need to install [`ycm-cmake-modules`](https://github.com/robotology/ycm) and [`yarp`](https://github.com/robotology/yarp), for which no apt binaries are available. You can install them easily via the `robotology-superbuild`, or otherwise with the following commands: |
| 27 | +### robotology-superbuild (advanced) |
72 | 28 |
|
73 | | -~~~ |
74 | | -mkdir ~/gsyp_ws |
75 | | -cd ~/gsyp_ws |
76 | | -git clone https://github.com/robotology/ycm |
77 | | -git clone https://github.com/robotology/yarp |
78 | | -cd ycm |
79 | | -mkdir build |
80 | | -cd build |
81 | | -cmake -GNinja -DCMAKE_INSTALL_PREFIX=~/gsyp_ws/install -DCMAKE_PREFIX_PATH=~/gsyp_ws/install .. |
82 | | -ninja |
83 | | -ninja install |
84 | | -cd ~/gsyp_ws/yarp |
85 | | -cd yarp |
86 | | -git checkout v3.9.0 |
87 | | -mkdir build |
88 | | -cd build |
89 | | -cmake -GNinja -DCMAKE_INSTALL_PREFIX=~/gsyp_ws/install -DCMAKE_PREFIX_PATH=~/gsyp_ws/install .. |
90 | | -ninja |
91 | | -ninja install |
92 | | -~~~ |
| 29 | +You may want to install `gz-sim-yarp-plugins` through the [robotology-superbuild](https://github.com/robotology/robotology-superbuild), an easy way to download, compile and install the robotology software on multiple operating systems, using the [CMake](https://www.cmake.org) build system and its extension [YCM](http://robotology.github.io/ycm). To get `gz-sim-yarp-plugins` when using the `robotology-superbuild`, please enable the `ROBOTOLOGY_USES_GZ_SIM` CMake option of the superbuild. |
93 | 30 |
|
94 | | -Then, install `gz-sim-yarp-plugins` itself: |
| 31 | +### Build from source (advanced) |
95 | 32 |
|
96 | | -~~~ |
97 | | -git clone https://github.dev/robotology/gz-sim-yarp-plugins |
98 | | -mkdir build |
99 | | -cd build |
100 | | -cmake -GNinja -DCMAKE_INSTALL_PREFIX=~/gsyp_ws/install -DCMAKE_PREFIX_PATH=~/gsyp_ws/install .. |
101 | | -ninja |
102 | | -ninja install |
103 | | -~~~ |
| 33 | +If you want to build `gz-sim-yarp-plugins` directly from source, you can check the documentation in [`docs/build-from-source.md`](docs/build-from-source.md). |
104 | 34 |
|
105 | 35 | ## Usage |
106 | 36 |
|
107 | | -To notify Gazebo of the new plugins compiled, it is necessary to modify the `GZ_SIM_SYSTEM_PLUGIN_PATH` environment variable, for example on Linux: |
| 37 | +Once the plugins are available, you can see how to use the different plugins by looking in the directories contained in the [tutorial](tutorial/) folder of this repo. Each directory is an example, and contains a README that shows how to run that example. |
108 | 38 |
|
109 | | -~~~ |
110 | | -export GZ_SIM_SYSTEM_PLUGIN_PATH=${GZ_SIM_SYSTEM_PLUGIN_PATH}:<install_location>/lib |
111 | | -~~~ |
112 | | - |
113 | | -where `<install_location>` is the directory passed to `CMAKE_INSTALL_PREFIX` during the CMake configuration. |
114 | | - |
115 | | -Once the plugins are available, you can see how to use the different plugins by looking in the directories contained in the `tutorial` folder of this repo. Each directory is an example, and contains a README that shows how to run that example. |
| 39 | +### Migrating from Gazebo Classic and `gazebo-yarp-plugins` |
116 | 40 |
|
117 | 41 | If you are migrating from an existing project made for Gazebo Classic and `gazebo-yarp-plugins`, check out the [migration guide](docs/how-to-migrate-from-gazebo-classic.md). |
118 | 42 |
|
119 | 43 | ### How to specify Yarp configurations |
| 44 | + |
120 | 45 | There are two ways to specify the Yarp configuration of a plugin: |
| 46 | + |
121 | 47 | - `yarpConfigurationString`: it allows to directly specify the configuration in a string that must follow the [standard data representation format](https://www.yarp.it/latest/data_rep.html); |
122 | 48 | - `yarpConfigurationFile`: it specifies the location of a [Yarp configuration file](https://www.yarp.it/latest/yarp_config_files.html). |
123 | 49 |
|
124 | 50 | Concerning `yarpConfigurationFile`, the preferred way to specify the path to the configuration file is by using [Gazebo URIs](https://gazebosim.org/api/common/6/classgz_1_1common_1_1URI.html). A URI has the following general scheme: |
| 51 | + |
125 | 52 | ``` |
126 | 53 | scheme:[//authority]path[?query][#fragment] |
127 | 54 | ``` |
@@ -166,7 +93,6 @@ For more details, check how the tests are run as part of the Continuous Integrat |
166 | 93 | Refer to the [Contributing page](CONTRIBUTING.md). |
167 | 94 |
|
168 | 95 | ## Maintainers |
| 96 | + |
169 | 97 | - Silvio Traversaro ([@traversaro](https://github.com/traversaro)) |
170 | 98 | - Alessandro Croci ([@xela-95](https://github.com/xela-95)) |
171 | | - |
172 | | - |
0 commit comments