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');
Are there any additional codes to track point values?