There are a number of use cases where we want to introspect the state vector coming out of the MultibodyPlant get_state_output_port. As a simple example, imagine I am logging the state output port and just want to label my axes (or know which axes to plot).
What is the recommended API for this?
For joints, I know that we can iterate through joints (e.g. via get_joints()) and then ask each joint for it’s position/velocities indices. Do we have something similar for free bodies?
I know we can get the actual positions/velocities of a free body in a number of ways, given a context, but didn’t actually see the way to get the indices?
It’s tempting to say “just log with get_state_output_port(model_instance)”, but this particular MultibodyPlant is buried inside a Diagram (like MultibodyPlant).