Page 1 of 1

Index Out Of Bounds when motion load into GUI

Posted: Tue Dec 17, 2019 10:02 am
by ruthmei
Hi,

I use Matlab to create a motion with the IK tool.
The input TRC-file is written in matlab, too (no motion capturing).

I could successfully implement the IK tool in matlab, it runs trough without throwing any error.
I do this for 6 different combinations ( 3 differently scaled models with 2 movement types each).

However, if I load the calculated motion (= *.mot-file) into the GUI with the same model which I used for the IK tool run in matlab, sometimes it throws me an error.
The procedure is the following:
- I load my model into the GUI
- I load the motion
- I get the Index Out Of Bounds error (attached below)
(Sometimes directly after loading the motion, sometimes after some frames have been played.)
Interestingly, the error is changing and appears not always within the same model / movement type.

I searched the forum and found the following post from Erica:
viewtopicPhpbb.php?f=91&t=7326&p=19260&start=0&view=
If I understood here correctly, I should not have a first line = "header" of the .mot-file with more than 16 letters (which is "Coordinates" by standard when the motion is created via matlabs IK tool).
Therefore I don't adapt the final motion-file anymore (besides renaming the name of the file itself).
I am wondering if there are any additional restrictions to the mot-file that I should respect?

Although I don't adapt the final mot-file anymore, I get the index-out-of-bounds error, but only sometimes.
Since I am using the same TRC file for each model (only hand movement is described in there), I am supposing that this shouldn't be the reason (especially since IK tool runs trough).

I already now the documentation on mot-files
https://simtk-confluence.stanford.edu:8 ... t%29+Files
and that's exactly how the mot-file is generated by the IK-tool, I checked it.

Do you have any hints?

Thanks for your help,
Ruth



java.lang.IndexOutOfBoundsException: Index: 101, Size: 60
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.MasterMotionModel.advanceTime(MasterMotionModel.java:300)
at org.opensim.view.motions.MotionControlJPanel$RealTimePlayActionListener.actionPerformed(MotionControlJPanel.java:100)
at javax.swing.Timer.fireActionPerformed(Timer.java:313)
at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
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)

Re: Index Out Of Bounds when motion load into GUI

Posted: Tue Dec 17, 2019 12:28 pm
by ruthmei
Hi,

I realised that when I let my code run without having made any changes, the corrupted mot-file changes.
I have those 6 mot-files (out of 3 models with 2 movements each) and everytime another mot-file throws the index-out-of-bounds-error.

Maybe this helps?

Re: Index Out Of Bounds when motion load into GUI

Posted: Tue Dec 17, 2019 12:36 pm
by aymanh
Hi Ruth,

I don't believe we have a limit on the number of characters in headers, though the header format is relatively strict.

The stacktrace you posted suggests something to do with display of muscle wrapping. Please attach the model and one motion file that's causing the issue and we'll investigate. If you prefer not to share the model on the forum let me know and we'll find an alternative, or you can use the file-bug option in the application and attach a zip file.

Best regards,
-Ayman

Re: Index Out Of Bounds when motion load into GUI

Posted: Tue Dec 17, 2019 12:52 pm
by ruthmei
Hi Ayman,
Sure I can attach model and mot-file.
I'd be very happy if you can help me out.

Would you provide me some additional information of file-bugging in the GUI? I didn't know yet that this is possible.

Regarding the max number of characters: So if we find another issue causing that exception, I could change the "Coordinates" header in the mot-file to something more meaningful?

Thanks again :)
Ruth


// edit: I was told that I can not publish the model here.
Therefore I deleted it. Please don't distribute it further, thanks.