Page 1 of 1

Initializing a model's instance

Posted: Fri Feb 07, 2025 1:56 am
by mariacoral
Hello,

I'm currently trying to work with one of the models provided, Arm26. I was trying to access it through C++, but haven't been able to. I was using the same line as in the examples, but when executing the file, it just crashes. This is the line I was using:

Code: Select all

 Model osimModel("Arm26.osim");
I was also testing some of the other similar examples that access a model's instance, like OptimizationExample_Arm26 or SimpleOptimizationExample, and although it is able to build the .exe, it just crashes afterwards.

Any help would be appreciated!

Best regards,
Maria C.

Re: Initializing a model's instance

Posted: Mon Feb 10, 2025 5:17 am
by tkuchida
To confirm that OpenSim works at all, you could try just creating a new model ("Model osimModel;"). If that works, the issue may be that Arm26.osim is in the wrong directory; you could try including the full path or copying the file into the directory containing the executable. Using a try/catch block or RelWithDebInfo might provide more information.