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 :)
Issue with using SIMTKArrayCoordinateReference and InverseKinematicSolver
- Rachela Rosenhain
- Posts: 1
- Joined: Thu Jan 26, 2023 12:04 pm
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Issue with using SIMTKArrayCoordinateReference and InverseKinematicSolver
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
Looks like one way to go is to use `push_back()` to add individual `CoordinateReference` objects to the array.
Code: Select all
SimTK::Array_<CoordinateReference> coordRefs;
Constant coordRefFunc(refVal);
CoordinateReference coordRef(coord.getName(), coordRefFunc);
coordRef.setWeight(1.0);
coordRefs.push_back(coordRef);