opensim-org / opensim-moco

Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.
https://opensim.stanford.edu/moco
Apache License 2.0
58 stars 16 forks source link

Add example/documentation for using IK solution with MocoStateTrackingGoal #607

Open chrisdembia opened 4 years ago

chrisdembia commented 4 years ago

Main issues are changing column labels and converting to radians.

chrisdembia commented 4 years ago

This was a repeated issue during the March 2020 workshop.

carmichaelong commented 4 years ago

Having some feedback/output on what's being done behind the scenes could also help.

For instance, the radians issue was found because of the tracke_states.sto file. While the input had inDegrees=yes, the output file had inDegrees=no even though all the values were the same.

chrisdembia commented 4 years ago

I'm not sure what is meant by the output file. Was that the MocoSolution STO file?

carmichaelong commented 4 years ago

Oops, output file = tracked_states.sto file. That's a typo.

chrisdembia commented 4 years ago

Oh! That's generated by MocoTrack during preprocessing. I forgot. That's a useful clue. This is a high-priority issue.

I do not understand where the issue is, given that here is where process() is invoked:

https://github.com/opensim-org/opensim-moco/blob/c8335c878548b137f9eeb159bdc3c647d1a96060/Moco/Moco/MocoTrack.cpp#L150-L151

and this is where the angle conversion happens in process():

https://github.com/opensim-org/opensim-moco/blob/c8335c878548b137f9eeb159bdc3c647d1a96060/Moco/Moco/Common/TableProcessor.h#L103-L106

chrisdembia commented 4 years ago

@psbiomech have you used IK solutions as the state tracking reference in Moco?

nickbianco commented 4 years ago

@carmichaelong it might be helpful to have a set of files that reproduce the problem. It probably warrants it's own GitHub issue; if you have some time to reproduce and create the issue that would be helpful.

carmichaelong commented 4 years ago

Definitely. Will plan on trying to get a minimal example for C++ this week.