Open edrumwri opened 5 years ago
IMO the best way to go with this is working on a specific example (with pseudocode allowed). @rcory, @edrumwri recently mentioned to me that you might have such an example?
@rcory do you think this is still an issue? Or should we close it?
I think this is still a valid issue. For an example, see this method in planar_gripper_simulation
which defines a local system which demultiplexes the inverse dynamics outputs to MBP actuator inputs. This seems like a common enough use case that perhaps MBP should support this natively?
I believe the problem you have @rcory could be solved with some improvements to the InverseDynamicsController
. What I propose is:
Then in your example you would not need the extra GeneralizedForceToActuationOrdering
since the ID controller's output would wire directly to the plant of the whole world.
Thoughts?
Per comment here: https://github.com/RobotLocomotion/drake/issues/13074#issuecomment-630926022
I believe my prototype can help workaround some of these pain points - e.g. rather than trying to craft a whole bunch of model instances / coordinates for accessing portions of a plant, just reconstruct the plant (cheaply).
The last time I wrote here was "thoughts?". Wondering if the solution I described above would not only suffice but be appropriate and, its probably simpler? That is, if I build an InverseDynamicsController with a full model of the world when I just want to control an arm in it, how can I expect to get the right output/inputs? that is why my suggestion.
In my mind, I think the solution you described above is more complex; why write yet another overload in MBP / the controller to do the same computation, but only on a subset, add complexity to your testing code, deprecations, etc., when all you really need to do is just copy over a subset?
how can I expect to get the right output/inputs?
Is it just ordering? There can be ways to guarantee that through MBP's construction, or just adding a basic remapping on the port or whatever.
Is it just ordering? There can be ways to guarantee that through MBP's construction, or just adding a basic remapping on the port or whatever.
That's exactly right. IMO is not that simple (yes, I can hack the code myself), but clearly not simple for most users who have expressed this being the biggest pain point. Designing a general solution to extract a sub-plant and the remap, for a final product in Drake, will require some thought (totally worth it!).
But again, I just think we are asking too much from the InverseDynamicsController
API, which was originally written to deal with a small robot model.
But again, I just think we are asking too much from the InverseDynamicsController API, which was originally written to deal with a small robot model.
Can you expand on "asking too much"?
If you mean, "adding overload(s) for dealing with only a subset of the plant", then I am 100% on board with that statement!
(This issue has arisen from discussions resulting from PR #12011).
We can imagine an easier way to interface controllers to MultibodyPlant, generally, than at present. The difficulty with the present approach only arises when only some bodies in a MBP are controlled.
Two anecdotal problems:
Solving the problems above might require more than one approach (e.g., using typed input ports for (2) and some intermediate Systems for (1)).
We'll continue to gather information (problems and potential solutions) in this issue.
@rcory @SeanCurtis-TRI @amcastro-tri