Applying own data in MocoTrack

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
Iris Magnusdottir
Posts: 19
Joined: Thu Nov 01, 2018 2:04 am

Applying own data in MocoTrack

Post by Iris Magnusdottir » Fri Jan 31, 2020 2:38 am

Hi Moco society!

As I am very new to Moco, I was hoping you could help me getting started with my first simulation.
My task is to simulate unassisted gait, and then adding passive and/or active components to mimic the behavior of an ankle exoskeleton. I figured MocoTrack would be an appropriate tool for this task as I want to use my own marker and force plate data.

I have gone through some of the examples provided in the Moco package, where I believe exampleMocoTrack.m would be a great place to start. Running the example as is works fine but when I try to associate my own data I get the following error:

Error using exampleMocoTrack>torqueDrivenMarkerTracking (line 72)
Java exception occurred:
java.lang.RuntimeException: Error reading column Labels in file 'AlGait12.trc'. Unexpected column label.
Expected = Time. Received = Times.
Thrown at TRCFileAdapter.cpp:137 in extendRead().
at org.opensim.modeling.opensimMocoJNI.MocoTrack_setMarkersReferenceFromTRC__SWIG_1(Native Method)
at org.opensim.modeling.MocoTrack.setMarkersReferenceFromTRC(MocoTrack.java:545)


I believe the problem lies with the setMarkersReferenceFromTRC() function. Where can I see how that function works?
I have no column called Labels in the file. My markers have different names then the ones in the example file, but there is consistency between the .trc and .xml file.

Any help would be very appreciated.

Thank you,
Iris Drofn

User avatar
Aaron Fox
Posts: 275
Joined: Sun Aug 06, 2017 10:54 pm

Re: Applying own data in MocoTrack

Post by Aaron Fox » Fri Jan 31, 2020 4:14 am

Hi Iris,

It looks like your time column in the TRC file is labelled 'Times' instead of 'Time' (see error Expected = Time. Received = Times). I think the file adapters are flexible with different marker labels, but pretty particular about the time column being appropriately labelled. Perhaps check your process for creating the TRC file, as that is probably where the labelling of the columns has occurred.

Hope that helps,

Aaron

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

Re: Applying own data in MocoTrack

Post by Christopher Dembia » Fri Jan 31, 2020 8:07 am

Hi, Iris, and thanks, Aaron!

User avatar
Iris Magnusdottir
Posts: 19
Joined: Thu Nov 01, 2018 2:04 am

Re: Applying own data in MocoTrack

Post by Iris Magnusdottir » Wed Feb 05, 2020 5:14 am

Thank you for the quick response.

Changing the column label worked, however I think I might have a coordinate system problem as my animation is not behaving properly. While figuring that out I have one other question.

I want to estimate the metabolic cost when using an ankle exoskeleton of both active and passive components. I have seen in the documentation that Moco currently lacks the ability to handle metabolic energy consumption. Is there some way around this?

Thanks!
Iris Drofn

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

Re: Applying own data in MocoTrack

Post by Christopher Dembia » Wed Feb 05, 2020 9:09 am

You should be able to estimate metabolic cost using OpenSim's Probes, after you get a solution to a Moco study. You would do this using OpenSim's Analyze tool.

Antoine Falisse is working on a metabolics goal, but it is not ready yet.

If you want to delve into C++, you could work on a metabolics goal as well.

User avatar
Iris Magnusdottir
Posts: 19
Joined: Thu Nov 01, 2018 2:04 am

Re: Applying own data in MocoTrack

Post by Iris Magnusdottir » Thu Feb 13, 2020 6:18 am

Thank you for a super helpful forum.

I have managed to run the torque driven marker tracking without problems.
However, I'm more interested in the muscle driven one. There, a .sto file is imported in the track.setStatesReference(TableProcessor("filename.sto")) command. Where does the .sto file come from? Vicon does not export .sto file directly. Can I write it from .c3d file?

User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Re: Applying own data in MocoTrack

Post by Karthick Ganesan » Fri Feb 14, 2020 7:07 am

Dear Chris Dembia,
Is it possible to use metabolics probe with DeGroteFragley2016 Muscle?
Thanks,
Karthick

POST REPLY