Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty file after saving experimental TRC file #1344

Closed
mrrezaie opened this issue Apr 19, 2022 · 15 comments
Closed

Empty file after saving experimental TRC file #1344

mrrezaie opened this issue Apr 19, 2022 · 15 comments
Milestone

Comments

@mrrezaie
Copy link

Steps to reproduce

  1. in GUI, go to File > Preview Experimental Data.
  2. Select subject01_walk1.trc from Gait2392_Simbody sample data.
  3. Unfold it in the Navigator tab.
  4. Select Save As and save the data as a new TRC file.
  5. (Also if save it through Transform)

Expected result

Actual result

The saved file is empty and there is an Exception:
java.lang.IllegalArgumentException: No enum class org.opensim.modeling.Units$UnitType with value 771 at org.opensim.modeling.Units$UnitType.swigToEnum(Units.java:106) at org.opensim.modeling.Units.getType(Units.java:70) at org.opensim.view.experimentaldata.AnnotatedMotion.saveAsTRC(AnnotatedMotion.java:428) at org.opensim.view.experimentaldata.AnnotatedMotion.saveAs(AnnotatedMotion.java:393) at org.opensim.view.experimentaldata.ClassifyDataJPanel.saveTransformedMotion(ClassifyDataJPanel.java:271) at org.opensim.view.motions.MotionsSaveAsAction.saveMotion(MotionsSaveAsAction.java:45) at org.opensim.view.motions.MotionsSaveAsAction.performAction(MotionsSaveAsAction.java:80) at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:105) at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:70) at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:91) at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:74) at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:102) 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:6539) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) 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:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) 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:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136) [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)
(This behavior usually happens, not always)

Environment and GUI version

V. 4.3
V. 4.4-2022-04-15-227322b

@aymanhab aymanhab added this to the OpenSim 4.4 milestone Apr 20, 2022
@aymanhab
Copy link
Member

@mrrezaie This does not reproduce in either 4.4-dev or 4.3 on windows. Leaving as open for others to check.
@nickbianco or @carmichaelong maybe you can try this out in 4.3 and let us know since the functionality hasn't changed since then. Thank you

@nickbianco
Copy link
Member

On Mac with 4.4-dev I don't get the Java errors, but the markers don't visualize when loading the saved TRC file. Tested on 4.3 and there were no issues. So something may have changed since 4.3.

@nickbianco
Copy link
Member

Meant to add: the saved file on 4.4-dev was not empty. Some of the formatting changed slightly, but the file contents look mostly the same.

@mrrezaie
Copy link
Author

mrrezaie commented Apr 21, 2022

Please find the attached video:

ice_video_20220422-011538.zip

But, it doesn't always happen.

@nickbianco
Copy link
Member

Based on your video @mrrezaie, tried saving the file as "new.trc" (and "new1.trc") and was able to reproduce the error. But it doesn't happen consistently, as you say. I've saved the file several other times with different names (e.g., "subject01_walk1_test.trc") without error.

@aymanhab
Copy link
Member

aymanhab commented Apr 21, 2022

I suspect the exception is related to parsing error that results in units being undefined. This could be due to minor formatting issues earlier in the header. I have a PR that forces the (cameraRate, frameRate, etc.) to be written as ints rather than doubles and that seems to work.
PR #1346

@aymanhab
Copy link
Member

@mrrezaie Can you check the artifact of the PR to see if the problem is fixed? Link here https://github.com/opensim-org/opensim-gui/actions/runs/2204484033
Thank you

@aymanhab
Copy link
Member

Waiting for feedback before merging @mrrezaie Thank you

@mrrezaie
Copy link
Author

Sorry for the delayed response. The problem exists in this version (OpenSim-4.4-2022-04-21-f14248f-win64)

java.lang.IllegalArgumentException: No enum class org.opensim.modeling.Units$UnitType with value 955

@aymanhab
Copy link
Member

Thanks for testing @mrrezaie it's not clear if you're using a file that was previously saved/transformed or original/raw file. Please attach the file here. Ultimately if the tools can't read/parse the file then this is going nowhere, if the tools can then let me know to dig deeper on the GUI side. Thank you

@mrrezaie
Copy link
Author

mrrezaie commented Apr 25, 2022

Hi, I tested the original TRC files associated with Gait2354_Simbody and Rajagopal models. Please note that the error appears occasionally (Sometimes I can save the file successfully).
test.zip

@aymanhab
Copy link
Member

aymanhab commented May 4, 2022

If the proposed fix isn't really fixing the problem or improving behavior then I'll close without merging and leave the issue open until we can reproduce consistently. Please let me know @mrrezaie if you agree.

@mrrezaie
Copy link
Author

mrrezaie commented May 4, 2022

That's fine.

@aymanhab aymanhab modified the milestones: OpenSim 4.4, User Requests May 6, 2022
@aymanhab
Copy link
Member

aymanhab commented May 6, 2022

Since we can't reproduce consistently, will not merge the proposed hypothetical fix. Removing 4.4 milestone

@mrrezaie
Copy link
Author

Seems to be fixed by recent changes. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants