java.lang.IndexOutOfBoundsException when running Inverse Kinematics

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Quinten Humphrey
Posts: 36
Joined: Mon Feb 08, 2021 2:36 pm

java.lang.IndexOutOfBoundsException when running Inverse Kinematics

Post by Quinten Humphrey » Tue May 25, 2021 11:31 am

A java.lang.IndexOutOfBoundsException exception has occurred. can someone explain this to me and what I should consider because I'm unsure of what to fix or how to go about it.

java.lang.IndexOutOfBoundsException: Index: 251, Size: 210
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at org.opensim.threejs.ModelVisualizationJson.updatePathWithWrapping(ModelVisualizationJson.java:1505)
at org.opensim.threejs.ModelVisualizationJson.appendToFrame(ModelVisualizationJson.java:793)
at org.opensim.threejs.ModelVisualizationJson.createFrameMessageJson(ModelVisualizationJson.java:714)
at org.opensim.view.pub.ViewDB.updateModelDisplayNoRepaint(ViewDB.java:864)
at org.opensim.view.motions.MasterMotionModel.doUpdateAndRepaint(MasterMotionModel.java:82)
at org.opensim.view.motions.MasterMotionModel.applyTime(MasterMotionModel.java:98)
at org.opensim.view.motions.MasterMotionModel.setTime(MasterMotionModel.java:287)
at org.opensim.view.motions.MotionControlJPanel.update(MotionControlJPanel.java:698)
at java.util.Observable.notifyObservers(Observable.java:159)
at org.opensim.view.motions.MotionsDB.setCurrent(MotionsDB.java:267)
at org.opensim.view.motions.MotionsDB.addMotion(MotionsDB.java:238)
at org.opensim.tracking.IKToolModel.updateMotion(IKToolModel.java:213)
at org.opensim.tracking.IKToolModel.access$500(IKToolModel.java:53)
at org.opensim.tracking.IKToolModel$IKToolWorker.finished(IKToolModel.java:164)
at org.opensim.swingui.SwingWorker$1.run(SwingWorker.java:124)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Tags:

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: java.lang.IndexOutOfBoundsException when running Inverse Kinematics

Post by Ayman Habib » Tue May 25, 2021 2:29 pm

Hi Quinten,

I have seen similar issue in the past with a model that was assembled from multiple models and so was too complicated and rather impossible to debug (other than finding out that it's an issue with visualization of a complicated muscle wrapping). This should have no effect on IK solution or downstream calculations, though. if you can reproduce the issue with a simple model/muscle/wrapping then I'd be happy to look into it, in which case please file a bug report and attach the simple model and a description for how to reproduce the issue so we can investigate.

Best regards,
-Ayman

User avatar
John Davis
Posts: 56
Joined: Mon Aug 26, 2019 7:42 am

Re: java.lang.IndexOutOfBoundsException when running Inverse Kinematics

Post by John Davis » Wed May 26, 2021 12:15 pm

This error log looks very similar to a visualizer error I encountered when trying to port a SIMM model to OpenSim. I am able to trigger the error with a simple model that has a single muscle that wraps over both an ellipsoid and through a torus. I have a reproducible example posted here on my GitHub if that's helpful. I've also filed an issue here that reports this bug.

As Ayman commented, it seems like this is purely a visualizer error, since in my case OpenSim still happily computes muscle moment arms without any problems, despite the error.

POST REPLY