0

I am very happy to learn Direct Collocation method from Underactuated Robotic course from MIT. One question about how to implement this method for a plant built from urdf/sdf. I explain my question using the examples of pendulum/dircol_swingup.py and acrobat/dircol_swingup.py. They import XXX_plant.o and xxxx_geometry.o from pydrake. I can find them under drake/example (c++ version). In this version, they don't need urdf /sdf to build dynamic, plant and geometry.

It turn out a little difficult to follow this pattern to build a urdf/sdf base plant for a beginner. My question is: is it compatible to implement Direct Collocation method with a urdf.sdf plant? If yes, could you provide a example?

Wc Chang
  • 97
  • 6

1 Answers1

1

There is an example here (and more coming soon... I'm working on that chapter of the notes this coming week).

Russ Tedrake
  • 4,703
  • 1
  • 7
  • 10
  • Thank you very much! I feel lucky it is simple beauty. – Wc Chang Mar 14 '20 at 01:46
  • It works for the double pendulum. But another 2D-hopper case, an error happens, like this: libc++abi.dylib: terminating with uncaught exception of type std::logic_error: InputPort::Eval(): required InputPort[0] (geometry_query) of System ::_ (MultibodyPlant) is not connected. – Wc Chang Mar 14 '20 at 13:21
  • MultibodyPlant's that have contact need to be wired to a SceneGraph (which handles all of the collision detection). Although that particular error is clear and easy to resolve, you will run into more problems -- the topic of applying trajectory optimization to systems with non-smooth (or stiff) models of contact is an active topic that we will also discuss in upcoming lectures in underactuated. – Russ Tedrake Mar 15 '20 at 14:52