Inverse kinematic, convergence Problems only if using STL files

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
chrischii
Posts: 4
Joined: Fri Dec 25, 2020 6:11 pm

Inverse kinematic, convergence Problems only if using STL files

Post by chrischii »

Hi,

I am a PhD student trying to use PyBullet for clash simulations.

I have set up a model using an URDF file consisting of bodies with geometry described with cylinders.

Code: Select all

  <link name="part6">
  <inertial>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <mass value="1e-6"/>
    <inertia ixx="1e-6" ixy="1e-6" ixz="1e-6" iyy="1e-6" iyz="1e-6" izz="1e-6"/>
  </inertial>
  <visual>
    <origin rpy="1.57079 0 0" xyz="0 -1 0"/>
    <geometry>
        <cylinder radius="0.05" length="2"/>
    </geometry>
    <material name="Green"/>
  </visual>
  <collision>
    <origin rpy="1.57079 0 0" xyz="0 -1 0"/>
    <geometry>
        <cylinder radius="0.05" length="2"/>
    </geometry>
  </collision>	
  </link>	
  
This model converges, the residuum is very small.
>>> simulate(steps_)
result: ({'islandId': 8, 'numBodies': 9, 'numIterationsUsed': 13640, 'remainingResidual': 1.3439036802013416e-06},)
result: ({'islandId': 8, 'numBodies': 9, 'numIterationsUsed': 7394348, 'remainingResidual': 9.57627865711726e-06},)

As soon as I replace one part with STL geometry instead of cylinders, the residuum is way too high. Result is that joints constraints are not working and bodies are moving free in space.

Code: Select all

 <link name="part6">
  <inertial>
    <origin rpy="0 0 0" xyz="0 0 0 "/>
    <mass value="1e-6"/>
    <inertia ixx="1e-6" ixy="1e-6" ixz="1e-6" iyy="1e-6" iyz="1e-6" izz="1e-6"/>
  </inertial>
  <visual>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="part6.stl"/>
    </geometry>
    <material name="Blue"/>
  </visual>
  <collision>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <geometry>
      <mesh filename="part6.stl"/>
    </geometry>
  </collision>	
  </link>	
To be sure that the STL geometry is not too complex, I used a simple box. It makes no difference which part I replace, the effect is the same.
>>> simulate(steps_)
result: ({'islandId': 8, 'numBodies': 9, 'numIterationsUsed': 1000000000, 'remainingResidual': 6700.951337930589},)
result: ({'islandId': 8, 'numBodies': 9, 'numIterationsUsed': 1000000000, 'remainingResidual': 5282.910818305261},)
I have attached a simlified model. Some short explanations:
- 2 urdf files are needed since it is a closed loop system
- dummypart is used because PyBullet does not support revolute constraint between 2 models (createConstraint)

Any help is highly appreciated
Christian
Attachments
forum.zip
(3.23 KiB) Downloaded 843 times
Post Reply