I am interested in using the Direct Collocation Method to generate a walking trajectory for a 2D 7-link biped robot (torso, left and right upper leg, lower leg and foot).
Specifically,
I have parameters of each link and equations of motion.
However, I couldn't understand how to write "system" (and "context") by reading the API.
Is there a good way to describe "system" from this information or a similar example anywhere?
I'm going to use pydrake.
I have a number of relevant examples in my course notes. I would recommend the compass gait limit cycle exercise from the chapter on planning through contact (which uses a URDF to specify the dynamics), or the SLIP model example in the notebook associated with the "Simple models of legged robots" chapter for an example of writing the equations of motion out manually.
Please understand that DirectCollocation, by itself, is not ideal for planning through collisions. Those chapters describe the "hybrid trajectory optimization" approach that is likely what you will want.