hello, I want to set Markers weight in inverse kinematics by C++ API. However, after I made the following settings, nothing changed.
Code: Select all
int main() {
Model test("arm26.osim");
InverseKinematicsTool* IK =
new InverseKinematicsTool();
IK->setModel(test);
IK->setMarkerDataFileName("arm26_elbow_flex.trc");
OpenSim::Set<MarkerWeight>* marker_weight =
new OpenSim::Set<MarkerWeight>();
marker_weight->insert(0, new MarkerWeight("r_acromion", 10));
marker_weight->insert(1, new MarkerWeight("r_humerus_epicondyle", 1));
marker_weight->insert(2, new MarkerWeight("r_radius_styloid", 1));
IKTaskSet IKT = IK->getIKTaskSet();
IKT.createMarkerWeightSet(*marker_weight);
IK->setStartTime(0.0);
IK->setEndTime(1.0);
IK->run();
}