Hi all,
I am trying to create a simulated accelerometer signal using the advice provided in the following post: https://simtk.org/plugins/phpBB/viewtop ... rt=0&view=
I noticed however that getAngularVelocity & getAngularVelocityBodyLocal returned the same outputs even when I was anticipating differences, has anybody noticed this before? I believe the angular velocity they are both returning is wrt the ground.
Below is a snippet of my code in the 3.3 Matlab API:
osimModel = Model([pathModel,'model_3DOF.osim']);
osimState = osimModel.initSystem();
states = [0.2 0 -0.2 5 4 2];
for i = 0:nStates-1
osimModel.setStateVariable(osimState,stateNames.get(i),states(i+1));
end
osimModel.computeStateVariableDerivatives(osimState);
modelControls = osimModel.updControls(osimState);
actuatorControls = Vector(1,0.0);
cont = [1; 0; 0];
for i = 0:nActuators-1
actuatorControls.set(0,cont(i+1));
osimModel.updActuators().get(i).addInControls(actuatorControls,modelControls);
end
% Set the control (excitation) values
osimModel.setControls(osimState,modelControls);
osimModel.computeStateVariableDerivatives(osimState);
simbodyEngine = osimModel.getSimbodyEngine();
hand = osimModel.getBodySet().get('hand_r');
hand_w_velG = Vec3(0);
simbodyEngine.getAngularVelocity(osimState,hand,hand_w_velG);
hand_w_velL = Vec3(0);
simbodyEngine.getAngularVelocityBodyLocal(osimState,hand,hand_w_velL);
Kind regards,
Nicos Haralabidis
getAngularVelocity & getAngularVelocityBodyLocal; return identical values
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: getAngularVelocity & getAngularVelocityBodyLocal; return identical values
The two functions have the same implementation. Maybe for backward compatibility reasons.
https://github.com/opensim-org/opensim- ... e.cpp#L318
https://github.com/opensim-org/opensim- ... e.cpp#L318
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: getAngularVelocity & getAngularVelocityBodyLocal; return identical values
Hi Dimitar,
Thanks for confirming this! I was looking for this type of documentation but I didn't manage to stumble upon!
Kind regards,
Nicos Haralabidis
Thanks for confirming this! I was looking for this type of documentation but I didn't manage to stumble upon!
Kind regards,
Nicos Haralabidis