Spawn urdf in gazebo fails

hi
trying to spawn urdf model in gazebo (unit 2)

launch file is

<?xml version="1.0" encoding="UTF-8"?>

<launch>

    <arg name="x" default="0.0" />
    <arg name="y" default="0.0" />
    <arg name="z" default="0.0" />

    <arg name="urdf_robot_file" default="" />
    <arg name="robot_name" default="" />

    <!-- This Version was created due to some errors seen in the V1 that crashed GAzebo or went too slow in spawn -->
    <!-- Load the URDF into the ROS Parameter Server -->
    <param name="robot_description" command="cat $(arg urdf_robot_file)" />

    <!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
    args="-urdf -x $(arg x) -y $(arg y) -z $(arg z)  -model $(arg robot_name) -param robot_description"/>
</launch>
<?xml version="1.0" encoding="UTF-8"?>
<launch>
    <include file="$(find my_mira_description)/launch/spawn_urdf.launch">
        <arg name="x" value="0.0" />
        <arg name="y" value="0.0" />
        <arg name="z" value="0.2" />
        <arg name="urdf_robot_file" value="$(find my_mira_description)/urdf/mira_simple_collisions_inertias.urdf" />
        <arg name="robot_name" value="mira" />
    </include>
</launch>

urdf file

<?xml version="1.0"?>
<!-- * * * Link Definitions * * * -->
<link name="base_link">
    <inertial>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <mass value="0.18" />
        <inertia ixx="0.0002835" ixy="0.0" ixz="0.0" iyy="0.0002835" iyz="0.0" izz="0.000324"/>
    </inertial>
    <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder radius="0.06" length="0.09"/>
        </geometry>
    </collision>
    <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder radius="0.06" length="0.09"/>
        </geometry>
    </visual>
</link>  

<gazebo reference="base_link">
    <kp>100000.0</kp>
    <kd>100000.0</kd>
    <mu1>10.0</mu1>
    <mu2>10.0</mu2>
    <material>Gazebo/Grey</material>
</gazebo>

I’m getting an error

roslaunch my_mira_description spawn_mira_simple_collisions_inertias.launch
... logging to /home/user/.ros/log/d46b8816-266c-11ec-b15c-0242c0a81006/roslaunch-2_xterm-7422.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://2_xterm:32983/

SUMMARY
========

PARAMETERS
 * /robot_description: <!-- * * * Link D...
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://2_simulation:11311

process[urdf_spawner-1]: started with pid [7432]
SpawnModel script started
[INFO] [1633503496.174905, 0.000000]: Loading model XML from ros parameter
[INFO] [1633503496.176653, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1633503496.179223, 0.000000]: Calling service /gazebo/spawn_urdf_model
Service call failed: service [/gazebo/spawn_urdf_model] responded with an error:
[urdf_spawner-1] process has finished cleanly
log file: /home/user/.ros/log/d46b8816-266c-11ec-b15c-0242c0a81006/urdf_spawner-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete

What can be the problem?

thanks

Hello @NahumL ,

Your URDF file is missing some things: Try with this one:

<?xml version="1.0"?>
<robot name="mira">

    <material name="grey">
        <color rgba="0.75 0.75 0.75 1"/>
    </material>
    <material name="red">
        <color rgba="0.8 0 0 1"/>
    </material>

    <link name="base_link">
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="0.18" />
            <inertia ixx="0.0002835" ixy="0.0" ixz="0.0" iyy="0.0002835" iyz="0.0" izz="0.000324"/>
        </inertial>

        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <cylinder radius="0.06" length="0.09"/>
            </geometry>
        </collision>

        <visual>
            <origin rpy="0.0 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder radius="0.06" length="0.09"/>
            </geometry>

            <material name="grey"/>

        </visual>
    </link>

    <gazebo reference="base_link">
        <kp>100000.0</kp>
        <kd>100000.0</kd>
        <mu1>10.0</mu1>
        <mu2>10.0</mu2>
        <material>Gazebo/Grey</material>
    </gazebo>

    <link name="roll_M1_link">
        <!-- Inertial for gazebo to take it into account, Put 1gr weight -->
        <inertial>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <mass value="0.001" />
            <inertia ixx="2.70833333333e-08" ixy="0.0" ixz="0.0" iyy="2.70833333333e-08" iyz="0.0" izz="5e-08"/>
        </inertial>
        <visual>
            <origin rpy="0 0 0" xyz="0 0 0"/>
            <geometry>
                <cylinder length="0.005" radius="0.01"/>
            </geometry>
            <material name="red"/>
        </visual>
    </link>

    <gazebo reference="roll_M1_link">
        <kp>1000.0</kp>
        <kd>10.0</kd>
        <mu1>10.0</mu1>
        <mu2>10.0</mu2>
        <material>Gazebo/Red</material>
    </gazebo>

    <joint name="roll_joint" type="revolute">
        <parent link="base_link"/>
        <child link="roll_M1_link"/>
        <origin xyz="0.0023 0 -0.0005" rpy="0 0 0"/>
        <limit lower="-0.2" upper="0.2" effort="0.1" velocity="0.005"/>
        <axis xyz="1 0 0"/>
    </joint>

</robot>

thanks, this works,=