Page 1 of 1

Inverse Kinematic Problem

Posted: Thu Jan 09, 2020 10:07 am
by benedetta13
We are solving an Inverse Kinematic problem, we run the IK tool, in the messages we obtain 'InverseKinematicsTool completed 28 frames in 95.833s', but we also obtain an Unexpected Exception: 'Index: 52, Size:44'; if we press 'show and report problems' we obtain

'A java.lang.IndexOutOfBoundsException exception has occurred.
Click Show Details or see the messages.log file located in your C:\Users\BENGIU\AppData\Roaming\.OpenSim\4.0\var\log folder.',

and if we press 'show Details' we obtain this:

'java.lang.IndexOutOfBoundsException: Index: 52, Size: 44
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at org.opensim.threejs.ModelVisualizationJson.updatePathWithWrapping(ModelVisualizationJson.java:1455)
at org.opensim.threejs.ModelVisualizationJson.appendToFrame(ModelVisualizationJson.java:781)
at org.opensim.threejs.ModelVisualizationJson.createFrameMessageJson(ModelVisualizationJson.java:703)
at org.opensim.view.pub.ViewDB.updateModelDisplayNoRepaint(ViewDB.java:863)
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.handleUserTimeChange(MotionControlJPanel.java:613)
at org.opensim.view.motions.MotionControlJPanel.jTimeTextFieldPropertyChange(MotionControlJPanel.java:504)
at org.opensim.view.motions.MotionControlJPanel.access$900(MotionControlJPanel.java:63)
at org.opensim.view.motions.MotionControlJPanel$10.propertyChange(MotionControlJPanel.java:335)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at java.awt.Component.firePropertyChange(Component.java:8428)
at java.awt.Component.setBackground(Component.java:1835)
at javax.swing.JComponent.setBackground(JComponent.java:2733)
at javax.swing.plaf.basic.BasicTextUI.updateBackground(BasicTextUI.java:277)
at javax.swing.plaf.basic.BasicTextUI.propertyChange(BasicTextUI.java:205)
at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.propertyChange(BasicTextUI.java:1814)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:303)
at java.awt.Component.firePropertyChange(Component.java:8448)
at javax.swing.JComponent.firePropertyChange(JComponent.java:4491)
at javax.swing.JComponent.setEnabled(JComponent.java:2681)
at org.opensim.view.motions.MotionControlJPanel.enableComponents(MotionControlJPanel.java:772)
at org.opensim.view.motions.MotionControlJPanel.updatePanelDisplay(MotionControlJPanel.java:661)
at org.opensim.view.motions.MotionControlJPanel.update(MotionControlJPanel.java:722)
at java.util.Observable.notifyObservers(Observable.java:159)
at org.opensim.view.motions.MotionsDB.addMotion(MotionsDB.java:236)
at org.opensim.view.motions.MotionsDB.loadMotionStorage(MotionsDB.java:160)
at org.opensim.view.motions.MotionsDB.loadMotionFile(MotionsDB.java:146)
at org.opensim.view.motions.FileLoadMotionMenuAction.loadMotion(FileLoadMotionMenuAction.java:80)
at org.opensim.view.motions.FileLoadMotionMenuAction.performAction(FileLoadMotionMenuAction.java:52)
at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:130)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:127)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
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)'.

So for this problem we can load the resulted motion, but our model don't move.
Someone knows how to fix the problem?
Thanks!

Re: Inverse Kinematic Problem

Posted: Fri Jan 10, 2020 10:48 am
by aymanh
Hello,

Based on the stacktrace I can see the following:
1. InverseKinematics works properly, it doesn't use muscles anyway.
2. The stack trace suggests issue with displaying muscles that have wrapping objects. Are you using a model from our distribution or a custom one? If the latter I would suggest you scrutinize path wrapping as some models use muscle wrapping excessively and produce configurations where wrapping display is troublesome. If you can send/post a reduced model that reproduces the issue that would also help.

Best regards,
-Ayman

Re: Inverse Kinematic Problem

Posted: Fri Jan 10, 2020 11:07 am
by benedetta13
Hi,
We have used these models: UpperLowerBody and Stanford VA upper limb model_1, and in both of them we have the same problem.