0
$\begingroup$

I am trying to create a sphere that I can control through pybullet. I have a basic urdf specification that looks like this:

<?xml version="0.0" ?>
<robot name="urdf_robot">
<link name="base_link">
  <contact>
    <rolling_friction value="0.005"/>
    <spinning_friction value="0.005"/>
  </contact>
  <inertial>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <mass value="0.17"/>
    <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
  </inertial>
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="textured_sphere_smooth.obj" scale="0.5 0.5 0.5"/>
    </geometry>
    <material name="white">
      <color rgba="1 1 1 1"/>
    </material>
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <sphere radius="0.5"/>
    </geometry>
  </collision>
</link>
</robot>

But to control velocity instead of only external force I need add a joint. I tried adding a floating joint:

<joint name="control" type="fixed">
  <parent link="base_link"/>
  <child link="internal_link"/>
  <origin xyz="0.0 0.0 0.5"/>
</joint>
<link name="internal_link">
  <inertial>
    <mass value="0.1"/>
    <origin xyz="0 0 0"/>
    <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="0.01"/>
  </inertial>
</link>

but pybullet crashes when trying to load that without a helpful message. I don't know urdf well. Any ideas? Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

The joint type you've added to the URDF is fixed rather than the desired floating. Fortunately, floating is indeed a type of joint listed in the URDF Joint spec. I am not familiar with pybullet so I can't speak to whether this is the underlying issue with it crashing. It could also be an issue with the XML version being 0.0; it needs to be at least 1.0. As for your updated URDF:

<?xml version="1.0" ?>
<robot name="urdf_robot">
<joint name="control" type="floating">
  <parent link="base_link"/>
  <child link="internal_link"/>
  <origin xyz="0.0 0.0 0.5"/>
</joint>
<link name="internal_link">
  <inertial>
    <mass value="0.1"/>
    <origin xyz="0 0 0"/>
    <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="0.01"/>
  </inertial>
</link>
<link name="base_link">
  <contact>
    <rolling_friction value="0.005"/>
    <spinning_friction value="0.005"/>
  </contact>
  <inertial>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <mass value="0.17"/>
    <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
  </inertial>
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="textured_sphere_smooth.obj" scale="0.5 0.5 0.5"/>
    </geometry>
    <material name="white">
      <color rgba="1 1 1 1"/>
    </material>
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <sphere radius="0.5"/>
    </geometry>
  </collision>
</link>
</robot>
$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.