PyBullet loading URDF with Visual tag too small

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
avandekleut
Posts: 1
Joined: Mon Mar 23, 2020 2:37 pm

PyBullet loading URDF with Visual tag too small

Post by avandekleut » Mon Mar 23, 2020 2:43 pm

Hello,

I have a very simple URDF file containing a cylinder. When I load the cylinder, the radius appears to be too small. Here is the URDF file:

Code: Select all

<?xml version="1.0"?>
<robot name="testing">
  <link name="parent">
    <inertial><origin xyz="0 0 0" rpy="0 0 0"/><mass value="0"/><inertia ixx="0.0" ixy="0" ixz="0" iyy="0.0" iyz="0" izz="0.0"/></inertial>
    <collision><origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry><capsule radius="1" length="3"/></geometry>
    </collision>
    <visual><origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry><capsule radius="1" length="3"/></geometry>
      <material name="color"><color rgba="1 0 0 0.5"/></material>
    </visual>
  </link>
</robot>
and here is the code to load it

Code: Select all

import pybullet as p
import pybullet_data
physicsClient = p.connect(p.GUI)
p.setPhysicsEngineParameter(enableFileCaching=0)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
planeId = p.loadURDF("plane.urdf")
robot = p.loadURDF("test.urdf")
When I load this URDF, the radius is too small. The plane.urdf file has a regular square tiling of 1 metre by 1 metre. The cylinder edge does not touch any of the corners of the squares, even though it has a radius of 1.

Furthermore, when I remove the visual tag and just load the collision tag, the radius renders correctly.

What's going on?

Post Reply