Geometry resolution importing from URDF

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
yconst
Posts: 3
Joined: Tue Dec 12, 2017 11:31 pm
Contact:

Geometry resolution importing from URDF

Post by yconst » Thu Feb 01, 2018 10:51 am

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
wh.png (84.34 KiB) Viewed 363 times
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>

User avatar
Erwin Coumans
Site Admin
Posts: 4113
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Geometry resolution importing from URDF

Post by Erwin Coumans » Wed Feb 07, 2018 3:57 am

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.

Post Reply