I am trying to run MocoInverse for an Upper limb arm model. I have the joint kinematics, and external forces file in sto format. I also defined an xml file for estimating inverse dynamics using mocoInverse. I defined the model as follow
Code: Select all
try {
MocoInverse inverse;
inverse.setName("matLab_motion");
ModelProcessor modelProcessor(model);
modelProcessor.append(ModOpAddExternalLoads(extFrc_path));
modelProcessor.append(ModOpAddReserves());
modelProcessor.append(ModOpIgnoreTendonCompliance());
inverse.setModel(modelProcessor);
inverse.setKinematics(TableProcessor(ik_path));
inverse.set_mesh_interval(0.002);
inverse.set_initial_time(0);
inverse.set_final_time(1.2);
MocoInverseSolution solution = inverse.solve();
solution.getMocoSolution().write("MocoInverse_solution.sto");
}
catch (const std::exception& ex) {
std::cout << "Exception: " << ex.what() << std::endl;
return 1;
}
catch (...) {
std::cout << "UNRECOGNIZED EXCEPTION" << std::endl;
return 1;
}
Thanks for the support.