MocoInverse tool example

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Hamidreza Abbaspourazad
Posts: 6
Joined: Fri Nov 15, 2019 12:52 pm

MocoInverse tool example

Post by Hamidreza Abbaspourazad » Fri Dec 06, 2019 3:44 pm

Hi OpenSim Moco team,

Thank you for this interesting project and I am very excited to use this tool.

I was wondering if you could provide us with an example on how to use the MocoInverse tool to estimate control variables given a prescribed motion and an OpenSim model to run on command line and Matlab?

Thank you so much.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: MocoInverse tool example

Post by Christopher Dembia » Fri Dec 06, 2019 3:54 pm

Hey Hamidreza,

Unfortunately, the Moco distribution does not yet contain great examples for MocoInverse. We hope to add a MocoInverse example in the future. For now, refer to the following

1. The Python script we used for the bioRxiv preprint (MocoInverse for walking): https://github.com/stanfordnmbl/mocopap ... ng.py#L178

2. The sit-to-stand Matlab example in the Moco distribution, at Resources/Code/Matlab/exampleSitToStand/exampleSitToStand_answers.m (https://github.com/opensim-org/opensim- ... ers.m#L105)

3. The C++ test case for MocoInverse, which solves a walking problem: https://github.com/opensim-org/opensim- ... e.cpp#L124

Note that MocoTrack and MocoInverse have similar interfaces; you may be able to modify the MocoTrack example in the Moco distribution to use MocoInverse.

User avatar
Hamidreza Abbaspourazad
Posts: 6
Joined: Fri Nov 15, 2019 12:52 pm

Re: MocoInverse tool example

Post by Hamidreza Abbaspourazad » Fri Dec 06, 2019 4:02 pm

Hi Christopher,

Well done on this project and thank you for your response. I will look into these which are definitely helpful and will get back to you if I have further questions.

Thanks.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: MocoInverse tool example

Post by Christopher Dembia » Fri Dec 06, 2019 4:11 pm

Thank you. If you're successful, and you have the sudden urge to contribute back an example, we and other users would be delighted :)

POST REPLY