Gz-garden install error

INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes
INFO [init] Gazebo simulator
ERROR [init] Gazebo gz please install gz-garden
ERROR [px4] Startup script returned with return value: 256
FAILED: src/modules/simulation/gz_bridge/CMakeFiles/gz_x500 /home/ajval/Digital-Twin-Cybersecurity/PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge/CMakeFiles/gz_x500
cd /home/ajval/Digital-Twin-Cybersecurity/PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge && /usr/bin/cmake -E env PX4_SIM_MODEL=gz_x500 /home/ajval/Digital-Twin-Cybersecurity/PX4-Autopilot/build/px4_sitl_default/bin/px4
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1
ajval@aj-ubuntu:~/Digital-Twin-Cybersecurity/PX4-Autopilot$

Here’s my error. I’m trying to run make px4_sitl gz_x500 which used to work last night. I am running Ubuntu 24.04 and Gazebo Harmonic. Now it says Gazebo gz please install-gz garden. I think the error also might arise from gz_bridge. I’m not sure because I was also trying to install mavlink last night. Any ideas how to fix this error?

I had the same problem before and solved it by following steps:

$ which gz
> /opt/ros/jazzy/opt/gz_tools_vendor/bin/gz

It turned out to be the wrong binary.

$ dpkg -l | grep gz
> ii  ros-jazzy-gz-cmake-vendor                        0.0.9-1noble.20250210.090417             amd64        Vendor package for: gz-cmake3 3.5.4 Gazebo CMake : CMake Modules for Gazebo Projects
> ii  ros-jazzy-gz-math-vendor                         0.0.8-1noble.20250210.090705             amd64        Vendor package for: gz-math7 7.5.2 Gazebo Math : Math classes and functions for robot applications
> ii  ros-jazzy-gz-tools-vendor                        0.0.6-1noble.20250210.090547             amd64        Vendor package for: gz-tools2 2.0.2 Gazebo Tools: Entrypoint to Gazebo's command line interface
> ii  ros-jazzy-gz-utils-vendor                        0.0.5-1noble.20250210.090542             amd64        Vendor package for: gz-utils2 2.2.1 Gazebo Utils : Classes and functions for robot applications

It’s ros-jazzy-gz-tools-vendor.

The problem occurred because I had previously installed rqt using apt install ros-${ROS_DISTRO}-rqt* .

Let’s fix it.

$ sudo apt remove ros-jazzy-gz-tools-vendor

And reinstall gz.

$ ./Tools/setup/ubuntu.sh

Check

$ gz
> I cannot find any available 'gz' command:
>         * Did you install any Gazebo library?
>         * Did you set the GZ_CONFIG_PATH environment variable?
>             E.g.: export GZ_CONFIG_PATH=$HOME/local/share/gz

Still has some problem.

$ echo $GZ_CONFIG_PATH
> /opt/ros/jazzy/opt/sdformat_vendor/share/gz

I don’t know which package set the GZ_CONFIG_PATH value.

But we can make it point to the correct path.

$ export GZ_CONFIG_PATH=/usr/share/gz/

Let’s Check again

$ gz sim --version
> Gazebo Sim, version 8.9.0
> Copyright (C) 2018 Open Source Robotics Foundation.
> Released under the Apache 2.0 License.

$ make px4_sitl gz_x500_depth

Solved!

1 Like