Page 1 of 1

Geometry resolution importing from URDF

Posted: Thu Feb 01, 2018 10:51 am
by yconst
I am importing a simple model made out of a box and two cylinders from URDF. When I import the cylinders are visibly jagged (low resolution geometry).
wh.png
While I am not so much interested in the visual appearance, I can imagine that this also affects collision.

Question is, how can I increase the resolution of *collision* geometry when importing? Is it a URDF thing or pybullet?

Thank you.

Partial URDF is below:

Code: Select all

<link name="l_wheel">
    <visual>
      <geometry>
        <cylinder length="0.02" radius="0.05"/>
      </geometry>
      <origin rpy="0 1.5707963 0" xyz="0 0 0"/>
      <material name="black"/>
    </visual>
    <collision>
      <geometry>
        <cylinder length="0.02" radius="0.05"/>
      </geometry>
      <origin rpy="0 1.5707963 0" xyz="0 0 0"/>
      <contact_coefficients mu="0.8" />
    </collision>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0" iyy="0.0001" iyz="0.0" izz="0.0001"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </inertial>
  </link>

Re: Geometry resolution importing from URDF

Posted: Wed Feb 07, 2018 3:57 am
by Erwin Coumans
You can use the flags=pybullet.URDF_USE_IMPLICIT_CYLINDER in loadURDF, then it uses an implicit cylinder. Alternatively, just model a tesselated cylinder in Blender (or other 3d modeler) at the resolution you like, and write it to a wavefront OBJ file and use that.