Gazebo didn't launch with urdf

Running on vm, I created a simple launch file to launch Gazebo with the robot urdf, an error was shown.

launch file Content:
<launch><include file="$(find gazebo_ros)/launch/empty_world.launch"/><node name="spawn_model" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -model turtlebot -param robot_description"><param name="robot_description" textfile="$(find multi_robot)/src/turtlebot.urdf"/></node></launch>

urdf
<?xml version="1.0"?><robot name="turtlebot"><link name="base_link"><visual><geometry><box size="0.5 0.5 0.5"/></geometry></visual></link></robot>



Attempted to solve the issue:

  1. checked directory, path
  2. remove build and devel, source /opt/ros/noetic/setup.bash, ~/.bashrc and ws setup.bash, redo catkin_make
  3. checked gazebo_msgs, gazebo_ros to have all the packages, script, correct node name, dependencies
  4. rosdep update, sudo apt update, updated noetic, sudo rosdep fix-permissions
  5. reinstalled Gazebo

Persisted issue:
Gazebo was unable to load urdf, robot model, world. But the insert function can manually add them.


Error message:
[ INFO] [1692378515.995051190]: Finished loading Gazebo ROS API Plugin. [spawn_model-4] process has died /home/user/catkin_ws/devel/lib/gazebo_ros/spawn_model -urdf -model turtlebot -param robot_description __name:=spawn_model __log:=/home/user/.ros/log/dd4d5694-3de9-11ee-bbc9-ededcfbcc7ca/spawn_model-4.log]. log file: /home/user/.ros/log/dd4d5694-3de9-11ee-bbc9-ededcfbcc7ca/spawn_model-4*.log [ INFO] [1692378516.697968553]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1692378516.735021098, 0.019000000]: Physics dynamic reconfigure ready.


spawn_mode-4.log
[rospy.client][INFO] 2023-08-18 17:08:35,621: init_node, name[/spawn_model], pid[64745] [xmlrpc][INFO] 2023-08-18 17:08:35,621: XML-RPC server binding to 0.0.0.0:0 [xmlrpc][INFO] 2023-08-18 17:08:35,622: Started XML-RPC server [http://a-vm:35987/] [rospy.init][INFO] 2023-08-18 17:08:35,622: ROS Slave URI: [http://a-vm:35987/] [rospy.impl.masterslave][INFO] 2023-08-18 17:08:35,622: _ready: hhttp://a-vm:35987/ [rospy.registration][INFO] 2023-08-18 17:08:35,623: Registering with master node http://localhost:11311 [xmlrpc][INFO] 2023-08-18 17:08:35,623: xml rpc node: starting XML-RPC server [rospy.init][INFO] 2023-08-18 17:08:35,723: registered with master [rospy.rosout][INFO] 2023-08-18 17:08:35,723: initializing /rosout core topic [rospy.rosout][INFO] 2023-08-18 17:08:35,729: connected to core topic /rosout [rospy.simtime][INFO] 2023-08-18 17:08:35,730: initializing /clock core topic [rospy.simtime][INFO] 2023-08-18 17:08:35,732: connected to core topic /clock [rosout][INFO] 2023-08-18 17:08:35,734: Loading model XML from ros parameter robot_description [rospy.core][INFO] 2023-08-18 17:08:35,861: signal_shutdown [atexit] [rospy.impl.masterslave][INFO] 2023-08-18 17:08:35,864: atexit

Hi @rcway,

I recommend asking this question on https://robotics.stackexchange.com/ which is the right place to ask this kind of question. I will be happy to answer there.

I found the solution

    <launch>
           <include file="$(find gazebo_ros)/launch/empty_world.launch"/>
           <param name="robot_description" textfile="$(find multi_robot)/src/turtlebot.urdf"/>
           <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -model turtlebot -param robot_description">
           </node>
    </launch>```