Inverse Dynamics with Python API

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Vincent Fohanno
Posts: 23
Joined: Thu May 10, 2018 10:03 am

Inverse Dynamics with Python API

Post by Vincent Fohanno » Wed Aug 02, 2023 7:27 am

Hi OpenSim community,

I am trying to use the Python API to perform the inverse kinematics and inverse dynamics analysis on a subject walking on force plates.

I did manage to do the IK step so then I would like to perform the ID after that.
But there are not a lot of examples or guidelines on how to perform the inverse dynamics step.
I saw that one can use InverseDynamicTool but it requires to use a lot of external files which is not ideal.
I would therefore prefer to use InverseDynamicSolver but there are no good examples.
I saw one test case you wrote but it is not very clear what are the steps to perform: https://github.com/opensim-org/opensim- ... dy.py#L241

Would you be able to guide me to perform the ID step?

Thanks

Tags:

User avatar
Carmichael Ong
Posts: 378
Joined: Fri Feb 24, 2012 11:50 am

Re: Inverse Dynamics with Python API

Post by Carmichael Ong » Fri Aug 25, 2023 5:09 pm

The doxygen page have some info that may be helpful: InverseDynamicsSolver doxygen page

There are a few other uses of the InverseDynamicsSolver in C++. While the syntax may look different than Python/Matlab, the calls should be very similar (since it calls the same code). A few places that might be helpful:

- The ID test case: https://github.com/opensim-org/opensim- ... D.cpp#L199
- How the InverseDynamicsTool uses the solver: https://github.com/opensim-org/opensim- ... l.cpp#L408

User avatar
Vincent Fohanno
Posts: 23
Joined: Thu May 10, 2018 10:03 am

Re: Inverse Dynamics with Python API

Post by Vincent Fohanno » Sat Aug 26, 2023 4:15 am

Thank you for the links.
I already saw them but will will have a look at them again.

POST REPLY