Gazebo not loading

Hi Everyone, I hope you are doing fine. I have been googling, reading forums and talking to people on discord but i cannot solve this. I try to run gazebo simulation for the first time but I have been having issues. This is the error I get, could you please guide me in the right direction? what am I missing here.

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from ‘parameters.bson’
INFO [parameters] BSON document size 496 bytes, decoded 496 bytes (INT32:15, FLOAT:9)
INFO [param] selected parameter backup file parameters_backup.bson
SYS_AUTOCONFIG: curr: 0 → new: 1

  • SYS_AUTOSTART: curr: 10017 → new: 4001
    SENS_BOARD_X_OFF: curr: 0.0000 → new: 0.0000
    SENS_DPRES_OFF: curr: 0.0000 → new: 0.0010
    INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes
    INFO [init] Gazebo simulator
    INFO [init] starting gazebo with world: /home/nigh/Desktop/PX4-Autopilot/Tools/simulation/gz/worlds/default.sdf
    WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin.
    INFO [gz_bridge] world: default, model name: x500_0, simulation model: x500
    INFO [gz_bridge] Requested Model Position: 0,0,0,0,0,0
    INFO [gz_bridge] Model position z is less or equal 0.0, moving upwards
    qt.qpa.plugin: Could not find the Qt platform plugin “wayland” in “”
    ERROR [gz_bridge] Service call timed out. Check GZ_SIM_RESOURCE_PATH is set correctly.
    ERROR [gz_bridge] Task start failed (-1)
    ERROR [init] gz_bridge failed to start and spawn model
    ERROR [px4] Startup script returned with return value: 256
1 Like

@unclegueralt Hi, I think the error you’re facing is related to the GZ_SIM_RESOURCE_PATH variable not set correctly. You can try setting it by running:

export GZ_SIM_RESOURCE_PATH=~/Desktop/PX4-Autopilot/Tools/simulation/gz/models:~/Desktop/PX4-Autopilot/Tools/simulation/gz/worlds

i trued but its not working

/PX4-Autopilot$ make px4_sitl gz_x500
[0/1] cd /home/usmannoor/PX4-Autopilot…topilot/build/px4_sitl_default/bin/px4


| ___ \ \ \ / / / |
| |/ / \ V / / /| |
| __/ / \ / /
| |
| | / /^\ \ ___ |
_| / / |_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4001
INFO [param] selected parameter default file parameters.bson
INFO [param] selected parameter backup file parameters_backup.bson
SYS_AUTOCONFIG: curr: 0 → new: 1
SYS_AUTOSTART: curr: 0 → new: 4001
CAL_ACC0_ID: curr: 0 → new: 1310988
CAL_GYRO0_ID: curr: 0 → new: 1310988
CAL_ACC1_ID: curr: 0 → new: 1310996
CAL_GYRO1_ID: curr: 0 → new: 1310996
CAL_ACC2_ID: curr: 0 → new: 1311004
CAL_GYRO2_ID: curr: 0 → new: 1311004
CAL_MAG0_ID: curr: 0 → new: 197388
CAL_MAG0_PRIO: curr: -1 → new: 50
CAL_MAG1_ID: curr: 0 → new: 197644
CAL_MAG1_PRIO: curr: -1 → new: 50
SENS_BOARD_X_OFF: curr: 0.0000 → new: 0.0000
SENS_DPRES_OFF: curr: 0.0000 → new: 0.0010
INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes
INFO [init] Gazebo simulator
INFO [init] starting gazebo with world: /home/usmannoor/PX4-Autopilot/Tools/simulation/gz/worlds/default.sdf
WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin.
INFO [gz_bridge] world: default, model name: x500_0, simulation model: x500
INFO [gz_bridge] Requested Model Position: 0,0,0,0,0,0
INFO [gz_bridge] Model position z is less or equal 0.0, moving upwards
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
ERROR [gz_bridge] Service call timed out. Check GZ_SIM_RESOURCE_PATH is set correctly.
ERROR [gz_bridge] Task start failed (-1)
ERROR [init] gz_bridge failed to start and spawn model
ERROR [px4] Startup script returned with return value: 256
^Cninja: build stopped: interrupted by user.
make: *** [Makefile:232: px4_sitl] Interrupt

Although my logs still say that i need to check my GZ_SIM_RESOURCE_PATH, I have been able to successfully launch the sim by disabling my firewall using the suggestion found here