Custom World Folder in Gazebo SITL

I want to use a custom world put in a custom folder in gazebo SITL.

While the custom world works when I put it in PX4-Autopilot/Tools/simulation/gz/worlds, it works well.

However, if I put it in a custom folder that is specified by GZ_SIM_RESOURCE_PATH=“/app/gz/models:/app/gz/worlds:/app/gz/” (exported as variable), it does not use these folders when I run

PX4_SIM_MODEL=gz_standard_vtol PX4_GZ_WORLD=custom_world ./build/px4_sitl_default/bin/px4

It just looks for the world at /app/PX4-Autopilot/Tools/simulation/gz/worlds/custom_world.sdf, and gets stuck at Waiting for Gazebo world.

PX4 Log

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4004
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from ‘parameters.bson’
INFO [parameters] BSON document size 312 bytes, decoded 312 bytes (INT32:13, FLOAT:3)
INFO [param] selected parameter backup file parameters_backup.bson
INFO [dataman] data manager file ‘./dataman’ size is 1208528 bytes
INFO [init] Gazebo simulator
INFO [init] Starting gazebo with world: /app/PX4-Autopilot/Tools/simulation/gz/worlds/custom_world.sdf
INFO [init] Starting gz gui
Unable to find or download file
INFO [init] Waiting for Gazebo world…

In the docs, it says that SITL should work as long as the worlds and models are in GZ_SIM_RESOURCE_PATH. Is this only applicable for standalone mode or is it just a bug? Do I have to edit some source files to make gazebo look for worlds on GZ_SIM_RESOURCE_PATH?

I’m currently using PX4 1.16 on Ubuntu 24.04.3 on the docker container.