3

(This is from a Drake Slack conversation.)

I'm playing with an "exploding IIWA" demo to prototype some workflows with MultibodyPlant and SceneGraph. Basically, I'm just adding a robot arm that has articulation (revolute joints between multiple links) and dropping the robot arm from a height. When it hits a certain point, I want to pause the simulation, remove all of the joints, and the resume the simulation.

Here is the code that I am working with (which needs some Drake PRs at present to work off of a binary build):

multibody_plant_subgraph_test.py

However, when I try all of the joints and simulate, I get the following assertion from Drake's TAMSI Solver:

  File ".../common/test/multibody_plant_subgraph_test.py", line 345, in do_falling_exploding_sim
    simulator_new.AdvanceTo(2.)
SystemExit: Failure at external/drake/multibody/plant/tamsi_solver.cc:217 in SolveQuadraticForTheSmallestPositiveRoot(): condition 'Delta > 0' failed.

Any ideas as to why this happens?

FTR This is what the simulation looks like if I just remove the collisions and futz with the velocities:

sim

Eric Cousineau
  • 1,944
  • 14
  • 23

1 Answers1

2

From Sherm's answer:

Do you have any massless or inertialess bodies in there? Those are OK as long as they are interior to a multibody tree, but not as terminal nodes. After you remove the joints all the bodies are terminal.

This ended up being the case. I just needed to make sure that I removed all massless bodies in this case, and everything worked:

commit with relevant change

What it looks like without doing the collision removal / velocity hacks (inertia + collisions look not so great, but it's a step in the right direction):

enter image description here

Eric Cousineau
  • 1,944
  • 14
  • 23
  • 1
    Good call Sherm! It looks like your collision geometry is spheres? I imagine that's the cause for the free bodies to behave like spinning tops after the collision. BTW, all collisions are inelastic. So you won't get pieces bouncing around. – Alejandro May 27 '20 at 12:25
  • Yup, currently using spheres: [code](https://github.com/EricCousineau-TRI/repro/blob/01be6e74dc0ba88264f2f3ce1b2c50b1e105cc36/drake_stuff/multibody_plant_prototypes/test/multibody_plant_subgraph_test.py#L165-L166). And makes sense on the inelastic part! Is elastic-ish collision at all possible with the non-hydroelastic collision model (e.g. a parameter)? – Eric Cousineau May 27 '20 at 17:05
  • 1
    We (Joe actually) are working on allowing this by letting you change the contact parameters. Coming up soon! – Alejandro May 28 '20 at 17:32