Issue with using SIMTKArrayCoordinateReference and InverseKinematicSolver

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Rachela Rosenhain
Posts: 1
Joined: Thu Jan 26, 2023 12:04 pm

Issue with using SIMTKArrayCoordinateReference and InverseKinematicSolver

Post by Rachela Rosenhain » Wed Jul 05, 2023 8:29 am

I am currently trying to set up a multimodal inverse kinematics tracking using marker locations, coordinates and IMUs. For this purpose, I had originally used the two classes IMUInverseKinematicsTool and InverseKinematicsTool, which worked pretty well using .sto files as input.

However, I have now tried to track all three modalities together through the InverseKinematicsSolver. To start off, I attempted to use the constructor which uses the model, markersReference, coordinateReferences and a constraint weight. My attempts have been unsuccessful so far, and I believe it is due to the CoordinateReferences Array.

At first, I tried to simply create an Array and fill that with CoordinateReferences, but that did not match the constructor signature. I then tried to create an object from the class SimTKArrayCoordinateReference(). Unfortunately, there is no documentation on this class in the API. To fill the Array with data, I attempted to use the method adoptData, but it has not worked either. What long is one supposed to use when filling the SIMTKArray?

Does anyone have any experience with using the InverseKinematicsSolver or the SIMTKArrayCoordinateReference? I would greatly appreciate any further insight or information :)

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Issue with using SIMTKArrayCoordinateReference and InverseKinematicSolver

Post by Carmichael Ong » Tue Sep 05, 2023 11:04 am

There may not be any examples doing this in MATLAB, but there are some uses in the C++ tests. In particular, this might be helpful: https://github.com/opensim-org/opensim- ... r.cpp#L295

Code: Select all

SimTK::Array_<CoordinateReference> coordRefs;
Constant coordRefFunc(refVal);
CoordinateReference coordRef(coord.getName(), coordRefFunc);
coordRef.setWeight(1.0);
coordRefs.push_back(coordRef);
Looks like one way to go is to use `push_back()` to add individual `CoordinateReference` objects to the array.

POST REPLY