RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.27k stars 1.26k forks source link

plant: Should provide more convenient access to scoped names #15660

Open EricCousineau-TRI opened 3 years ago

EricCousineau-TRI commented 3 years ago

Aiming to focus on this after September.

From convo w/ @calderpg-tri, usage of drake::multibody::parsing::GetScopedFrameByName is non-discoverable, and could possibly live in MultibodyPlant itself in some form. Personally, I'm ambivalent, but it would make easier migration of use sites.

calderpg-tri commented 3 years ago

To expand on our conversation, if we intend scoped frame and body names to be first-class queries, they should be as discoverable as the current Mbp::Get{Body,Frame}ByName methods, rather than being shunted off somewhere else.

A related topic in this conversation is that scoped frames are perhaps most important in terms of interop with other tools, namely ROS, which use string frame names. For any complex model with non-unique body/frame names, scoped names are the only way to use string-only names. Right now, in Drake and Anzu we have a set of ad-hoc {Body, Frame}<->scoped name and scoped name<->ROS-compatible name methods, but in the future we'll want a consistent set of these methods available in Drake for the community to use.

jwnimmer-tri commented 2 years ago

I believe @rpoyner-tri has been poking at scoped names recently, in terms of collision filtering (#14785). For my part, I think the most important facet of anything related to scoped names is a clear and bulletproof specification for what they denote.

jwnimmer-tri commented 1 year ago

See #17482 for some progress.

We need to clarify what the victory condition is here. Is it that we the want GetBodyByName function to take a const ScopedName& name as overloaded input? (Maybe it's called GetBody(const ScopedName&) or etc?)

Or if not, what exactly are we looking for?

calderpg-tri commented 1 year ago

My view is that the ultimate victory condition is that any method that takes a name + model instance should have a version that takes a ScopedName, e.g. for MbP getters that would include GetBodyByName, GetRigidBodyByName, GetFrameByName, GetJointByName, GetMutableJointByName, and GetJointActuatorByName.