Can not show stl model in rviz2

asked 2022-04-09 02:10:25 -0600

DDDog gravatar image

the urdf file is like this :

<robot name="cakin">

  <material name="white">
    <color rgba="1 1 1 1"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 1"/>
  </material>

  <link name="base"> #リンクの設定
    <visual>
      <geometry>
        <box size="2 2 2"/>
      </geometry>
      <origin xyz="0 0 1" rpy="0 0 0" />
      <material name="white"/>
    </visual>
  </link>

  <link name="body"> #リンクの設定
    <visual>
      <geometry>
        <!-- <cylinder length="1" radius="0.5"/> -->
        <mesh filename="package://fucku/meshes/triangle.stl"/>
      </geometry>
      <origin xyz="0 0 2.5" rpy="0 0 0" />
      <material name="white"/>
    </visual>
  </link>

  <joint name="body_joint" type="fixed"> #ジョイントの設定
    <parent link="base"/> #ジョイントの親を指定
    <child  link="body"/> #ジョイントの子を指定
    <origin xyz="0 0 2"/>
  </joint>

</robot>

I put the stl model in path "src/packagename/meshes/triangle.stl" the <box size="2 2 2"/> can be shown, but stl model can not be shown. where is my problem?

edit retag flag offensive close merge delete

Comments

did you export the folder meshes in your CMakeLists?

Joe28965 gravatar image Joe28965  ( 2022-04-12 04:18:28 -0600 )edit