You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description getCoordinateIndexForStateVectorOpenSimAPI() may produce incorrect indices to reference the coordinates of the OpenSim model (stored in model_info.ExtFunIO.coordi_OpenSimAPIstate) when the model contains a patellofemoral joint. Specifically, as the loop that sets the state variables of the OpenSim model to the corresponding coordinate index on lines 41-43 uses the number of coordinates from the external function (which ignores the patellofemoral joint), the state of all coordinates may not be assigned the correct index depending on the order of the coordinates returned by state_vars = model.getStateVariableValues(state);.
Incorrect indexing of the coordinates of the OpenSim model in turn may trigger the following error:
Array indices must be positive integers or logical values.
Error in update_model_info (line 40)
tmpst = [tmpst names_coords_i{end}];
^^^^^^^^^^^^^^^^^^^
Error in PreProcessing (line 61)
model_info = update_model_info(S,osim_path,model_info);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in run_pred_sim (line 108)
[S,model_info] = PreProcessing(S,osim_path);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in runPredSim (line 43)
[savename] = run_pred_sim(S,osim_path);
^^^^^^^^^^^^^^^^^^^^^^^^^
Error in main_cycling (line 124)
[savename] = runPredSim(S, osim_path);
^^^^^^^^^^^^^^^^^^^^^^^^
A quick-fix is to insert model.getCoordinateSet().getSize() in place of n_coord on line 41, such that the loop is over all of the coordinates of the OpenSim model, rather than the number of coordinates in the external function. However, a better solution should probably be implemented.
The text was updated successfully, but these errors were encountered:
Description
getCoordinateIndexForStateVectorOpenSimAPI()
may produce incorrect indices to reference the coordinates of the OpenSim model (stored inmodel_info.ExtFunIO.coordi_OpenSimAPIstate
) when the model contains a patellofemoral joint. Specifically, as the loop that sets the state variables of the OpenSim model to the corresponding coordinate index on lines 41-43 uses the number of coordinates from the external function (which ignores the patellofemoral joint), the state of all coordinates may not be assigned the correct index depending on the order of the coordinates returned bystate_vars = model.getStateVariableValues(state);
.Incorrect indexing of the coordinates of the OpenSim model in turn may trigger the following error:
A quick-fix is to insert
model.getCoordinateSet().getSize()
in place ofn_coord
on line 41, such that the loop is over all of the coordinates of the OpenSim model, rather than the number of coordinates in the external function. However, a better solution should probably be implemented.The text was updated successfully, but these errors were encountered: