alvin
alvin

Reputation: 117

Define New Shapes For Proximity Engine

I'd like to define two new classes of Shape:

  1. Mesh class that allows vertices/faces to be passed in directly (current Mesh class only takes in a filepath), and
  2. Cone class that supports proximity queries (MeshcatCone is the only existing one, I don't see why cones should be complicated since they are convex.)

In my setup, I have downloaded prebuilt binaries of drake, meaning I cannot directly modify the ProximityEngine class. I saw this post on defining a new child of ShapeReifier, but I can't replace ProximityEngine since it is used everywhere. Any ideas on how I could do this?

Upvotes: 3

Views: 56

Answers (1)

Sean Curtis
Sean Curtis

Reputation: 1923

Sadly, there is no affordance for dynamically increasing the set of Shapes that SceneGraph knows about.

Both of your requests are very sane and have been on the Drake team's radar. So, that suggests the best way to do this is to write some code to submit to Drake. Since we already intend to do both of those things, that should very much grease the path. They just haven't been a strong priority yet.

For the first case, the Mesh type, see the open issue #15263.

There is no existing issue for the Cone (although converting the MeshcatCone to full Shape is a known goal.

I'd recommend the following:

  • While the mesh-from-data would be helpful, it's not strictly necessary. At the time you'd instantiate the mesh with data, you could write that same data to disk and pass in the file name. Passing the data would save you a trip to the disk, but the end result would be the same (with much less work and cooperation from Drake).
  • You should open an issue about the Cone shape. You'll find the Drake developers happy to help you write and submit a PR. This one would provide very unique value. As you said, right now, you can't use Cone for anything but meshcat visualization. More utility would be a benefit. The details about how one would go about that can be discussed in the issue.

Upvotes: 3

Related Questions