Page 1 of 1

Index Out of Bounds Exception During IK

Posted: Fri Jun 25, 2021 8:53 am
by ahenry
Hello,
I am running into a 'java.lang.IndexOutOfBoundsException: Index: 276, Size: 169' error when running inverse kinematics on a model I have been modifying. I have not previously run into this issue and did not see any posts about it before. I am not sure where to begin looking for the origin of the error in my model file or what may be causing it. I tried attaching the OpenSim log file, but it appears that the board attachment quota was reached. If I could get information on what types of things would throw this error or where I could start looking for bugs in my model file that would be super helpful, thanks!

Re: Index Out of Bounds Exception During IK

Posted: Fri Jun 25, 2021 12:53 pm
by johnjdavisiv
I believe this is a visualizer bug that has to do with wrapping surfaces; I've encountered the same thing when trying to make a muscle wrap through a torus and over an ellipse. There was a thread reporting the same bug in IK here last month but we didn't find any solid answer as to the root cause.

This simple model can reproduce the error in OpenSim 4.2 (just open it and move the knee angle slider). The good news is that it does not seem to affect any actual calculations. One workaround in the interim, if IK won't run in the GUI, might be to run it from the command line.

Re: Index Out of Bounds Exception During IK

Posted: Fri Jun 25, 2021 1:32 pm
by ahenry
Hi John,
Thanks for the reply. I also took a look at the IK results in the plotter and everything appeared to be fine. I attempted IK with a simpler version of my model and ran into the same issue, so I agree that it is most likely a visualizer bug.