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...
How to get contact parameters of huntcrossley force
- Samane Amini
- Posts: 101
- Joined: Sun Jan 12, 2020 3:48 am
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: How to get contact parameters of huntcrossley force
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
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
- Samane Amini
- Posts: 101
- Joined: Sun Jan 12, 2020 3:48 am
Re: How to get contact parameters of huntcrossley force
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?
it's done successfully. Thanks for guiding me.
From your opinion, if I want to set the desired stiffness, what would I do?
- Samane Amini
- Posts: 101
- Joined: Sun Jan 12, 2020 3:48 am
Re: How to get contact parameters of huntcrossley force
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
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