Closed Minh309 closed 1 year ago
@Minh309 thanks for reporting, I will take a look asap. Btw, please consider using this repo for the predictive simulations: https://github.com/antoinefalisse/predsim_tutorial it is more up to date.
Hi Antoine, Thanks a lot for your reply. Correct me if I am wrong but can this code generate all external functions used in your predictive simulation projects? And we just need to change the model as an input to generate the external library?
Yes, that's the idea, but I developed this code afterwards so I am not sure about backward compatibility. This predictive simulation project is the most up to date: https://github.com/antoinefalisse/predsim_tutorial and you should be able to use the external functions generated using this code.
Here are some instructions I sent to someone:
Let me know for questions.
Hi Antoine,
Thank you so much for your thorough instructions. I managed to run the code in Linux. Now I have another question to ask: Is this code compatible with any OpenSim models or just with your model? If so, can we just use normal scale function in OpenSim to generate the model and use it in this code? If not, where should be modified to work with this code?
Thank you! Minh
Hi Minh,
The code to generate the external function should work with most opensim models, but not all. Please submit an issue if it does not work and I can check whether that would be easy to support. If you have a particular model you want to try, you can send it over too. Any scaled version of the example models should work.
The predictive simulation code is quite specific to the model, but you can adjust it for another model.
Let me know for questions,
Hi,
I am trying the code to generate some external functions in Linux for the models being used in this project: https://github.com/antoinefalisse/predictsim_mtp
It seems some models can work but others cannot. For example, when it comes to model: new_model_noMTP_scaled_FK.osim from predictsim_mtp\OpenSimModel\new_model\Model The code cannot generate the external functions with the following error:
terminate called after throwing an instance of 'std::runtime_error' what(): Needs to be symbolic make[2]: *** [CMakeFiles/new_model_noMTP_scaled_FK.dir/build.make:103: new_model_noMTP_scaled_FK] Aborted make[2]: *** Deleting file 'new_model_noMTP_scaled_FK' make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/new_model_noMTP_scaled_FK.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 Traceback (most recent call last): File "main.py", line 55, in <module> generateExternalFunction(pathOpenSimModel, pathExample, pathID, File "/home/minht/OpenSim_External/opensimAD/utilities.py", line 560, in generateExternalFunction buildExternalFunction(outputFilename, outputDir, 3*nCoordinates, File "/home/minht/OpenSim_External/opensimAD/utilities.py", line 745, in buildExternalFunction generateF(nInputs) File "/home/minht/OpenSim_External/opensimAD/utilities.py", line 658, in generateF y,_,_ = foo.foo(arg) TypeError: cannot unpack non-iterable NoneType object
I hope you could solve this issue.