Gz_bridge failed to start and spawn model

Faced a problem with Gazebo and px4 interaction: gz_bridge failed to start and spawn model. Can anyone help? Clock is published by gz


MicroXRCEAgent udp4 -p 8888

gz sim -v 4 aruco_field.sdf

export PX4_GZ_MODEL_NAME=x500_vision_0 &&

export PX4_GZ_MODEL_POSE='3,3,0.5,0,0,0,0,0' &&

cd ~/PX4-Autopilot && make px4_sitl gz_x500_vision

Error:


INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0

INFO [init] found model autostart file as SYS_AUTOSTART=4005

INFO [param] selected parameter default file parameters.bson

INFO [param] importing from 'parameters.bson'

INFO [parameters] BSON document size 316 bytes, decoded 316 bytes (INT32:13, FLOAT:3)

INFO [param] selected parameter backup file parameters_backup. bson

INFO [dataman] data manager file './dataman' size is 7872608 bytes

INFO [init] Gazebo simulator

INFO [init] gazebo already running world: aruco_world

WARN [init] PX4_GZ_MODEL_POSE not set, spawning at origin.

INFO [gz_bridge] world: aruco_world, model name: x500_vision_0, simulation model: x500_vision

INFO [gz_bridge] Requested Model Position: 0,0,0,0,0,0,0,0,0,0

INFO [gz_bridge] Model position z is less than or equal to 0. 0, moving upwards

ERROR [gz_bridge] timed out waiting for clock message

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

FAILED: src/modules/simulation/gz_bridge/CMakeFiles/gz_x500_vision /home/vor/PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge/CMakeFiles/gz_x500_vision

cd /home/vor/PX4- Autopilot/build/px4_sitl_default/src/modules/simulation/gz_bridge && /usr/bin/cmake -E env PX4_SIM_MODEL=gz_x500_vision /home/vor/PX4-Autopilot/build/px4_sitl_default/bin/px4

ninja: build stopped: subcommand failed.

make: *** [Makefile:232: px4_sitl] Error 1

Well, after the failed attempt to spawn model, the topics appear, but nothing is published in them.


vor@DESKTOP-6F8AAJ8: ~/archipelag25$ gz topic - l

/clock

/gazebo/resource_paths

/gui/camera/pose

/model/x500_vision_0/odometry

/model/x500_vision_0/odometry_with_covariance

/model/x500_vision_0/pose

/stats

/world/aruco_world/clock

/world/aruco_world/dynamic_pose/info

/world/aruco_world/dynamic_pose/info

/world/aruco_world/scene/deletion

/world/aruco_world/scene/info

/world/aruco_world/state

/world/aruco_world/stats

I try to kill

pkill -9 ruby
unset GZ_IP
unset GZ_PARTITION

AAAND I TRY RUN PX4 and it works

vor@DESKTOP-6F8AAJ8:~/archipelag25$ gz topic -l 
[1]+  Killed                  gz model --list
/clock
/gazebo/resource_paths
/gui/camera/pose
/model/x500_vision_0/command/motor_speed
/model/x500_vision_0/odometry
/model/x500_vision_0/odometry_with_covariance
/model/x500_vision_0/pose
/model/x500_vision_0/servo_0
/model/x500_vision_0/servo_1
/model/x500_vision_0/servo_2
/model/x500_vision_0/servo_3
/model/x500_vision_0/servo_4
/model/x500_vision_0/servo_5
/model/x500_vision_0/servo_6
/model/x500_vision_0/servo_7
/stats
/world/default/clock
/world/default/dynamic_pose/info
/world/default/model/x500_vision_0/link/base_link/sensor/air_pressure_sensor/air_pressure
/world/default/model/x500_vision_0/link/base_link/sensor/imu_sensor/imu
/world/default/model/x500_vision_0/link/base_link/sensor/navsat_sensor/navsat
/world/default/pose/info
/world/default/scene/deletion
/world/default/scene/info
/world/default/state
/world/default/stats
/x500_vision_0/command/motor_speed

But I have no idea how to run PX4 with my custom world!!!

My goal is to run px4 with my custom world in gazebo

the last log

px4 starting.

INFO  [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO  [init] found model autostart file as SYS_AUTOSTART=4005
INFO  [param] selected parameter default file parameters.bson
INFO  [param] importing from 'parameters.bson'
INFO  [parameters] BSON document size 316 bytes, decoded 316 bytes (INT32:13, FLOAT:3)
INFO  [param] selected parameter backup file parameters_backup.bson
INFO  [dataman] data manager file './dataman' size is 7872608 bytes
INFO  [init] Gazebo simulator
INFO  [init] starting gazebo with world: /home/vor/PX4-Autopilot/Tools/simulation/gz/worlds/aruco_field.sdf
WARN  [init] PX4_GZ_MODEL_POSE not set, spawning at origin.
INFO  [gz_bridge] world: aruco_field, model name: x500_vision_0, simulation model: x500_vision
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
QStandardPaths: wrong permissions on runtime directory /mnt/wslg/runtime-dir, 0777 instead of 0700
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
libEGL warning: failed to open /dev/dri/renderD128: Permission denied

libEGL warning: failed to open /dev/dri/card0: Permission denied