KULeuvenNeuromechanics / PredSim

Generate predictive simulations of human locomotion
MIT License
27 stars 53 forks source link

Changes needed for non-human models #154

Open dgupta7 opened 2 months ago

dgupta7 commented 2 months ago

There are some hard coded things that need to be addressed when using a non-human model. Here are three important issues

  1. In get_IG_pelvis_y.m, it needs the cacln_r bone, but certain models might not have that bone. This should be made a setting as to which bone to use here.
  2. If there are no coordinate limit torques, we get an error since the code assumes that there will be some. This is in the createCasadi_GenHelper.m function where the f_J_lim_torq is created. One solution can be to put these lines under an if statement that checks if there are any limit torques to be used in the model, that is, run these lines if model_info.ExtFunIO.jointi.nq.limTorq > 0. This implementation will be needed inside OCP_formulation as well.
  3. In opensimAD, in writeCppFile.m, the joint involving patella needs to be called 'patellofemoral<l/r>' joint, rather than just having 'patel' in joint name. This could be addressed by changing the line that searches for the exact name 'patellofemoral<l/r>' of the joint to checking if the joint name contains 'patel'. Note that this check is there twice in the code, and one time it is implemented correctly and the other time it is not.

To Reproduce Run Janneke's Bird model.