My code:
Code: Select all
//LEFT DISC JOINT WITH GROUND
SpatialTransform sTransform;
sTransform[0].setCoordinateNames(OpenSim::Array<std::string>("coord1", 0, 0));
sTransform[0].setFunction(new LinearFunction());
Vec3 DiscLlocationInParent(0, 0, 0), DiscLorientationInParent(0), DiscLlocationInBody(0), DiscLorientationInBody(0);
CustomJoint *DiscLToGround = new CustomJoint("DiscLToGround", maxillaire, DiscLlocationInParent, DiscLorientationInParent, *DiscL, DiscLlocationInBody, DiscLorientationInBody, sTransform,false);
CoordinateSet& DiscLjointCoordinateSet = DiscLToGround->upd_CoordinateSet();
double DiscLangleRange[2] = { -SimTK::Pi / 2, SimTK::Pi / 2 };
double DiscLpositionRange[2] = { -1, 1 };
DiscLjointCoordinateSet[0].setRange(DiscLangleRange);
DiscLjointCoordinateSet[1].setRange(DiscLangleRange);
DiscLjointCoordinateSet[2].setRange(DiscLangleRange);
DiscLjointCoordinateSet[3].setRange(DiscLpositionRange);
DiscLjointCoordinateSet[4].setRange(DiscLpositionRange);
DiscLjointCoordinateSet[5].setRange(DiscLpositionRange);