0
$\begingroup$

I have the following AMR.urdf file

<robot
  name="AMR">
  <link name="base_footprint"/>

  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin xyz="0.0 0.0 0.21" rpy="0 0 0"/>
  </joint>
  <link
    name="base_link">
    <inertial>
      <origin
        xyz="-0.001608 1.7089E-05 -0.037394"
        rpy="0 0 0" />
      <mass
        value="6.4118" />
      <inertia
        ixx="0.056928"
        ixy="3.7366E-05"
        ixz="-0.000651"
        iyy="0.058024"
        iyz="-1.0318E-08"
        izz="0.091726" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.066666 0.003921 1 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="lidar1">
    <inertial>
      <origin
        xyz="0.0025954 0.00035629 -0.010164"
        rpy="0 0 0" />
      <mass
        value="0.02126" />
      <inertia
        ixx="2.4452E-06"
        ixy="3.2059E-09"
        ixz="-6.3369E-07"
        iyy="3.8209E-06"
        iyz="-1.2436E-08"
        izz="4.3721E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/lidar1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0 0 0 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/lidar1.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="lidar_fixed1"
    type="fixed">
    <origin
      xyz="-0.14596 -0.10031 -0.03"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="lidar1" />
    <axis
      xyz="0 0 0" />
  </joint>
  <link
    name="lidar2">
    <inertial>
      <origin
        xyz="-0.0025954 -0.00035629 -0.010164"
        rpy="0 0 0" />
      <mass
        value="0.02126" />
      <inertia
        ixx="2.4452E-06"
        ixy="3.2059E-09"
        ixz="6.3369E-07"
        iyy="3.8209E-06"
        iyz="1.2436E-08"
        izz="4.3721E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/lidar2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0 0 0 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/lidar2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="fixed_lidar2"
    type="fixed">
    <origin
      xyz="0.14596 0.10031 -0.03"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="lidar2" />
    <axis
      xyz="0 0 0" />
  </joint>
  <link
    name="right_wheel">
    <inertial>
      <origin
        xyz="-7.7318E-07 0.0060585 0.1"
        rpy="0 0 0" />
      <mass
        value="0.051919" />
      <inertia
        ixx="3.4107E-05"
        ixy="8.1903E-11"
        ixz="1.0913E-12"
        iyy="6.685E-05"
        iyz="-6.5152E-14"
        izz="3.4106E-05" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/right_wheel.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/right_wheel.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="right_joint"
    type="continuous">
    <origin
      xyz="0.0025 -0.1013 -0.1"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="right_wheel" />
    <axis
      xyz="0 -1 0" />
    <!--<limit
      effort="0"
      velocity="0" />-->
  </joint>
  <link
    name="left_wheel">
    <inertial>
      <origin
        xyz="-7.7318E-07 -0.0059585 0.1"
        rpy="0 0 0" />
      <mass
        value="0.051919" />
      <inertia
        ixx="3.4107E-05"
        ixy="-8.1903E-11"
        ixz="-1.0913E-12"
        iyy="6.685E-05"
        iyz="-6.5152E-14"
        izz="3.4106E-05" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/left_wheel.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/left_wheel.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="left_joint"
    type="continuous">
    <origin
      xyz="0.0025 0.1012 -0.1"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="left_wheel" />
    <axis
      xyz="0 -1 0" />
    <!--<limit
      effort="0"
      velocity="0" />-->
  </joint>
  <link
    name="caster_wheel_1">
    <inertial>
      <origin
        xyz="-0.01689 -6.9165E-05 -0.03779"
        rpy="0 0 0" />
      <mass
        value="0.033984" />
      <inertia
        ixx="5.8935E-06"
        ixy="7.4544E-08"
        ixz="-7.5376E-07"
        iyy="1.1637E-05"
        iyz="2.6501E-08"
        izz="8.0534E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_1.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="caster_j1"
    type="continuous">
    <origin
      xyz="-0.096789 0.112 -0.1215"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="caster_wheel_1" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="caster_wheel_2">
    <inertial>
      <origin
        xyz="-0.01689 -6.9165E-05 -0.03779"
        rpy="0 0 0" />
      <mass
        value="0.033984" />
      <inertia
        ixx="5.8935E-06"
        ixy="7.4544E-08"
        ixz="-7.5376E-07"
        iyy="1.1637E-05"
        iyz="2.6501E-08"
        izz="8.0534E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="caster_j2"
    type="continuous">
    <origin
      xyz="-0.096789 -0.112 -0.1215"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="caster_wheel_2" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="caster_wheel_3">
    <inertial>
      <origin
        xyz="0.01689 6.9165E-05 -0.03779"
        rpy="0 0 0" />
      <mass
        value="0.033984" />
      <inertia
        ixx="5.8935E-06"
        ixy="7.4544E-08"
        ixz="7.5376E-07"
        iyy="1.1637E-05"
        iyz="-2.6501E-08"
        izz="8.0534E-06" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_3.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_3.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="caster_j3"
    type="continuous">
    <origin
      xyz="0.082915 0.11207 -0.1215"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="caster_wheel_3" />
    <axis
      xyz="0 0 1" />
  </joint>
  <link
    name="caster_wheel_4">
    <inertial>
      <origin
        xyz="-0.001608 1.7089E-05 -0.037394"
        rpy="0 0 0" />
      <mass
        value="6.4118" />
      <inertia
        ixx="0.056928"
        ixy="3.7366E-05"
        ixz="-0.000651"
        iyy="0.058024"
        iyz="-1.0318E-08"
        izz="0.091726" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_4.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.2470 0.2196 0.2196 0.79" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0.05"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://AMR/meshes/caster_wheel_4.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="caster_j4"
    type="continuous">
    <origin
      xyz="0.082915 -0.11207 -0.1215"
      rpy="0 0 0" />
    <parent
      link="base_link" />
    <child
      link="caster_wheel_4" />
    <axis
      xyz="0 0 1" />
  </joint>

</robot>

I try to spawn the URDF into gazebo by following the command.

ros2 run gazebo_ros spawn_entity.py -entity AMR -file /home/dell/catkin_ros2_ws/src/AMR/urdf/AMR.urdf -x 0 -y 0 -z 0

[INFO] [1694174949.993357631] [spawn_entity]: Spawn Entity started
[INFO] [1694174949.993858462] [spawn_entity]: Loading entity XML from file /home/dell/catkin_ros2_ws/src/AMR/urdf/AMR.urdf
[INFO] [1694174949.994878476] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[INFO] [1694174949.995208811] [spawn_entity]: Waiting for service /spawn_entity
[INFO] [1694174949.999390617] [spawn_entity]: Calling service /spawn_entity
[INFO] [1694174950.277502483] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [AMR]

Terminal show Successfully spawned but their is no robot spawn in gazebo IMAGE

$\endgroup$
2
  • $\begingroup$ how do you solve the problem? (I can't make comment) $\endgroup$ Commented Feb 3 at 16:39
  • $\begingroup$ The answer is mentioned below $\endgroup$
    – Mubashir
    Commented Feb 5 at 14:25

1 Answer 1

0
$\begingroup$

Is your model listed under Models/AMR in gazebo?

Have a look at ~/.gazebo/server-xxx/default.log

I have the same behavior with your file, because I don't have access to the STL files. Maybe this is the problem with your setup, too

(1694588803 305452291) [Wrn] [FuelModelDatabase.cc:313] URI not supported by Fuel [model://AMR/meshes/base_link.STL]  
(1694588803 305476776) [Wrn] [SystemPaths.cc:459] File or path does not exist [""] [model://AMR/meshes/base_link.STL]
$\endgroup$
3
  • $\begingroup$ Here is the link to the whole package that contains stl file in meshes foler package $\endgroup$
    – Mubashir
    Commented Sep 15, 2023 at 12:53
  • $\begingroup$ Is your model listed under Models/AMR in gazebo? Have a look at ~/.gazebo/server-xxx/default.log if you have the same problem $\endgroup$ Commented Sep 16, 2023 at 10:02
  • $\begingroup$ Thank you. Problem Solved :) $\endgroup$
    – Mubashir
    Commented Sep 16, 2023 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.