opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
801 stars 324 forks source link

Improve `exampleMocoTrack.py` using `setWeightForControlPattern` #3841

Open mrrezaie opened 4 months ago

mrrezaie commented 4 months ago

Hi, I think these parts of the exampleMocoTrack.py code which increase the weight of ground-pelvis coordinate actuators can be improved https://github.com/opensim-org/opensim-core/blob/accddd7f7351f3fa7da8a482c11e97545d19a81e/Bindings/Python/examples/Moco/example3DWalking/exampleMocoTrack.py#L158-L164 https://github.com/opensim-org/opensim-core/blob/accddd7f7351f3fa7da8a482c11e97545d19a81e/Bindings/Python/examples/Moco/example3DWalking/exampleMocoTrack.py#L222-L229

by using MocoControlGoal::setWeightForControlPattern():

effort.setWeightForControlPattern('.*pelvis', 10)

Thank you.