RobotLocomotion / drake

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

pydrake missing MultibodyPlant.GetForceElement method #14874

Closed mfogelson closed 3 years ago

mfogelson commented 3 years ago

I am working to convert the strandbeest example using pydrake.

I am currently unsure how to add the position constraints for each bushing element (line 198 run_with_motor.cc) because there is not a method GetForceElement in the pydrake bindings.

Was this method intentionally left out of the python bindings?

jwnimmer-tri commented 3 years ago

In the C++ demo, the call to GetForceElement is on the class MultibodyPlant, not MultibodyTree:

https://github.com/RobotLocomotion/drake/blob/v0.28.0/examples/multibody/strandbeest/run_with_motor.cc#L115-L116

https://github.com/RobotLocomotion/drake/blob/v0.28.0/examples/multibody/strandbeest/run_with_motor.cc#L203-L204

However, the pydrake bindings for the MultibodyPlant class do not offer the GetForceElement either.

I've re-titled the issue accordingly, and will re-assign to @sherm1 for delegation.