I have a question about how to remove joints from the body.
For example, I want to modify "BothLegs" model. And I tried to remove the body "lcalcn".
I also need to remove the joint between "lcalcn" and "ltoes" first.
If I don't do that, there will be some error "Invalid parent body (lcalcn) specified in joint ltoe".
But I did it. The CustomJoint "ltoe" still is in the body "ltoes" in osim file.
My code as below:
Code: Select all
OpenSim::JointSet& jointSet = osimModel.updJointSet();
const OpenSim::Body& ltoes = osimModel.getBodySet().get("ltoes");
const OpenSim::Joint& ltoeJoint2 = ltoes.getJoint();
isLtoeRemoved = jointSet.remove(<oeJoint2);
if(isLtoeRemoved)
cout << "I have romoved it, " << ltoeJoint2.getName() << endl;
Leo