Append coordinate to coordinate set of custom joint
Posted: Mon Oct 10, 2016 10:38 pm
Hi,
I am interested in appending coordinates to a custom joint (knee) to include abduction/adduction and int/ext rotation. I know how to do this manually in the model xml file, however, would like to do it programatically using the API in Matlab. Currently, I am able to edit the existing coordinate (knee_angle_r), and create new coordinates by cloning the existing, but am unable to append or update the coordinate set with the new coordinates. Is there a simple way to achieve this? Also, do I need to add the coordinate to the model or to the custom joint?
Here is the snippet of code I am currently running
Any information you can provide is greatly appreciated.
Regards,
Gavin.
I am interested in appending coordinates to a custom joint (knee) to include abduction/adduction and int/ext rotation. I know how to do this manually in the model xml file, however, would like to do it programatically using the API in Matlab. Currently, I am able to edit the existing coordinate (knee_angle_r), and create new coordinates by cloning the existing, but am unable to append or update the coordinate set with the new coordinates. Is there a simple way to achieve this? Also, do I need to add the coordinate to the model or to the custom joint?
Here is the snippet of code I am currently running
Code: Select all
% Get knee joint and current coordinate set
kneeJoint = CustomJoint.safeDownCast(current_model.getJointSet().get('knee_r'));
kneeCoordSet = kneeJoint.getCoordinateSet();
flexCoord = kneeCoordSet.get(0);
% Create clone of knee_angle_r for other DOFs
adductionCoord = flexCoord.clone();
intRotationCoord = flexCoord.clone();
% Update name and range for other DOF
adductionCoord.setName('knee_adduction_r'); adductionCoord.setRange(rotRangeAbd);
intRotationCoord.setName('knee_rotation_r'); intRotationCoord.setRange(rotRangeIntRot);
% Section here to append onto CoordinateSet
Regards,
Gavin.