From my, limited, understanding of Drake's working we need to add all the actors in its world as plant / leaf in a system and pass that diagram & its context to the Simulator. So, how would you create items at runtime? Or is that not feasible at the moment? Context is robotic picking connected to external application so simulator never knows which items are going to be presented to the arm in a box.
Many Thanks.
It's true adding new models into the MultibodyPlant
after it's been finalized is not supported as of today (though we are very slowing working towards it; PR#20771 is progress in that direction).
The current recommendation is to:
simulator.AdvanceTo()
.I have also seen more sophisticated versions of this that actually rebuild the MultibodyPlant (and Diagram) one the simulator is stopped, then map over the Context from the first diagram into the Context of the second, then start the simulation again.