-1

I'd like to be able to add or remove geometries as they appear/disappear in my environment.

The docs clearly state that all geometries must be added before the call to MultibodyPlant::Finalize(). Does this mean every time I add a new geometry, I have to re-create an entirely new plant/diagram/scene_graph and re-load all existing objects?

alvin
  • 137
  • 7

1 Answers1

2

This strongly depends on the role.

Proximity: If you're using MultibodyPlant and are going to ask the plant to handle contact dynamics (e.g., MultibodyPlant needs to resolve contact), then the simplest answer is: you cannot change geometry after you finalize. Changes in geometry require new plants (as of today).

Illustration or Perception: If you're hoping to change the geometry for either of these roles, you can go into SceneGraph and manipulate those geometries to your hearts content before or after you finalize MultibodyPlant. If you're interested in this route, let me know in a comment and I'll elaborate on what this would look like in an edit.

Sean Curtis
  • 1,425
  • 7
  • 8
  • Ah I see. Unfortunately I'm mainly interested in Proximity. Would this be a feasible change to request in a Github Issue in the near future? It sounds like many changes would be needed, but I feel this is an important issue. A robot's environment will constantly change, and constantly re-loading all scene meshes will be expensive. Maybe this is too complicated to answer here, but why should a newly added object conflict with the rest of the plant and scene graph? Can't a new body simply be added to the multibodytree? Is this due to some caching/pre-computations? – alvin Oct 24 '22 at 23:00
  • 1
    This happens to be *massive* topic. There are a few efforts documented for making the `MultibodyPlant` more flexible for "remodelling" (see [#13291](https://github.com/RobotLocomotion/drake/issues/13291) and [#13298](https://github.com/RobotLocomotion/drake/issues/13289) as examples). Finding an issue and weighing in on it is always a good way to help upvote backlog work. – Sean Curtis Oct 26 '22 at 01:18