Hello,
I have created various scripts to do batch operations of IK, ID, CMC, etc. However, only the IK script outputs the final files (i.e, subject_ik.mot). ID and CMC do not do this. These scripts still run successfully and create setup files for each trial that when manually imported to the GUI run perfectly and create the output files. For reference, the example scripts for running ID provided in the OpenSim models folder do not create output files as well.
As an example, here is a portion of my ID trails python script that I am running in the GUI:
https://pastebin.com/8kMKfkfL
I have no errors output to the scripting shell window when running this or any of the OpenSim sample code. I am unsure if this is a bug with the current version of OpenSim or if I am missing a crucial step in specifying the output of tool files (Inverse kinematics seems to work fine with the methods I am using).
Thank you for any/all information,
Dylan
GUI simulation tools not creating output files
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: GUI simulation tools not creating output files
Hi Dylan,
Thanks for reporting, I looked at the code snippet you shared and it's hard to use such snippet to reproduce the issue but my guess is that the files are generated but in a different folder than what you expected. In general the application does a lot of work to make sure the current working directory handling is transparent to users, but when you write a script that uses the same code (GUI Script) you're on your own. Also while we make these tools appear similar to users of the application, the underlying code for each is not common to all. So my suggestions:
1. Look for the files in other places (e.g. installation folder)
2. If you believe there's a bug or unexpected behavior, create a minimal script to reproduce the issue and file a bug.
Please let us know what you find out.
Best regards,
-Ayman
Thanks for reporting, I looked at the code snippet you shared and it's hard to use such snippet to reproduce the issue but my guess is that the files are generated but in a different folder than what you expected. In general the application does a lot of work to make sure the current working directory handling is transparent to users, but when you write a script that uses the same code (GUI Script) you're on your own. Also while we make these tools appear similar to users of the application, the underlying code for each is not common to all. So my suggestions:
1. Look for the files in other places (e.g. installation folder)
2. If you believe there's a bug or unexpected behavior, create a minimal script to reproduce the issue and file a bug.
Please let us know what you find out.
Best regards,
-Ayman
Re: GUI simulation tools not creating output files
Ayman Habib,
Thank you for the attention to the problem. While I did not determine the cause of the tutorial files not creating an inverse dynamics output (this did not involve GUI code and was manually run), I did determine that my own code had a personal error that would not have been visible in the pastebin I provided. For anyone else who may have experienced a similar situation, it should be noted that the output directory of the ID tool can not be specified as a full filepath (unlike the Inverse Kinematics Tool). It must instead be only a filename and will appear in the folder which the tool is running.
Apologies for the confusion and thank you for the help.
Thank you for the attention to the problem. While I did not determine the cause of the tutorial files not creating an inverse dynamics output (this did not involve GUI code and was manually run), I did determine that my own code had a personal error that would not have been visible in the pastebin I provided. For anyone else who may have experienced a similar situation, it should be noted that the output directory of the ID tool can not be specified as a full filepath (unlike the Inverse Kinematics Tool). It must instead be only a filename and will appear in the folder which the tool is running.
Apologies for the confusion and thank you for the help.