opensim-core icon indicating copy to clipboard operation
opensim-core copied to clipboard

Enable GCVSpline in MATLAB

Open cvhammond opened this issue 2 years ago • 2 comments

The signature for the OpenSim object GCVSpline in methodsview GCVSpline shows org.opensim.modeling.SWIGTYPE_p_double for arguments 3 and 4. Is there a way to fix those arguments to allow us to use the GCVSpline object in MATLAB?

cvhammond avatar Jul 11 '22 15:07 cvhammond

While the convenience constructor that takes double* is not supported in Java/Matlab because the pointer data-type doesn't have an analogue in scripting, there're less convenient methods to set individual x, y values at specific indices virtual void setX(int aIndex, double aValue); virtual void setY(int aIndex, double aValue); If speed is an issue or if this is too much inconvenience feel free to add a convenience constructor that takes an ArrayDouble, std::vector or any other container that works for you elsewhere and we'll see how the swig bindings comes out.

aymanhab avatar Jul 11 '22 17:07 aymanhab

We will be using GCVSpline once at the start of Ground Contact Personalization so slow, but functional should be fine! I will investigate and report back if there are any issues.

cvhammond avatar Jul 11 '22 21:07 cvhammond

Please re-open and provide any additional details if you are still having issues. Thanks!

jenhicks avatar Nov 23 '22 19:11 jenhicks