Unable to spawn the urdf model
I am trying to follow the tutorial https://gazebosim.org/docs/garden/spa... . I have a URDF file which works fine in Rviz2.
While following the tutorial, I run the command ign gazebo empty.sdf
in one terminal. After running this command, I get an empty window as shown in the tutorial. Now, I open another terminal in the directory where the urdf file is and run the command gz service -s /world/empty/create --reqtype gz.msgs.EntityFactory --reptype gz.msgs.Boolean --timeout 1000 --req 'sdf_filename: "robot_new.urdf", name: "urdf_model"'
, I get two errors in the terminal window which are
Error [parser.cc:729] Error finding file [robot_new.urdf]
[Err] [UserCommands.cc:1138] Error Code 1: Msg: Unable to read file:robot_new.urdf
The urdf file is
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from robot_x.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="robot">
<!-- Specify some standard inertial calculations https://en.wikipedia.org/wiki/List_of_moments_of_inertia -->
<!-- These make use of xacro's mathematical functionality -->
<material name="white">
<color rgba="1 1 1 1"/>
</material>
<material name="orange">
<color rgba="1 0.3 0.1 1"/>
</material>
<material name="blue">
<color rgba="0.2 0.2 1 1"/>
</material>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
<!-- BASE LINK-->
<link name="base_link">
</link>
<!-- CHASSIS LINK -->
<link name="chassis">
<visual>
<geometry>
<box size="0.3 0.3 0.15"/>
</geometry>
<origin xyz="0.15 0 0.075"/>
<material name="white"/>
</visual>
<collision>
<geometry>
<box size="0.3 0.3 0.15"/>
</geometry>
<origin xyz="0.15 0 0.075"/>
<material name="white"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0.15 0 0.075"/>
<mass value="0.5"/>
<inertia ixx="0.004687499999999999" ixy="0.0" ixz="0.0" iyy="0.004687499999999999" iyz="0.0" izz="0.0075"/>
</inertial>
</link>
<!-- BASE_LINK CHASSIS JOINT-->
<joint name="chassis_joint" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin xyz="-0.1 0 0"/>
</joint>
<!-- LEFT WHEEL LINK -->
<link name="left_wheel">
<visual>
<geometry>
<cylinder length="0.04" radius="0.05"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<cylinder length="0.04" radius="0.05"/>
</geometry>
<material name="blue"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.1"/>
<inertia ixx="7.583333333333335e-05" ixy="0.0" ixz="0.0" iyy="7.583333333333335e-05" iyz="0.0" izz="0.00012500000000000003"/>
</inertial>
</link>
<joint name="left_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="left_wheel"/>
<axis xyz="0 0 1"/>
<origin rpy="-1.57075 0 0" xyz="0 0.175 0"/>
</joint>
<!-- RIGHT WHEEL LINK -->
<link name="right_wheel">
<visual>
<geometry>
<cylinder length="0.04" radius="0.05"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<cylinder length="0.04" radius="0.05"/>
</geometry>
<material name="blue"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.1"/>
<inertia ixx="7.583333333333335e-05" ixy="0.0" ixz="0.0" iyy="7.583333333333335e-05" iyz="0.0" izz="0.00012500000000000003"/>
</inertial>
</link>
<joint name="right_wheel_joint" type="continuous ...