Dear All
I would like to create new model using matlab. I tried to create Custom Joint, but I can't define Transform function because every time I get information:
No constructor 'org.opensim.modeling.Function' with matching signature found.
Here is part of my code:
...
tr = TransformAxis();
tr.setAxis(Vec3(0,0,1));
tr.setCoordinateNames(ArrayStr('rotation1'));
my_function = Function();
No constructor 'org.opensim.modeling.Function' with matching signature found.
I use 64 bit system, with 64 bit matlab and OpenSim. Do you have any idea why it doesn't work?
Problem with Function ()
Re: Problem with Function ()
Hi Kamil,
You can't call Function directly. You have to build and attach fucntions like simmsplines(), LinearFunctions(), etc...
Just to show the hierarchy, first ill show how to get access to a function.
To create my own function I can do something like this;
Hope that helps,
-james
You can't call Function directly. You have to build and attach fucntions like simmsplines(), LinearFunctions(), etc...
Just to show the hierarchy, first ill show how to get access to a function.
Code: Select all
import org.opensim.modeling.*
% get a model
myModel = Model('C:\OpenSim3.2\Models\Gait2392_Simbody\gait2392_simbody.osim')
% get the custom joint
jnt = myModel.getJointSet().get('knee_r');
% Downcast to custom joint
customjoint = CustomJoint.safeDownCast(jnt);
% Get the custom joints spatial transform
sTran = customjoint.getSpatialTransform();
% Get the one of the translation axes
g = sTran.getTransformAxis(3);
% get a reference to the function
h = g.getFunction;
% safedowncast to the simmspline
simmspline = SimmSpline.safeDownCast(h);
% get the X and Y references.
simmsplineX = simmspline.getX;
simmsplineY = simmspline.getY;
Code: Select all
% create a default spatial transform
emptyTransform = SpatialTransform()
% create a default simmspline
emptySimmSpline = SimmSpline()
% get a handle to a translation axis
emptyTransformAxis = emptyTransform.getTransformAxis(3)
% set the function of that axis using the simmspline
emptyTransformAxis.setFunction(emptySimmSpline)
-james
- Kamil Antos
- Posts: 7
- Joined: Tue Sep 24, 2013 2:10 am
Re: Problem with Function ()
Dear James
Thank you for help! I will try this approach.
- Kamil
Thank you for help! I will try this approach.
- Kamil