Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbp: Support programmatic composition of "sub-plants"? #13074

Open
EricCousineau-TRI opened this issue Apr 16, 2020 · 10 comments
Open

mbp: Support programmatic composition of "sub-plants"? #13074

EricCousineau-TRI opened this issue Apr 16, 2020 · 10 comments
Assignees

Comments

@EricCousineau-TRI
Copy link
Contributor

EricCousineau-TRI commented Apr 16, 2020

Composition

It would be nice to be able to assemble different plants together, i.e. throw them both into the same world, and then throw in some welds.
This would most likely require #12703 (the topology solution proposed in the issue).

Use Cases

@sherm1
Copy link
Member

sherm1 commented Apr 16, 2020

@EricCousineau-TRI a few thoughts:

  • I'm imagining that you would need also to transfer part of the larger plant's state to the sub-plant's state. Is that part of the decomposition task?
  • These seem like two unrelated tasks. Reading in multiple models and welding them together before doing anything with them seems very easy. Extracting sub-pieces of a plant, determining that they form a coherent connected set, and possibly transferring state seems MUCH harder. If I've understood that correctly please consider filing separate issues so we can prioritize and scope separately.

@ggould-tri
Copy link
Contributor

This is a really nice idea -- it would go a long way toward cutting the knot on #12849 . However as @sherm1 notes it would also incur all of the complexity that motivates the 12849 case -- the correct shuffling and interpretation of state and the implementation of state readback into the parent -- and it would lay a serious landmine under any logic that uses fortran style "offset into flat vector" logic to address mbp states (ie, nearly all of it 😭 😡 ).

@EricCousineau-TRI
Copy link
Contributor Author

Sorry for the lag! I will try to break this apart as requested by EOD today.

@EricCousineau-TRI
Copy link
Contributor Author

EricCousineau-TRI commented Apr 29, 2020

Will update this issue to handle the harder task (decomposition). Will make a new issue for the easier task (composition).
Will edit this post once I'm done.

EDIT: Done #13177

@EricCousineau-TRI EricCousineau-TRI changed the title mbp: Support programmatic composition and decomposition among "sub-plants"? mbp: Support programmatic composition of "sub-plants"? Apr 29, 2020
@EricCousineau-TRI
Copy link
Contributor Author

@sherm1 sherm1 added component: multibody plant MultibodyPlant and supporting code priority: low and removed priority: high labels May 11, 2020
@sherm1
Copy link
Member

sherm1 commented May 11, 2020

Lowering priority for now since this was a lesser issue for users per the Mutating Multibody Models meeting.

@EricCousineau-TRI
Copy link
Contributor Author

Per convo, also should be achievable by current public API, without having to a method on MultibodyPlant:
Drake Dev Meeting Agenda, 2020/05/11

@EricCousineau-TRI
Copy link
Contributor Author

I am working on a prototype of this in Python, as part of #13133

Similar to what Robert ran into, I'm seeing parsing taking up at least 50% of my team for clutter gen. I want to see if I can cut that down by some sort of subgraph decomposition and assembly and stuff.

@EricCousineau-TRI
Copy link
Contributor Author

I think I have a prototype in Anzu that covers the workflows I want. See here for a copy-pasta version:
MultibodyPlantSubgraph (permalink)

This can handle composition via sub-plants.
Currently, the Anzu PR is in place, and will let it bake for a few weeks there per Jeremy's suggestion.

@EricCousineau-TRI
Copy link
Contributor Author

EricCousineau-TRI commented Jan 6, 2021

See user pain point that could be partially addressed by the "subgraph" approach: https://stackoverflow.com/questions/65583969/visualizing-an-autodiff-multibodyplant-in-pydrake#comment115962920_65584221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants