Hello,
I followed the documentation on the github pages, and I am able to build gz-sim, gz-math, and gz-sensors, using command line. However having ubuntu binary packages in my system I have not installed.
Are there any documentation on how to setup a development environment for developing the gazebo sim itself? When googled, there are bunch of documentation on how to develop with the gazebo, but no information on setting up an dev env for developing the actual gazebo.
And there are some dependency challenges. For example gz-sim uses the gz-math lib, that is installed under /opt, and the newly compiled gz-sim will have to link to that, etc.
What I want ideally is a setup so I can have my system gazebo that is installed tru ubuntu package manager, and then another development gazebo which I can replace with a command.
For now, I have setup an LXD container, and I have in sequence built and make installed the following repositories: gz-math gz-plugin gz-sensors. I basically downloaded the repository, installed the dependencies for each package seperately. (if you do it for multiple packages it will for example install gz-math as a system package) - they have to be done one by one in sequence, and cmake .. output needs to be checked to make sure it points libraries to the ones we installed in previous step.
And finally: what IDE recomendations you have for developing gz-sim.
Best Regards,
C.A.
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.e apt-get build-dep gz-common6
or apt-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 .
and cmake --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.