// This model has been made to illustrate the function of the AnyKinRotational and the difference between setting the Type o //of rotation to RotAxesAngle //Here is the description of RotAxesAngles from the Manual: //Cardan angles (Type = RotAxesAngles): Cardan angles measure a 3-D rotation by three angles //of planar rotation about the reference system?s axes. One should be aware that the sequence //of these rotations is important, and that any rotation subsequent to the first is a rotation about //a local axis arising from the previous rotation(s). Typical examples of such coordinates are //Euler angles and Bryant angles, which are described in the literature and both defined by a //specific sequence of rotations. In this class, the members Axis1, Axis2, and Axis3 can be //used to specify any particular sequence of rotations. //One should notice that Cardan angles for any rotation sequence has the inherent problem of //singular rotations, i.e., rotations where the middle rotation has made the first and the last axes //to be parallel; this makes the measure indeterminate and close to such positions it will be //inaccurate. This problem is also known as "Gimbal Lock". //The model shows to cooridnate systems, the blue is fixed to ground and the red rotates. //The drivers has been made with an interpolation function that drives each of the rotations separately and one at the time //to illustrate the function of the measure. //Try to run the RotAxesAnglesStudy1 and pay close attention to the rotation sequence. Main = { // The actual body model goes in this folder AnyFolder MyModel = { // Global Reference Frame AnyFixedRefFrame GlobalRef = { AnyDrawRefFrame drw={ RGB={0,0,1}; ScaleXYZ={1,1,1}*0.5; }; }; // Global reference frame AnySeg Mass={ Mass=0; Jii={0.0,0.0,0.0}; AnyRefNode Node1={ AnyDrawRefFrame drw={ RGB={1,0,0}; ScaleXYZ={1,1,1}*0.5; }; }; }; AnyKinEq lincon={ AnyKinLinear lin ={ AnyFixedRefFrame &ref1=..GlobalRef; AnyRefNode &ref2=..Mass.Node1; }; }; }; // MyModel // This study shows how the RotAxesAngles works: // it will rotate equally (Angle) on the three axes // Try to change the following properties: // Angle : amount of rotation on each axis; // Sequence of rotation : sequence of rotations AnyBodyStudy RotAxesAnglesStudy = { AnyFolder &Model = .MyModel; AnyVar Angle=45; //this is the AnyIntArray SequenceOfRotation ={0,1,2}; //Default is Z,Y,X = 0,1,2 AnyKinEqInterPolDriver drv ={ AnyKinRotational rot ={ Type=RotAxesAngles; AnyFixedRefFrame &ref1=...MyModel.GlobalRef; AnyRefNode &ref2=...MyModel.Mass.Node1; }; MeasureOrganizer=.SequenceOfRotation; Type=PiecewiseLinear; T=.tEnd*{0,1,2,3}/3; Data={ {0,1,1,1}, {0,0,1,1}, {0,0,0,1}}*.Angle*pi/180; }; RecruitmentSolver = MinMaxSimplex; Gravity = {0.0, -9.81, 0.0}; nStep=1000; }; }; // Main