Hello @altineller , thanks for asking, interesting topic in which we can improve documentation probably.
Reviewing our Contributing code section Contributing to Gazebo — Gazebo ionic documentation I think that there are some hints about how to run different aspects but we probably don’t have the full documentation on setup the development platform/environment.
[A. Main use case: building a single gz library]
I’ll try to create a documentation PR to improve the existing documentation but for the use case of having Gazebo installed using the Ubuntu binary packages (not the ROS packages) the course of action I would do is:
- Be sure that you know what release of Gazebo you are using (this table can help matching versions with Gazebo releases, i.e: gz-common6 is on Gazebo Ionic)
- With the version of Gazebo, you can check in the main install page if you system is supported or you need a container or other virtualization artifact (i.e: Ubuntu Noble is supported for Gazebo Ionic).
- Get the binary dependencies using standard apt on the source package or the main -dev package:
apt build-dep <libgz-$pkg-dev>
(i.eapt-get build-dep gz-common6
orapt-get build-dep libgz-common6-dev
) - Download the gz repository and be sure of using the right branch that match with the version you are interested into. Document here is quite good. (i.e clone the gz-common repository and place it in gz-common6 branch).
- You can proceed with the usual cmake and make commands, something like
cmake -B build -S .
andcmake --build build
.
[B. Alternative using the tools vcs and colcon instead of plain CMake]
[B. Alternative for developing multiple gz libraries at the same time]
[B. Alternative to use Gazebo and ROS together]
If you are familiar with ROS tools vcs and colcon and want to use them to develop Gazebo libraries and/or you need to make changes in several gz libraries at the same time and/or you will be running Gazebo with ROS, the alternative to the points above:
- , 2. and 3. are the same than above in use case A.
- Create a colcon workspace (a ws/src directory mainly).
- Download the gz-* libraries code from the yaml files in GitHub - gazebo-tooling/gazebodistro: Files defining the Open Robotics dependencies (using vcs import src/ < gz-$lib.yaml)
- You are good to run colcon with the usual set of parameters (colcon build --packages-select or --package-up-to depending if you want to build gz-libs from source or use the binary dependencies).
- Be sure of sourcing the colcon workspace so the loader select first the modified versions of the libraries in your colcon workspace (i.e
. install/setup.bash
).
It should be possible starting on ROS 2 Jazzy to use a different path playing with the ROS 2 Gazebo vendor packages but after writing it I prefer the simplicity of the Option B. I leave it here the instructions if someone is interested How to setup a colcon workspace to develop gz libraries code using ROS 2 Gazebo vendor packages. · GitHub.
Hope it helps.