'PyDrake - DirectCollocation - input_port(5) (applied spatial force) is KAbstractValued. How can I turn it to kVectorValued?

I'm attempted to run DirectCollocation on a free body but am running into a Vector Type issue. My plant consists of just the ground and the body (from a urdf) and I want to use the DirectCollocation(plant, context....) object in order to find it's ideal initial state for it to land in some orientation based on a set of constraints. This is the error that I'm getting.

Picture of Error Message for kVectorValued

This is the diagram that I'm working with.

First half of diagram Second half of diagram

Any help would be extremely appreciated. Thank you so much.



Solution 1:[1]

If you are using DirectCollocation (or many other planning and control methods in Drake) with MultibodyPlant, you will likely need to pass plant.get_actuation_input_port().get_index() into input_port_selection.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Russ Tedrake