Page 1 of 1

Issue in finalizing connections

Posted: Tue Jun 11, 2024 8:57 am
by andreabraschi
Hi all,

I have been trying to implement some custom classes using the cpp API. As a starting point, I am trying to do the "build_simple_arm_model.py" example in cpp.

I was having some issue with adding components (ie bodies, joints, etc.) to the model, but I solved those using the advice that I found in this thread: viewtopicPhpbb.php?f=91&t=13858&p=39858&start=0&view=.
More specifically, I now build with "RelWithDebInfo".

My code now can successfully construct all the model components and add them to the model, such as

Code: Select all

model.addController(controller);
However it fails to finally finalize the connections when doing

Code: Select all

model.finalizeConnections();
Here is the the error description that I get when debugging:

Code: Select all

Microsoft C++ exception: OpenSim::ConnecteeNotSpecified at memory location 0x0000007F388FE3B0.
Microsoft C++ exception: OpenSim::Exception at memory location 0x0000007F388FE7E0.
Microsoft C++ exception: OpenSim::Exception at memory location 0x0000007F388FE7E0.
Probably it's worth mentioning that I am using OpenSim 4.4 and Visual Studio 17 2022.

I hope the error description is enough to roughly understand where the issue may come from. Happy to provide more detail on the code if needed!

Many thanks in advance.

Andrea

Re: Issue in finalizing connections

Posted: Tue Jun 11, 2024 11:45 am
by tkuchida
The "build_simple_arm_model.py" example is similar to the "OpenSim API Example" here (with C++, Python, and Matlab versions): https://github.com/opensim-org/opensim- ... PI-Example.

Re: Issue in finalizing connections

Posted: Wed Jun 12, 2024 2:45 am
by andreabraschi
Hi Tom,

many thanks for sharing the API example.

The example is very similar to the code I had written. I implemented the differences that were there, hoping that I made a mistake, but I get the same error:

Code: Select all

OpenSim::ConnecteeNotSpecified
Maybe it's related to how I built the environment?

All the best,
Andrea

Re: Issue in finalizing connections

Posted: Wed Jun 12, 2024 8:55 am
by tkuchida
Perhaps the VS debugger can help identify the issue? Please see https://learn.microsoft.com/en-us/answe ... -exception.