Closed arvismay closed 1 year ago
Generalize hydro-elastic collision mesh and pressure field to handle arbitrary tetmesh created in external tetrahedralizers like tetgen or tetwild. Possibly decouple the collision mesh from the pressure field so that the pressure field elements can be denser than the collision mesh elements.
To clarify, there are two good suggestions here. But they are largely independent and it's worth separating them.
Therefore, the primary recommendation of this issue: externally generated hydro meshes, is achievable. The second idea, not so much.
I think I phrased the second idea incorrectly. It still might not be a great idea, but here's an attempt at rephrasing it.
It could be useful to decouple the definition of the pressure field from the collision mesh. The pressure field could be a higher or lower res embedded mesh, or even a signed distance function. The collision mesh still serves as the actual mesh on which the equilibrium pressure is calculated. Decoupling allows the user to update the collision mesh while leaving the pressure field the same.
We might be talking about two slightly different problem domains: hydroelastic algorithm evaluation and input parameter generation.
In this context, I interpret what you say as an attempt to decouple two things that cannot be decoupled. The algorithms for finding the contact surface are tightly coupled with how a pressure field is represented within each tetrahedron. Currently, the algorithms have some prerequisites:
This represents a degree of coupling that defies a higher order of abstraction between "mesh" and pressure field.
It is distinctly possible to decouple them, in principle. However, that would require novel implementations of what it means to find the equilibrium between two arbitrary pressure fields contained within two overlapping tetrahedral volumes. It will no longer be strictly planar, and the search for it becomes far more expensive.
It's certainly possible to have an abstract pressure field functor. And then, given some arbitrary mesh, the pressure field could be sampled at each vertex by evaluating the pressure field. The end result would still be a piecewise-linear approximation of the function within the domain of a tetrahedral mesh. And that is ultimately the input to the hydroelastic algorithms. So, if this approach were taken, it would most likely happen offline (outside of the Drake library) and be supported by Drake simply loading the resultant explicit hydroelastic mesh definition.
@DamrongGuoy Would you consider this is largely closed due to the PR train ending in #17837?
One of the concepts seems clearly resolved (externally generated tet mesh used as a compliant mesh). The other concept (some alternative modeling of the pressure field), isn't part of that. However, this issue doesn't do a good job of defining the requested feature.
It seems to me that we can close this. If rethinking the pressure field becomes relevant in the future, we can either re-open this issue or open a new issue with just that topic.
I agree that we can close this issue now.
I add that now we have an example to use an externally created tetrahedral mesh at:
https://github.com/RobotLocomotion/drake/tree/master/examples/hydroelastic/python_nonconvex_mesh
The yellow bell pepper uses a tetrahedral mesh imported from VTK file generated externally by TetGen as shown here:
<collision name="collision">
<pose>0 0 0 0 0 0</pose>
<geometry>
<mesh>
<uri>yellow_bell_pepper_no_stem_low.vtk</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<drake:proximity_properties>
<drake:compliant_hydroelastic/>
<drake:hydroelastic_modulus>5.0e4</drake:hydroelastic_modulus>