PX4 World Files Loaded But Repo Models Not Spawned

Hi Everyone,

I’ve just installed the simulation environment for Ubuntu 22.04 and Gazebo Garden–instructed here Ubuntu Development Environment | PX4 User Guide (main).

  1. Downloaded PX4 Source Code: git clone https://github.com/PX4/PX4-Autopilot.git --recursive
  2. Run ubuntu.sh: bash ./PX4-Autopilot/Tools/setup/ubuntu.sh

My environment variables are sourced as follows:
export GZ_VERSION=garden
export PX4_GZ_WORLDS=/home/user/PX4-Autopilot/Tools/simulation/gz/worlds
export PX4_GZ_MODELS=~/PX4-Autopilot/Tools/simulation/gz/models

(Ive tried changing PX4_GZ_MODELS to PX4_SIM_MODEL since GZ_MODELS is deprecated, if i’m not mistaken. I’ve also tried to make clean and run the simulation again)

However, when I run the simulation make px4_sitl gz_px4vision this is the error that I get:

All of the worlds available in the repo can be loaded (i.e. make px4_sitl gz_x500 etc), but none of the models are being spawned. Am I missing something in setting up the simulation environment, or is there an issue with GZBridge.cpp?

Thanks in advance for your help.

1 Like

I also am getting the same error. I am on a (Machine A) fresh Ubuntu 22, Gazebo Garden 7.7.0. I have tried the steps from the same link as the original poster (Ubuntu Development Environment | PX4 User Guide (main)) as well as ROS 2 User Guide | PX4 User Guide (main).

I get a Gazebo Sim window to open up, but it is all black.

I have also tried:

export GZ_SIM_RESOURCE_PATH=$PATH:/home/user/PX4-Autopilot/Tools/simulation/gz

The only difference I had with the original poster was that instead of the last warning I got this as my warning:

Warning [Utils.cc:130] [/sdf/world[@name=“default”]/spherical_coordinates/altitude:/home/user/PX4-Autopilot/Tools/simulation/gz/worlds/default.sdf:L153]: XML Element[altitude], child of element[spherical_coordinates], not defined in SDF. Copying[altitude] as children of [spherical_coordinates].

I have the same issue :thinking: