CustomJoint in Matlab
Posted: Thu Nov 21, 2019 11:06 am
Hello everyone,
I have found that on the website of api, there is no expression for Matlab. For CustomJoint, which relates to the operation of SpatialTransform, always outputs errors in my case.
I have attached my codes here:
spatialTrans = SpatialTransform();
spatialTrans.updTransformAxis(0).setCoordinateNames('rotation1',1);
spatialTrans.updTransformAxis(0).setFunction(LinearFunction(1,0));
spatialTrans.updTransformAxis(0).setAxis(Vec3(1,0,0));
spatialTrans.updTransformAxis(1).setCoordinateNames('rotation2',1);
spatialTrans.updTransformAxis(1).setAxis(Vec3(0, 1, 0));
spatialTrans.updTransformAxis(2).setCoordinateNames('rotation3',1);
spatialTrans.updTransformAxis(2).setAxis(Vec3(0, 0, 1));
spatialTrans.updTransformAxis(3).setCoordinateNames('translation1',1);
spatialTrans.updTransformAxis(3).setAxis(Vec3(1, 0, 0));
spatialTrans.updTransformAxis(4).setCoordinateNames('translation2',1);
spatialTrans.updTransformAxis(4).setAxis(Vec3(0, 1, 0));
spatialTrans.updTransformAxis(5).setCoordinateNames('translation3',1);
spatialTrans.updTransformAxis(5).setAxis(Vec3(0, 0, 1));
I_to_II = CustomJoint('joint', body_I, locationInParent,...
orientationInParent, body_II, locationInChild, orientationInChild, spatialTrans);
% Update the coordinates of the new joint
exoCoord =I_to_II.upd_CoordinateSet();
exoCoord.get(0).setRange([0.0, 120*pi/180]);
exoCoord.get(0).setName('rotation');
Each time when I run this snippet of codes, there is always error warning:
No method 'setCoordinateNames' with matching signature
found for class 'org.opensim.modeling.TransformAxis'.
It may tell me that the variables in 'setCoordinateNames()' are not correctly filled.
Any suggestions from the experts?
Thanks a lot for your assistance.
I have found that on the website of api, there is no expression for Matlab. For CustomJoint, which relates to the operation of SpatialTransform, always outputs errors in my case.
I have attached my codes here:
spatialTrans = SpatialTransform();
spatialTrans.updTransformAxis(0).setCoordinateNames('rotation1',1);
spatialTrans.updTransformAxis(0).setFunction(LinearFunction(1,0));
spatialTrans.updTransformAxis(0).setAxis(Vec3(1,0,0));
spatialTrans.updTransformAxis(1).setCoordinateNames('rotation2',1);
spatialTrans.updTransformAxis(1).setAxis(Vec3(0, 1, 0));
spatialTrans.updTransformAxis(2).setCoordinateNames('rotation3',1);
spatialTrans.updTransformAxis(2).setAxis(Vec3(0, 0, 1));
spatialTrans.updTransformAxis(3).setCoordinateNames('translation1',1);
spatialTrans.updTransformAxis(3).setAxis(Vec3(1, 0, 0));
spatialTrans.updTransformAxis(4).setCoordinateNames('translation2',1);
spatialTrans.updTransformAxis(4).setAxis(Vec3(0, 1, 0));
spatialTrans.updTransformAxis(5).setCoordinateNames('translation3',1);
spatialTrans.updTransformAxis(5).setAxis(Vec3(0, 0, 1));
I_to_II = CustomJoint('joint', body_I, locationInParent,...
orientationInParent, body_II, locationInChild, orientationInChild, spatialTrans);
% Update the coordinates of the new joint
exoCoord =I_to_II.upd_CoordinateSet();
exoCoord.get(0).setRange([0.0, 120*pi/180]);
exoCoord.get(0).setName('rotation');
Each time when I run this snippet of codes, there is always error warning:
No method 'setCoordinateNames' with matching signature
found for class 'org.opensim.modeling.TransformAxis'.
It may tell me that the variables in 'setCoordinateNames()' are not correctly filled.
Any suggestions from the experts?
Thanks a lot for your assistance.