bullet3 icon indicating copy to clipboard operation
bullet3 copied to clipboard

When we directly specify a cylinder with a length of 500 and a radius of 10 in URDF, it is often larger than this size in pybullet.

Open Hobbit-wgh opened this issue 1 year ago • 0 comments

When we directly specify a cylinder with a length of 500 and a radius of 10 in URDF, it is often larger than this size in pybullet. In detail,I want to insert the 20mm (urdf directly defined) axis into the 21mm hole (stl file import), but the axis can not be inserted.

suach as: axis's urdf and fixed on ur5 end link:

<link name="FT_link">
    <inertial>
      <mass value="0.15"/>
      <origin rpy="0 0 0" xyz="0.0 0.0 -0"/>
      <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0" iyz="0.0" izz="0"/>
    </inertial>
    <visual>
      <geometry>
        <cylinder length="0.05" radius="0.01"/>
      </geometry>
      <material name="white">
        <color rgba="0.7 0.7 0.7 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.05" radius="0.01"/>
      </geometry>
    </collision>
  </link>

we also try defined a stl :+1:

  <link name="FT_link">
    <inertial>
      <mass value="0.15"/>
      <origin rpy="0 0 0" xyz="0.0 0.0 0"/>
      <inertia ixx="0.0" ixy="0.0" ixz="0.0" iyy="0" iyz="0.0" izz="0"/>
    </inertial>
    <visual>
      <geometry>
       <!-- <cylinder length="0.05" radius="0.010000000000"/> -->
        <mesh filename="package://ur_description/meshes/ur5/collision/hold20J.STL"/>
      </geometry>
      
      <!-- <geometry>
        <cylinder length="0.05" radius="0.01"/>
      </geometry> -->
      <material name="white">
        <color rgba="0.7 0.7 0.7 1.0"/>
      </material>
    </visual>
    <collision>
      <geometry>
       <!-- <cylinder length="0.05" radius="0.01000000000000"/> -->
        <mesh filename="package://ur_description/meshes/ur5/collision/hold20J.STL"/>
      </geometry>
    </collision>
  </link>
  <joint name="FT_joint" type="fixed">
    <parent link="ee_link"/>
    <child link="FT_link"/>
     <!-- <origin rpy="0 1.57079632679 0" xyz="0.03 0 0.0"/> -->
    <origin rpy="0  0 -1.57079632679" xyz="0.005 0 0.0"/>
  </joint>

hole:

'''

<?xml version='1.0'?>
<sdf version='1.6'>
  <model name='fangk'>
    <link name='link_0'>
      <inertial>
        <mass>5000</mass>
        <inertia>
          <ixx>0.166667</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>0.166667</iyy>
          <iyz>0</iyz>
          <izz>0.166667</izz>
        </inertia>
        <pose frame=''>0 0 0 0 -0 0</pose>
      </inertial>
      <!-- <pose frame=''>0 -0 10 0 -0 0</pose> -->
      <pose frame=''>0 -0 0.32 1.5707 -0 0</pose>
      <gravity>1</gravity>
      <self_collide>0</self_collide>
      <kinematic>0</kinematic>
      <enable_wind>0</enable_wind>
      <visual name='visual'>
        <pose frame=''>-0 0 0 0 -0 0</pose>
        <geometry>
          <mesh>
            <uri>model://fangkuai/meshes/fk.STL</uri>
            <!-- <scale>1 1 1</scale> -->
          </mesh>
        </geometry>
        <material>
          <lighting>1</lighting>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
          <shader type='vertex'>
            <normal_map>__default__</normal_map>
          </shader>
        </material>
        <transparency>0</transparency>
        <cast_shadows>1</cast_shadows>
      </visual>
      <collision concave = 'yes' name='collision'>
        <laser_retro>0</laser_retro>
        <max_contacts>10</max_contacts>
        <pose frame=''>-0 0 0.0 0 -0 0</pose>
        <geometry>
          <mesh>
            <uri>model://fangkuai/meshes/fk.STL</uri>
            <!-- <scale>1 1 1</scale> -->
          </mesh>
        </geometry>
      </collision>
    </link>
    <static>1</static>
    <allow_auto_disable>1</allow_auto_disable>
  </model>

</sdf>

the hold20J.STL: hold20J.zip

the fk.STL: fangkuai.zip 截图_2023-06-19_15-09-22

Hobbit-wgh avatar Jun 19 '23 07:06 Hobbit-wgh