Moco GRF_Solution Points are Zero...

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
Burak Kula
Posts: 31
Joined: Wed Dec 04, 2019 3:34 pm

Moco GRF_Solution Points are Zero...

Post by Burak Kula » Sun Jan 10, 2021 6:01 am

Hi Everyone,
For a while I am studying with Moco and I was using Moco ContactTrackingGoal to track GRF force of the simulation, but I realized that in GRF_solution.sto file point values "px, py and pz" are zero. My MATLAB codes are as given below.

Code: Select all

% GRF tracking
contactTracking = MocoContactTrackingGoal('contact',1.0);
contactTracking.setExternalLoadsFile('referenceGRF.xml');

forceNamesRightFoot = StdVectorString();
forceNamesRightFoot.add('/contactHeel_r');
forceNamesRightFoot.add('/contactFront_r');
trackRightGRF = MocoContactTrackingGoalGroup(forceNamesRightFoot,'Right_GRF');
contactTracking.addContactGroup(trackRightGRF);

forceNamesLeftFoot = StdVectorString();
forceNamesLeftFoot.add('/contactHeel_l');
forceNamesLeftFoot.add('/contactFront_l');
trackLeftGRF = MocoContactTrackingGoalGroup(forceNamesLeftFoot,'Left_GRF');
contactTracking.addContactGroup(trackLeftGRF);

problem.addGoal(contactTracking);

% Write solution's GRF to a file
contact_r = StdVectorString();
contact_l = StdVectorString();
contact_r.add('/contactHeel_r');
contact_r.add('/contactFront_r');
contact_l.add('/contactHeel_l');
contact_l.add('/contactFront_l');
externalForcesTableFlat = opensimMoco.createExternalLoadsTableForGait(model,UnsealedgaitTrackingSolution,contact_r,contact_l);
opensimMoco.writeTableToFile(externalForcesTableFlat,'Solution_GRF_Tracking.sto');
Am I missing something?
Are there any additional codes to track point values?

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Moco GRF_Solution Points are Zero...

Post by Nicholas Bianco » Mon Jan 11, 2021 11:50 am

Hi Burak,

The GRFs computed from createExternalLoadsTableForGait() are expressed as three forces and torques about the ground origin, so px, py, and pz are zero.

-Nick

User avatar
Burak Kula
Posts: 31
Joined: Wed Dec 04, 2019 3:34 pm

Re: Moco GRF_Solution Points are Zero...

Post by Burak Kula » Wed Jan 13, 2021 6:26 am

Hi Nicholas,
Thank you for your reply.

I want to ask that are there any method to find these px, py and pz values ? For examle an extra code or extra goal perhaps.

Best Regards,
Burak KULA.

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Moco GRF_Solution Points are Zero...

Post by Nicholas Bianco » Wed Jan 13, 2021 12:48 pm

If you're looking to specifically compute center-of-pressure, this may be a helpful resource: http://www.kwon3d.com/theory/grf/cop.html

User avatar
Burak Kula
Posts: 31
Joined: Wed Dec 04, 2019 3:34 pm

Re: Moco GRF_Solution Points are Zero...

Post by Burak Kula » Thu Jan 14, 2021 1:58 am

Hello Nicholas,

Again, thank you very much for your reply and recommendation about calculation of CoP but more specifically I am looking for a code to implement this CoP calculation into Moco.

All the best,
Burak

POST REPLY