external loads and inverse dynamics in API
Posted: Fri Oct 30, 2015 8:17 am
Hello,
I am using the opensim api to run cmc-like forward simulations. As such I am using the InverseDynamicsSolver() call from the opensim api calls through matlab. I also am applying GRF using the ExternalLoads() command. However, the application or not of external loads does not affect the generalized forces that the inverse dynamics solver finds. However, integrating forward it appears that the GRF are integrated into the model properly. Any ideas as to why the inverse dynamics solver doesn't seem to be taking these external forces into account? My code is generally as follows:
osimModelFile = 'fullPathFileName';
osimModel = Model(osimModelFile);
ext_loads = ExternalLoads(osimModel,XMLofGRFSetup); %this XML includes IK reference as well as kinetics file with both GRF
osimState = initSystem(osimModel);
%% at this point the state is updated using
osimState.updY().set(i,value)
%%id solver is set up
idSolver = InverseDynamicsSolver(osimModel);
jointTorques = Vector();
jointTorques = idSovler.solve(osimState,desiredAccelerations);
Can anyone see where I might be going wrong? Thanks for any help.
I am using the opensim api to run cmc-like forward simulations. As such I am using the InverseDynamicsSolver() call from the opensim api calls through matlab. I also am applying GRF using the ExternalLoads() command. However, the application or not of external loads does not affect the generalized forces that the inverse dynamics solver finds. However, integrating forward it appears that the GRF are integrated into the model properly. Any ideas as to why the inverse dynamics solver doesn't seem to be taking these external forces into account? My code is generally as follows:
osimModelFile = 'fullPathFileName';
osimModel = Model(osimModelFile);
ext_loads = ExternalLoads(osimModel,XMLofGRFSetup); %this XML includes IK reference as well as kinetics file with both GRF
osimState = initSystem(osimModel);
%% at this point the state is updated using
osimState.updY().set(i,value)
%%id solver is set up
idSolver = InverseDynamicsSolver(osimModel);
jointTorques = Vector();
jointTorques = idSovler.solve(osimState,desiredAccelerations);
Can anyone see where I might be going wrong? Thanks for any help.