Issue in finalizing connections

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Andrea Braschi
Posts: 14
Joined: Thu Mar 11, 2021 2:42 am

Issue in finalizing connections

Post by Andrea Braschi » Tue Jun 11, 2024 8:57 am

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

Tags:

User avatar
Thomas Uchida
Posts: 1792
Joined: Wed May 16, 2012 11:40 am

Re: Issue in finalizing connections

Post by Thomas Uchida » Tue Jun 11, 2024 11:45 am

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.

User avatar
Andrea Braschi
Posts: 14
Joined: Thu Mar 11, 2021 2:42 am

Re: Issue in finalizing connections

Post by Andrea Braschi » Wed Jun 12, 2024 2:45 am

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

User avatar
Thomas Uchida
Posts: 1792
Joined: Wed May 16, 2012 11:40 am

Re: Issue in finalizing connections

Post by Thomas Uchida » Wed Jun 12, 2024 8:55 am

Perhaps the VS debugger can help identify the issue? Please see https://learn.microsoft.com/en-us/answe ... -exception.

POST REPLY