Joint lock constraint is ignored when calculating ResidualForce?

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Joint lock constraint is ignored when calculating ResidualForce?

Post by Jiang Ping » Tue May 28, 2019 10:17 am

Hi all

I am trying to conduct the static inverse dynamics to calculate the coordinate forces given the vector Q.
I found that the residual force of the locked coordinate is not zero.
Does this value mean the force that is needed to apply for satisfy the lock constraint?

I also can't totally understand the difference between model.getMatterSubsystem().calcResidualForce
and model.getMatterSubsystem().calcResidualForceIgnoringConstraints.
When using the former one, coordinate lock constraint is considered?

Thank you in advance

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Joint lock constraint is ignored when calculating ResidualForce?

Post by Michael Sherman » Wed May 29, 2019 6:19 pm

Hi, Jiang. I can answer part of your question:

The difference between calcResidualForce() and calcResidualForceIgnoringConstraints() is just whether the method allows you to specify the constraint multipliers lambda. Neither method generates internal constraint forces and both methods ignore prescribed motion.

A separate question is how OpenSim models locked joints. They can be modeled either with constraints or with prescribed motion and I don't know which. Does someone else know the answer?

Regards,
Sherm

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Joint lock constraint is ignored when calculating ResidualForce?

Post by Dimitar Stanev » Thu May 30, 2019 4:15 am

The internal implementation of OpenSim used the SimTK::Constraint::PrescribedMotion constraint to enforce coordinate locking:

https://github.com/opensim-org/opensim- ... e.cpp#L184
https://simbody.github.io/simbody-3.6-d ... ml#details

User avatar
Michael Sherman
Posts: 812
Joined: Fri Apr 01, 2005 6:05 pm

Re: Joint lock constraint is ignored when calculating ResidualForce?

Post by Michael Sherman » Thu May 30, 2019 8:13 am

Great, thanks Dimitar!

So calculating residual forces using Simbody's calcResidualForce() method does not include forces needed to lock joints unless you supply them yourself through the lambda parameter to that method.

User avatar
Jiang Ping
Posts: 132
Joined: Sun Aug 26, 2012 4:09 am

Re: Joint lock constraint is ignored when calculating ResidualForce?

Post by Jiang Ping » Thu May 30, 2019 9:53 am

Hi, Sherman and Dimitar

Thank you very much for your reply.
Now I understand that I may need an additional actuator to lock the joints.
I think it would be better to clarify this point in the OpenSim user guidance, which will help people who are dealing with inverse dynamics problem (e.g., calculating the joint torque).

User avatar
Ajay Seth
Posts: 136
Joined: Thu Mar 15, 2007 10:39 am

Re: Joint lock constraint is ignored when calculating ResidualForce?

Post by Ajay Seth » Thu May 30, 2019 1:24 pm

You do not need additional actuators to lock a joint. You either a.) care about the coordinate force necessary to enforce the lock (that is what ID provides now) or b.) you don't, in which case can simply ignore what ID computes. Adding an actuator to enforce the lock (to result in zero residual) would only mean they would have apply the coordinate force currently being computed for you (i.e. the residual). How would you compute that coordinate force? ID? Apologies if I am missing the purpose here.

POST REPLY