How to get contact parameters of huntcrossley force

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Samane Amini
Posts: 101
Joined: Sun Jan 12, 2020 3:48 am

How to get contact parameters of huntcrossley force

Post by Samane Amini » Tue Oct 13, 2020 11:58 pm

Hi guys
I was wondering if how contact parameters of huntcrossley force get in MATLAB. I used this code, but it's wrong:

HuntCrossleyForce.getStiffness('Foot_r_R')

Foot_r_R: refers to rear contact of right leg

I am looking forward your replay...

Tags:

User avatar
Nicos Haralabidis
Posts: 196
Joined: Tue Aug 16, 2016 1:46 am

Re: How to get contact parameters of huntcrossley force

Post by Nicos Haralabidis » Wed Oct 14, 2020 2:31 am

Hello Samaneh,

In the OpenSim 3.3 Matlab API I did something like this in the past (perhaps it is now easier in 4.x):

osimModel = Model('gait10dof18musc.osim');
forceSet = osimModel.getForceSet();
r1hc = HuntCrossleyForce.safeDownCast(forceSet.get('Foot_Ground_R1'));
stiffness = r1hc.getStiffness();

Have you also tried querying the available methods and input arguments for HuntCrossleyForce in Matlab, something like:

methodsview('HuntCrossleyForce')

This should bring up a table with the available methods and help with your problem!

Hope that helps!

Nicos

User avatar
Samane Amini
Posts: 101
Joined: Sun Jan 12, 2020 3:48 am

Re: How to get contact parameters of huntcrossley force

Post by Samane Amini » Wed Oct 14, 2020 4:32 am

Dear Nicos Haralabidis

it's done successfully. Thanks for guiding me.
From your opinion, if I want to set the desired stiffness, what would I do?

User avatar
Samane Amini
Posts: 101
Joined: Sun Jan 12, 2020 3:48 am

Re: How to get contact parameters of huntcrossley force

Post by Samane Amini » Wed Oct 14, 2020 5:56 am

Hi Nicos

thanks again. I could set the desired stiffness with your code:

Foot_r_R = HGait.getForceSet().get('foot_r_R');
r1hc = HuntCrossleyForce.safeDownCast(Foot_r_R);
stiffness = r1hc.getStiffness()
r1hc.setStiffness(2)

thanks so much :D

POST REPLY