0

I am trying to use a convex mesh as collision geometry in drake. In my simple example I have a ground plane as the first collision geometry and load the object from the urdf file below. Where tri_cube.obj is a convex mesh from drake/multibody/parsing/test/urdf_parser_test. When I run the simulation it proceeds until the cube would impact on the ground plane. Then it stops and I get the following error message: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV). Any help would be greatly appreciated.

<?xml version="1.0"?>
<robot name="my_ball">
  <material name="Black">
    <color rgba="0.0 0.0 0.0 1.0"/>
  </material>
  <link name="base_link">
    <inertial>
      <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
      <mass value="5"/>
      <inertia ixx="0.05" ixy="0" ixz="0" iyy="0.05" iyz="0" izz="0.05"/>
    </inertial>
    <visual>
      <geometry>
        <mesh filename="tri_cube.obj" scale="1.0 1.0 1.0">
        </mesh>
      </geometry>
      <material name="Black"/>
    </visual>

    <collision name='collision'>
     <geometry>
       <mesh filename="tri_cube.obj" scale="1.0 1.0 1.0">
         <drake:declare_convex/>
       </mesh>
     </geometry>

    <drake:proximity_properties>
     <drake:mu_dynamic value="1.0" />
     <drake:mu_static value="1.0" />
    </drake:proximity_properties>
   </collision>
  </link>
</robot>
nicolas
  • 13
  • 3
  • Can you elaborate on how you add the ground plane? – Sean Curtis Apr 28 '20 at 15:28
  • @Sean I am using `plant.RegisterVisualGeometry()` and `plant.RegisterCollisionGeometry()` with `shape=HalfSpace()`. The code is pretty much the same as the one related to this question [link](https://stackoverflow.com/questions/61462409/modelling-elastic-collisions-in-drake). – nicolas Apr 29 '20 at 06:03
  • I'll see if I can duplicate this locally. – Sean Curtis Apr 29 '20 at 13:00
  • Quick update -- the seg fault comes from FCL (possibly fueled by data Drake is passing). I'm going to have to delve deeper before I have an answer/fix. – Sean Curtis Apr 30 '20 at 22:01

1 Answers1

1

I have a short-term and long-term answer for you:

Short-term: Replace the ground half space with a large box whose top face is co-planar with the half space boundary.

Long-term: FCL has a bug that needs to be patched. There's no reason it shouldn't be able to support half space-convex contact. For some inexplicable reason, it isn't enabled. Because it isn't enabled, it ends up spiraling down a code path that explicitly can't support half spaces and then silently seg faults.

I'll update FCL and when that happens, Drake will inherit the goodness. It'll probably take me a few days to patch, test, review, and propagate through to Drake. So, if the time frame doesn't work, use the short-term "box" solution.

I'll update this when FCL is patched and that patch is reflected in Drake.

Sean Curtis
  • 1,425
  • 7
  • 8
  • Issue posted: https://github.com/flexible-collision-library/fcl/issues/468 – Sean Curtis Apr 30 '20 at 22:51
  • I replaced the half space with a box and it works. Thanks for the help! – nicolas May 03 '20 at 16:53
  • The [FCL patch](https://github.com/flexible-collision-library/fcl/pull/469) has gone through. And Drake master is [now using](https://github.com/RobotLocomotion/drake/pull/13274) it. You should be able to swap back to half space and get expected results (and a slight boost in performance). – Sean Curtis May 12 '20 at 19:07