Given a multibody plant, I need to find the the matrix that transforms the external forces lambda into generalized forces. I.e. Phi in the following equation (taken from An Efficiently Solvable Quadratic Program for Stabilizing Dynamic Locomotion by Scott Kuindersma, Frank Permenter, and Russ Tedrake).
My guess is that I need to first add the corresponding forces to the relevant bodies in the multibody plant with
left_foot_contact_force = plant.AddForceElement(plant.GetModelInstanceByName("l_foot"))
right_foot_contact_force = plant.AddForceElement(plant.GetModelInstanceByName("r_foot"))
However, I'm not quite sure how to proceed to get the matrix Phi. I suspected that I would need to use CalcForceElementsContribution()
but don't know how to make use of the resultant MultibodyForce
to get the matrix Phi.