How to remove joints from a body

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Yueh-Lin Lee
Posts: 8
Joined: Thu Jun 27, 2013 12:09 am

How to remove joints from a body

Post by Yueh-Lin Lee » Tue Oct 22, 2013 8:49 pm

Hello, everyone

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(&ltoeJoint2);
if(isLtoeRemoved)
  cout << "I have romoved it, " << ltoeJoint2.getName() << endl;
Million thanks,
Leo

User avatar
Maria Isabel Orselli
Posts: 39
Joined: Wed Mar 17, 2010 5:30 pm

Re: How to remove joints from a body

Post by Maria Isabel Orselli » Wed Oct 23, 2013 9:19 am

Hi Leo,

I don't know if I understand right your problem, but you can "remove " the joint making it a "WeldJoint":

http://simtk-confluence.stanford.edu:80 ... JointTypes

There is this model leg6dof9musc.osim that comes with the newest version of open sim (you can find it here also http://simtk-confluence.stanford.edu:80 ... tal+Models) where the joints between toes and calc. and calc. and talus were "removed". You still have different bodies but they don't move one in relation to the other.

Hope it helps,
Bel

POST REPLY