ROS2 SITL with Gazebo not working

Hi,
ROS2 Humble, Ubuntu 22.04, Gazebo Sim, version 8.1.0

I have followed the install instructions and also have seen the posts 1 and 2 and several others.
However I am unable to run ros2 launch ardupilot_gz_bringup iris_runway.launch.py . The error log is as follows

[~/ros2_ws] - ros2 launch ardupilot_gz_bringup iris_runway.launch.py 
[INFO] [launch]: All log files can be found below /home/ash/.ros/log/2024-02-27-17-16-25-354419-headlightai-288316
[INFO] [launch]: Default logging verbosity is set to INFO
namespace:        
transport:        udp4
middleware:       dds
verbose:          4
discovery:        7400
port:             2019
refs:             /home/ash/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/config/dds_xrce_profile.xml
command:          arducopter
model:            json
speedup:          1
slave:            0
sim_address:      127.0.0.1
instance:         0
defaults:         /home/ash/ros2_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/config/gazebo-iris-gimbal.parm,/home/ash/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/config/default_params/dds_udp.parm
synthetic_clock:  True
command:          mavproxy.py
master:           tcp:127.0.0.1:5760
sitl:             127.0.0.1:5501
out:              127.0.0.1:14550
[INFO] [ruby $(which ign) gazebo-1]: process started with pid [288317]
[INFO] [ruby $(which ign) gazebo-2]: process started with pid [288319]
[INFO] [micro_ros_agent-3]: process started with pid [288322]
[INFO] [dds_udp.parm --synthetic-clock -4]: process started with pid [288325]
[INFO] [mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]: process started with pid [288329]
[INFO] [robot_state_publisher-6]: process started with pid [288332]
[INFO] [rviz2-7]: process started with pid [288335]
[dds_udp.parm --synthetic-clock -4] Setting SIM_SPEEDUP=1.000000
[dds_udp.parm --synthetic-clock -4] Starting SITL: JSON
[dds_udp.parm --synthetic-clock -4] JSON control interface set to 127.0.0.1:9002
[dds_udp.parm --synthetic-clock -4] Starting sketch 'ArduCopter'
[dds_udp.parm --synthetic-clock -4] Starting SITL input
[dds_udp.parm --synthetic-clock -4] Using Irlock at port : 9005
[dds_udp.parm --synthetic-clock -4] Waiting for connection ....
[dds_udp.parm --synthetic-clock -4] bind port 5760 for SERIAL0
[dds_udp.parm --synthetic-clock -4] SERIAL0 on TCP port 5760
[micro_ros_agent-3] [1709054185.495323] info     | UDPv4AgentLinux.cpp | init                     | running...             | port: 2019
[micro_ros_agent-3] [1709054185.495819] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 4
[robot_state_publisher-6] [ERROR] [1709054185.641156275] [sdformat_urdf]: Attempting to load a Sensor, but the provided sensor type is missing or invalid.
[robot_state_publisher-6] [ERROR] [1709054185.641235479] [sdformat_urdf]: Attempting to load a Sensor, but the provided sensor type is missing or invalid.
[robot_state_publisher-6] Failed to parse robot description using: sdformat_urdf_plugin/SDFormatURDFParser
[robot_state_publisher-6] terminate called after throwing an instance of 'std::runtime_error'
[robot_state_publisher-6]   what():  Unable to initialize urdf::model from robot description
[dds_udp.parm --synthetic-clock -4] Connection on serial port 5760
[dds_udp.parm --synthetic-clock -4] Loaded defaults from /home/ash/ros2_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/config/gazebo-iris-gimbal.parm,/home/ash/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/config/default_params/dds_udp.parm
[dds_udp.parm --synthetic-clock -4] bind port 5762 for SERIAL1
[dds_udp.parm --synthetic-clock -4] SERIAL1 on TCP port 5762
[dds_udp.parm --synthetic-clock -4] bind port 5763 for SERIAL2
[dds_udp.parm --synthetic-clock -4] SERIAL2 on TCP port 5763
[dds_udp.parm --synthetic-clock -4] Home: -35.363262 149.165237 alt=584.000000m hdg=353.000000
[ruby $(which ign) gazebo-1] [Err] [Server.cc:139] Error Code 5: Msg: Attempting to load a Sensor, but the provided sensor type is missing or invalid.
[ruby $(which ign) gazebo-1] [Err] [Server.cc:139] Error Code 5: Msg: Attempting to load a Sensor, but the provided sensor type is missing or invalid.
[ruby $(which ign) gazebo-1] [Err] [Server.cc:139] Error Code 9: Msg: Failed to load a world.
[ruby $(which ign) gazebo-1] [Msg] Ignition Gazebo Server v6.16.0
[ruby $(which ign) gazebo-1] [Msg] Loading SDF world file[/home/ash/ros2_ws/install/ardupilot_gz_gazebo/share/ardupilot_gz_gazebo/worlds/iris_runway.sdf].
[ruby $(which ign) gazebo-1] [Dbg] [gz.cc:410] Shutting down ign-gazebo-server
[INFO] [ruby $(which ign) gazebo-1]: process has finished cleanly [pid 288317]
[INFO] [launch]: process[ruby $(which ign) gazebo-1] was required: shutting down launched system
[INFO] [rviz2-7]: sending signal 'SIGINT' to process[rviz2-7]
[INFO] [robot_state_publisher-6]: sending signal 'SIGINT' to process[robot_state_publisher-6]
[INFO] [mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]: sending signal 'SIGINT' to process[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]
[INFO] [dds_udp.parm --synthetic-clock -4]: sending signal 'SIGINT' to process[dds_udp.parm --synthetic-clock -4]
[INFO] [micro_ros_agent-3]: sending signal 'SIGINT' to process[micro_ros_agent-3]
[INFO] [ruby $(which ign) gazebo-2]: sending signal 'SIGINT' to process[ruby $(which ign) gazebo-2]
[rviz2-7] [INFO] [1709054185.789501650] [rclcpp]: signal_handler(signum=2)
[ERROR] [micro_ros_agent-3]: process has died [pid 288322, exit code -2, cmd '/home/ash/ros2_ws/install/micro_ros_agent/lib/micro_ros_agent/micro_ros_agent udp4 --middleware dds --verbose 4 --port 2019 --refs /home/ash/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/config/dds_xrce_profile.xml --ros-args -r __node:=micro_ros_agent -r __ns:=/'].
[rviz2-7] [INFO] [1709054185.879054496] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-7] [INFO] [1709054185.879077894] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-7] [INFO] [1709054185.894143765] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-7] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[rviz2-7]   what():  failed to create guard condition: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at ./src/rcl/guard_condition.c:67
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] qrc:/qml/StyleDialog.qml:112:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] qrc:/qml/StyleDialog.qml:105:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] qrc:/qml/StyleDialog.qml:98:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] qrc:qml/Main.qml:102:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] qrc:/qml/PluginMenu.qml:27:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ruby $(which ign) gazebo-2] [GUI] [Wrn] [Application.cc:797] [QT] file::/Gazebo/GazeboDrawer.qml:242:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[ERROR] [robot_state_publisher-6]: process has died [pid 288332, exit code -6, cmd '/opt/ros/humble/lib/robot_state_publisher/robot_state_publisher --ros-args -r __node:=robot_state_publisher --params-file /tmp/launch_params_wqqyiujx --params-file /tmp/launch_params_vbkrq4o0'].
[dds_udp.parm --synthetic-clock -4] No JSON sensor message received, resending servos
[ERROR] [rviz2-7]: process has died [pid 288335, exit code -6, cmd '/opt/ros/humble/lib/rviz2/rviz2 -d /home/ash/ros2_ws/install/ardupilot_gz_bringup/share/ardupilot_gz_bringup/rviz/iris.rviz --ros-args'].
[dds_udp.parm --synthetic-clock -4] No JSON sensor message received, resending servos
[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] Connect tcp:127.0.0.1:5760 source_system=255
[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] Log Directory: 
[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] Telemetry log: mav.tlog
[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] Waiting for heartbeat from tcp:127.0.0.1:5760
[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] link 1 down
[dds_udp.parm --synthetic-clock -4] No JSON sensor message received, resending servos
[dds_udp.parm --synthetic-clock -4] No JSON sensor message received, resending servos
[ERROR] [mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]: process[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[ERROR] [dds_udp.parm --synthetic-clock -4]: process[dds_udp.parm --synthetic-clock -4] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[ERROR] [ruby $(which ign) gazebo-2]: process[ruby $(which ign) gazebo-2] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]: sending signal 'SIGTERM' to process[mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]
[INFO] [dds_udp.parm --synthetic-clock -4]: sending signal 'SIGTERM' to process[dds_udp.parm --synthetic-clock -4]
[INFO] [ruby $(which ign) gazebo-2]: sending signal 'SIGTERM' to process[ruby $(which ign) gazebo-2]
[ERROR] [dds_udp.parm --synthetic-clock -4]: process has died [pid 288325, exit code -15, cmd 'arducopter --model json --speedup 1 --slave 0 --sim-address=127.0.0.1 --instance 0 --defaults /home/ash/ros2_ws/install/ardupilot_gazebo/share/ardupilot_gazebo/config/gazebo-iris-gimbal.parm,/home/ash/ros2_ws/install/ardupilot_sitl/share/ardupilot_sitl/config/default_params/dds_udp.parm --synthetic-clock '].
[ERROR] [mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive -5]: process has died [pid 288329, exit code -15, cmd 'mavproxy.py --out 127.0.0.1:14550 --out 127.0.0.1:14551 --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --non-interactive '].
[ERROR] [ruby $(which ign) gazebo-2]: process has died [pid 288319, exit code -15, cmd 'ruby $(which ign) gazebo -v4 -g --force-version 6'].
[INFO] [launch]: process[ruby $(which ign) gazebo-2] was required: shutting down launched system

However I could successfully run the ros2 launch ardupilot_gz_bringup wildthumper_playpen.launch.py and it brings up gazebo and Rviz

Any pointers please. Thanks

Hey,
I was having this exact issue. The problem was that I didn’t explicitly install the “gz-garden” package. After installing it everything started working.

The logs show you are using ignition gazebo, likely fortress, which is not supported. Use garden or harmonic per the Wiki.