Hey, sorry for the late reply. I fixed the offboard control mode issue – I believe the issue was that sending uOrb offboard messages in position mode interfere with the position controller and cause it to fight itself.
However, I am now having bigger issues with the simulator itself. I am still on the same setup (latest version of PX4_Autopilot repository, and installed the correct gz bridge via the command you gave. Whenever I launch gazebo through the command ‘make px4_sitl gz_x500’, I get this output:
make px4_sitl gz_x500
[0/1] cd /home/velocitylab/PX4-Autopilot/build...b/PX4-Autopilot/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] importing from 'parameters.bson'
INFO [parameters] BSON document size 404 bytes, decoded 404 bytes (INT32:14, FLOAT:6)
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/velocitylab/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.
Unknown message type [8].
Unknown message type [8].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
ERROR [gz_bridge] Service call timed out. Check GZ_SIM_RESOURCE_PATH is set correctly.
WARN [gz_bridge] Service call timed out as Gazebo has not been detected.
Unknown message type [8].
Unknown message type [8].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
Unknown message type [9].
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
INFO [lockstep_scheduler] setting initial absolute time to 1252000 us
INFO [commander] LED: open /dev/led0 failed (22)
INFO [uxrce_dds_client] init UDP agent IP:127.0.0.1, port:8888
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO [tone_alarm] home set
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO [logger] logger started (mode=all)
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2024-10-14/02_46_53.ulg
INFO [logger] Opened full log file: ./log/2024-10-14/02_46_53.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
pxh> INFO [mavlink] partner IP: 127.0.0.1
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
After the simulation runs for some time (it seems to be random each time), it starts printing the error message:
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
Exception sending a multicast message:Network is unreachable
After this error starts printing, I can no longer communicate with the simulator over the ros2 topics published by the MicroXRCE agent.
The issue is not caused by the MicroXRCE agent, as I can still produce the error when I run the sim by itself. Grepping the PX4_Autopilot repo for this error message returns nothing, so have basically no idea where this error is originating or why.
Jmavsim seems to work fine, so I guess I’ll just use that for now.