How to programmatically modify MultibodyPlant geometric parameters in pydrake?

Viewed 43

I'm currently loading in a URDF file of a robot, but want to be able to make modifications to geometric parameters of the MultibodyPlant object, such as changing the link lengths. What is the correct way to go about this in pydrake? I see methods like AddJoint that seem to indicate the ability to modify the robot but am unsure how to modify existing bodies within the MultibodyPlant.

1 Answers

MultibodyPlant parameters (with just a few remaining exceptions) are contained as parameters in the Context. You can change them directly in the context, and therefore change the dynamics.

For a notebook that exercises this workflow, you might take a look at the Multibody parameters in Drake exercise I have here: http://underactuated.csail.mit.edu/sysid.html#example3

Related