Definition of the Tlink type and the associated functions.
- See Also
- Tlink, link.c.
Definition in file link.h.
|
struct | Tlink |
| Information about each rigid part of a mechanisms. More...
|
|
|
void | InitLink (char *name, Tlink *l) |
| Constructor. More...
|
|
void | CopyLink (Tlink *l_dst, Tlink *l_src) |
| Copy constructor. More...
|
|
void | AddBody2Link (Tpolyhedron *b, Tlink *l) |
| Adds a body to the link. More...
|
|
void | ChangeLinkReferenceFrame (unsigned int r, double **p1, double **p2, Tlink *l) |
| Sets a new reference frame for the link. More...
|
|
unsigned int | LinkNBodies (Tlink *l) |
| Gets the number of convex parts of the link. More...
|
|
unsigned int | LinkNAtoms (Tlink *l) |
| Gets the number of atoms in a link. More...
|
|
Tpolyhedron * | GetLinkBody (unsigned int i, Tlink *l) |
| Gets one of the convex parts of the link. More...
|
|
unsigned int | GetLinkBodyStatus (unsigned int i, Tlink *l) |
| Gets the status of one of the convex parts of the link. More...
|
|
char * | GetLinkName (Tlink *l) |
| Gets the name of a link. More...
|
|
boolean | IsLinkAllSpheres (Tlink *l) |
| Identifies links formed only by spheres. More...
|
|
void | SetPoseVars (Tparameters *p, boolean *vars, TCuikSystem *cs, Tlink *l) |
| Identifies the variables giving the pose of the link. More...
|
|
void | SetTransVars (boolean *vars, TCuikSystem *cs, Tlink *l) |
| Identifies the variables giving the translation of the link. More...
|
|
void | SetRotVars (Tparameters *p, boolean *vars, TCuikSystem *cs, Tlink *l) |
| Identifies the variables giving the rotation of the link. More...
|
|
void | GetLinkPoseSimpVars (Tparameters *p, boolean *sv, TCuikSystem *cs, Tlink *l) |
| Identifies the simplified variables giving the rotation of the link. More...
|
|
void | GenerateLinkRot (Tparameters *p, unsigned int lID, TCuikSystem *cs, Tlink *l) |
| Generate the variables and constraints related with the rotation of the link reference frame. More...
|
|
void | GenerateLinkRotLinks (Tparameters *p, unsigned int lID, TCuikSystem *cs, Tlink *l) |
| Version of GenerateLinkRot for partial matrix representation. More...
|
|
void | GenerateLinkRotFLinks (Tparameters *p, unsigned int lID, TCuikSystem *cs, Tlink *l) |
| Version of GenerateLinkRot for full matrix representation. More...
|
|
void | GenerateLinkRotQLinks (Tparameters *p, unsigned int lID, TCuikSystem *cs, Tlink *l) |
| Version of GenerateLinkRot for quaternions representation. More...
|
|
void | ApplyLinkRot (Tparameters *pr, double sf, unsigned int sv, double *p, Tequation *eq, TCuikSystem *cs, boolean groundLink, Tlink *l) |
| Transforms a vector from the local reference frame to the global one and accumulates the resulting expression into the given equations. More...
|
|
void | ApplyLinkRotVar (Tparameters *pr, double sf, unsigned int *vID, Tequation *eq, TCuikSystem *cs, boolean groundLink, Tlink *l) |
| Transforms a variable vector from the local reference frame to the global one and accumulates the resulting expression into the given equations. More...
|
|
void | ApplyLinkRotLinks (double sf, unsigned int sv, double *p, Tequation *eq, TCuikSystem *cs, boolean groundLink, Tlink *l) |
| Version of ApplyLinkRot for partial matrix representation. More...
|
|
void | ApplyLinkRotFLinks (double sf, unsigned int sv, double *p, Tequation *eq, TCuikSystem *cs, boolean groundLink, Tlink *l) |
| Version of ApplyLinkRot for full matrix representation. More...
|
|
void | ApplyLinkRotQLinks (double sf, unsigned int sv, double *p, Tequation *eq, TCuikSystem *cs, boolean groundLink, Tlink *l) |
| Version of ApplyLinkRot for quaternion representation. More...
|
|
void | RegenerateLinkSolution (Tparameters *p, TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Computes the values for the dummy variables used to represent the rotation matrices for a given link. More...
|
|
void | RegenerateLinkSolutionLinks (TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Version of RegenerateLinkSolution for partial matrix representation. More...
|
|
void | RegenerateLinkSolutionQLinks (TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Version of RegenerateLinkSolution for quaternion representation. More...
|
|
void | RegenerateLinkBox (Tparameters *p, TCuikSystem *cs, Tbox *b, boolean groundLink, Tlink *l) |
| Computes the values for the dummy variables. More...
|
|
void | RegenerateLinkBoxLinks (TCuikSystem *cs, Tbox *b, boolean groundLink, Tlink *l) |
| Version of RegenerateLinkBox for partial matrix representation. More...
|
|
void | RegenerateLinkBoxQLinks (TCuikSystem *cs, Tbox *b, boolean groundLink, Tlink *l) |
| Version of RegenerateLinkBox for quaternion representation. More...
|
|
void | GetTransform2Link (Tparameters *p, TCuikSystem *cs, double *sol, boolean groundLink, double *trans, THTransform *t, Tlink *l) |
| Gets the homogeneous transform associated with a link for a given solution point. More...
|
|
void | GetTransform2LinkLinks (TCuikSystem *cs, double *sol, boolean groundLink, double *trans, THTransform *t, Tlink *l) |
| Version of GetTransform2Link for partial matrix representation. More...
|
|
void | GetTransform2LinkFLinks (TCuikSystem *cs, double *sol, boolean groundLink, double *trans, THTransform *t, Tlink *l) |
| Version of GetTransform2Link for full matrix representation. More...
|
|
void | GetTransform2LinkQLinks (TCuikSystem *cs, double *sol, boolean groundLink, double *trans, THTransform *t, Tlink *l) |
| Version of GetTransform2Link for quaternion representation. More...
|
|
void | GenerateLinkSolution (Tparameters *p, THTransform *t, TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Defines the link variables from a transform. More...
|
|
void | GenerateLinkSolutionLinks (THTransform *t, TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Version of GenerateLinkSolution for partial matrix representation. More...
|
|
void | GenerateLinkSolutionFLinks (THTransform *t, TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Version of GenerateLinkSolution for full matrix representation. More...
|
|
void | GenerateLinkSolutionQLinks (THTransform *t, TCuikSystem *cs, double *sol, boolean groundLink, Tlink *l) |
| Version of GenerateLinkSolution for quaternion representation. More...
|
|
boolean | VisibleLink (Tlink *l) |
| Checks if a links has some visible parts. More...
|
|
double | GetLinkMaxCoordinate (Tlink *l) |
| Returns the sum of the maximum coordinate value for all the convex polyhedrons in the link. More...
|
|
void | LinkPrintAtoms (FILE *f, THTransform *tl, Tlink *l) |
| Prints the center of the atoms in a link in gobal coordinates. More...
|
|
void | LinkStoreAtoms (FILE *f, THTransform *tl, Tlink *l) |
| Prints the center of the atoms in a link in gobal coordinates. More...
|
|
void | PlotLink (Tplot3d *pt, double axesLength, Tlink *l) |
| Adds a link to a 3d scene. More...
|
|
void | MoveLinkFromTransform (Tplot3d *pt, THTransform *t, Tlink *l) |
| Displaces a link in a 3d scene. More...
|
|
void | PrintLink (FILE *f, char *path, char *prefix, Tlink *l) |
| Stores the link information into a file. More...
|
|
void | DeleteLink (Tlink *l) |
| Destructor. More...
|
|
When CT_REPRESENTATION is FLINKS, we can generate some redundant equations regarding the orthonormality of the three coordinates axis. By setting this constant to 0 these redundancy is avoided.
Definition at line 35 of file link.h.
Referenced by GenerateLinkRotFLinks().
#define INIT_NUM_SHAPES 2 |
Red component of the default color for links.
- See Also
- Tplot3d
Definition at line 53 of file link.h.
Green component of the default color for links.
- See Also
- Tplot3d
Definition at line 61 of file link.h.
Blue component of the default color for links.
- See Also
- Tplot3d
Definition at line 69 of file link.h.
#define IsGroundLink |
( |
|
id | ) |
(id==0) |
A test that return TRUE if the given identifier is the one correcponding to the ground link.
Definition at line 79 of file link.h.
Referenced by CheckAllCollisions(), CheckLinkObstacleCollision(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GetLinkTransformsFromSolution(), MechanismStoreRigidAtoms(), PrintJointAxes(), RegenerateMechanismBox(), RegenerateMechanismSolution(), and WorldDOF2Sol().
void InitLink |
( |
char * |
name, |
|
|
Tlink * |
l |
|
) |
| |
Initializes a link structure with no bodies.
- Parameters
-
name | The name to give to the link. |
l | The links to initialize. |
Definition at line 69 of file link.c.
References Tlink::allSpheres, Tlink::axisID, Tlink::bodies, Tlink::c, CopyVoidPtr(), Tlink::csvID, DeleteVoidPtr(), HTransformIdentity(), INIT_NUM_SHAPES, InitVector(), Tlink::iR, Tlink::maxCoord, Tlink::name, NEW, NO_UINT, Tlink::nvID, Tlink::R, Tlink::s, TRUE, and Tlink::vID.
Referenced by InitWorldFromMolecule(), and main().
Initializes a link copying the information from another link.
- Parameters
-
l_dst | The link to initialize. |
l_src | The link from where to copy. |
Definition at line 102 of file link.c.
References AddBody2Link(), Tlink::allSpheres, Tlink::axisID, Tlink::bodies, Tlink::c, CopyVoidPtr(), Tlink::csvID, DeleteVoidPtr(), GetLinkBody(), HTransformCopy(), INIT_NUM_SHAPES, InitVector(), Tlink::iR, LinkNBodies(), Tlink::maxCoord, Tlink::name, NEW, Tlink::nvID, Tlink::R, Tlink::s, TRUE, and Tlink::vID.
Referenced by AddLink2Mechanism().
Adds a body to the link.
- Parameters
-
b | The convex polyhedron to add to the link |
l | The link where to add the new polyhedron. |
Definition at line 147 of file link.c.
References Tlink::allSpheres, Tlink::bodies, CopyPolyhedron(), DECOR_SHAPE, GetPolyhedronMaxCoordinate(), GetPolyhedronStatus(), GetPolyhedronType(), Tlink::maxCoord, NEW, NewVectorElement(), and SPHERE.
Referenced by AddBody2Mechanism(), CopyLink(), InitWorldFromMolecule(), and main().
void ChangeLinkReferenceFrame |
( |
unsigned int |
r, |
|
|
double ** |
p1, |
|
|
double ** |
p2, |
|
|
Tlink * |
l |
|
) |
| |
In order to get the simplest possible set of solutions we can select a reference frame for the link different from that used to defined the bodies. This internal reference frame is defined from two (not necessarily orthogonal) vectors. Therefore, we store the sin and cos between the two vectors defining the internal reference frame and the rotation from the frame where bodies are defined and the internal reference frame.
This function does not change the points defining the bodies. (they remain in the original frame), but it changes the way they are interpreted changing the workings of functions GenerateLinkRot and ApplyLinkRot.
If the two given vectors are (almost) aligned, the internal reference frame is not changed.
When using a CT_REPRESENTATION based on quaternions it is not possible to change the internal link reference frame.
- Parameters
-
r | The type of representation to use (i.e., the CT_REPRESENTATION parameter). |
p1 | Two 3d points defining the first vector for the new internal reference frame. |
p2 | Two 3d points defining the second vector for the new internal reference frame. |
l | The link whose reference frame we want to change. |
Definition at line 163 of file link.c.
References Tlink::c, HTransformSetElement(), Tlink::iR, Tlink::R, REP_JOINTS, REP_QLINKS, and Tlink::s.
Referenced by InitWorldKinCS().
unsigned int LinkNBodies |
( |
Tlink * |
l | ) |
|
Gets the number of convex parts of the link.
- Parameters
-
- Returns
- The number of convex parts of the link.
Definition at line 246 of file link.c.
References Tlink::bodies, and VectorSize().
Referenced by AddLink2Mechanism(), AddLink2World(), CopyLink(), DeleteLink(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), MoveLinkFromTransform(), PlotLink(), PrintLink(), VisibleLink(), and WorldAtomJacobian().
unsigned int LinkNAtoms |
( |
Tlink * |
l | ) |
|
Gets one of the convex parts of the link.
- Parameters
-
i | The identifier of the convex part to retrive. The identifier of a part is given by the order at which they are added to the link. |
l | The link to query. |
- Returns
- A pointer to the requested convex part or NULL if the link does not have any part with the given identifier.
Definition at line 271 of file link.c.
References Tlink::bodies, and GetVectorElement().
Referenced by CopyLink(), DeleteLink(), GetMechanismDefiningPoint(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), MoveLinkFromTransform(), PlotLink(), PrintLink(), VisibleLink(), and WorldAtomJacobian().
unsigned int GetLinkBodyStatus |
( |
unsigned int |
i, |
|
|
Tlink * |
l |
|
) |
| |
char* GetLinkName |
( |
Tlink * |
l | ) |
|
Gets the name of a link.
- Parameters
-
- Returns
- A pointer to a string with the name of the link.
Definition at line 293 of file link.c.
References Tlink::name.
Referenced by GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateWorldSingularityEquations(), GetJointName(), GetJointTransSeq(), GetLinkID(), GetMechanismLinkID(), PrintCollisionInfoInt(), PrintCollisions(), PrintJoint(), RegenerateJointBox(), RegenerateJointSolution(), StoreCollisionInfoInt(), and WorldDOF2Sol().
Returns TRUE if all non-DECOR bodies in the link (i.e., bodies that are considered in the collision checking) are spheres.
This function is used when generating the collision avoidance related equations. If all involved bodies are spheres we do not use separating planes but we directly bound the squared distance between the sphere centers to be larger than the squared sum of radii.
- Parameters
-
- Returns
- TRUE if all non-DECOR bodies in the link are spheres.
Definition at line 298 of file link.c.
References Tlink::allSpheres.
Referenced by AddBody2Mechanism(), and AddLink2Mechanism().
Sets to TRUE the translations/rotation variables for the given link in the given array of variables.
- Parameters
-
p | The set of parameters. |
vars | The array of booleans to set. |
cs | The cuiksystem where the link variables are included. |
l | The link. |
Definition at line 303 of file link.c.
References SetRotVars(), and SetTransVars().
Sets to TRUE the translations variables for the given link in the given array of variables. In general the tranlation variables are not in the cuiksystems since translations are computed accumulating displacements over links. The translation variables are only present in very particular cuiksystems and for links that are at the end of a open sequende of links.
- Parameters
-
vars | The array of booleans to set. |
cs | The cuiksystem where the link variables are included. |
l | The link. |
Definition at line 309 of file link.c.
References GetCSVariableID(), LINK_TRANS, Tlink::name, NEW, NO_UINT, and TRUE.
Referenced by SetPoseVars().
Sets to TRUE the rotation variables for the given link in the given array of variables.
Note that the rotation variables depends on the CT_REPRESENTATION setting.
- Parameters
-
p | The set of parametes. |
vars | The array of booleans to set. |
cs | The cuiksystem where the link variables are included. |
l | The link. |
Definition at line 442 of file link.c.
References CacheRotVars(), CT_REPRESENTATION, Error(), GetParameter(), NO_UINT, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, TRUE, and Tlink::vID.
Referenced by SetPoseVars().
Identifies variables that give the rotation of the links that survive in the simplified cuiksystem.
Thes variables are identified in an array of booleans and their name is printed to a file (one name per row).
- Parameters
-
p | The set of parameters. |
sv | The array of booleans to set to TRUE for the good variables. |
cs | The cuiksystem on which the variable are defined. |
l | The link. |
Definition at line 478 of file link.c.
References CacheRotVars(), CT_REPRESENTATION, Error(), GetCSVariableName(), GetParameter(), IsSystemVarInSimpCS(), NO_UINT, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, TRUE, and Tlink::vID.
Referenced by GetWorldSimpVariableMask().
Each link has a 3D reference frame formed by three vectors (in general orthonormal vectors unless ChangeLinkReferenceFrame is used). This functions add the variales representing the rotation of this reference frame with respect to the gobal reference frame. The translation from this global reference frame to the origin of the frame attached to the link is given by equations involving only rotation variables (and fixed vectors) and can only be computed at the level where we have together links (mechanisms) and cuiksystems, that is, at the world.h level.
Note that the rotation representation depends on the CT_REPRESENTATION setting.
- Parameters
-
p | A set of parameters. They include, for instance the dummification level. |
lID | The identifier of the link in the mechanism. Used to generate unique names for the new variables. |
cs | The cuiksystem where to add the variables and equations. |
l | The link from where to generate the variables and equation. |
Definition at line 520 of file link.c.
References CT_REPRESENTATION, Error(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GetParameter(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS.
Referenced by InitWorldKinCS().
Version of GenerateLinkRot for partial matrix representation.
- Parameters
-
p | A set of parameters. They include, for instance the dummification level. |
lID | The identifier of the link in the mechanism. Used to generate unique names for the new variables. |
cs | The cuiksystem where to add the variables and equations. |
l | The link from where to generate the variables and equation. |
Definition at line 659 of file link.c.
References AddEquation2CS(), AddVariable2CS(), Tlink::c, DeleteEquation(), DeleteVariable(), DUMMY_VAR, GenerateDotProductEquation(), GenerateNormEquation(), GenerateScaledSaddleEquation(), GetCSVariableID(), IsGroundLink, LINK_ROT2, Tlink::name, NEW, NewInterval(), NewVariable(), NO_UINT, Tlink::s, SetVariableInterval(), and SYSTEM_VAR.
Referenced by GenerateLinkRot().
Version of GenerateLinkRot for full matrix representation.
- Parameters
-
p | A set of parameters. They include, for instance the dummification level. |
lID | The identifier of the link in the mechanism. Used to generate unique names for the new variables. |
cs | The cuiksystem where to add the variables and equations. |
l | The link from where to generate the variables and equation. |
Definition at line 543 of file link.c.
References AddEquation2CS(), AddVariable2CS(), Tlink::c, DeleteEquation(), DeleteVariable(), GenerateCrossProductEquations(), GenerateDotProductEquation(), GenerateNormEquation(), GetCSVariableID(), IsGroundLink, LINK_ROT, Tlink::name, NEW, NewInterval(), NewVariable(), NO_UINT, ROT_REDUNDANCY, Tlink::s, SetVariableInterval(), and SYSTEM_VAR.
Referenced by GenerateLinkRot().
Version of GenerateLinkRot for quaternion representation.
- Parameters
-
p | A set of parameters. They include, for instance the dummification level. |
lID | The identifier of the link in the mechanism. Used to generate unique names for the new variables. |
cs | The cuiksystem where to add the variables and equations. |
l | The link from where to generate the variables and equation. |
Definition at line 736 of file link.c.
References AddEquation2CS(), AddMonomial(), AddVariable2CS(), AddVariable2Monomial(), DeleteEquation(), DeleteMonomial(), DeleteVariable(), DUMMY_VAR, EQU, GenerateSaddleEquation(), GetCSVariableID(), InitEquation(), InitMonomial(), IsGroundLink, LINK_ROT3_E, LINK_ROT3_Q, Tlink::name, NEW, NewInterval(), NewVariable(), NFUN, NO_UINT, ResetMonomial(), SetEquationCmp(), SetEquationType(), SetEquationValue(), SetVariableInterval(), SYSTEM_EQ, and SYSTEM_VAR.
Referenced by GenerateLinkRot().
Apply the changes of basis given by the link reference frame to a vector. This results in an expression that transforms the vector from the local reference frame to the global one. These expressions are added to the given equations (one expression for X, another for Y, and another for Z).
- Parameters
-
pr | The set of parameters. |
sf | Constant scale factor to apply to the input vector. |
sv | Variable scale factor given as the identifier of the range in the given box whose center have to be used as scale factor. If no variable scale factor is to be used this parameter should be NO_UINT. |
p | The 3D vector in the link reference frame that we want to transform to the global one and to add to trans. |
eq | Set of 3 equations where to add the 3 expressions resulting from this function (one for the X component of the vector in the globla frame, another for the Y expression and, finally the expression for the Z component). |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers. The numerical identifier of the variable is used to generate a unique name for it. |
groundLink | TRUE if the given link is the ground link. |
l | The link to use to rotate the given input vector p. |
Definition at line 834 of file link.c.
References ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), CT_REPRESENTATION, Error(), GetParameter(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS.
Referenced by ApplyLinkRotVar(), GenerateJointEquations(), GenerateJointEquationsInBranch(), and GenerateJointRangeEquations().
Apply the changes of basis given by the link reference frame to a vector of variables representing a point in local coordinates of the link.
- Parameters
-
pr | The set of parameters. |
sf | Constant scale factor to apply to the input vector. |
vID | The 3D vector of variables to rotate. |
eq | Set of 3 equations where to add the 3 expressions resulting from this function (one for the X component of the vector in the globla frame, another for the Y expression and, finally the expression for the Z component). |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers. The numerical identifier of the variable is used to generate a unique name for it. |
groundLink | TRUE if the given link is the ground link. |
l | The link to use to rotate the given input vector p. |
Definition at line 1106 of file link.c.
References ApplyLinkRot(), CT_REPRESENTATION, DeleteEquation(), GetParameter(), InitEquation(), NO_UINT, Tlink::R, REP_JOINTS, and VarAccumulateEquations().
Version of ApplyLinkRot for partial matrix representation.
- Parameters
-
sf | Constant scale factor to apply to the input vector. |
sv | Variable scale factor given as the identifier of the range in the given box whose center have to be used as scale factor. If no variable scale factor is to be used this parameter should be NO_UINT. |
p | The 3D vector in the link reference frame that we want to transform to the global one and to add to trans. |
eq | Set of 3 equations where to add the 3 expressions resulting from this function (one for the X component of the vector in the globla frame, another for the Y expression and, finally the expression for the Z component). |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers. The numerical identifier of the variable is used to generate a unique name for it. |
groundLink | TRUE if the given link is the ground link. |
l | The link to use to rotate the given input vector p. |
Definition at line 925 of file link.c.
References AddCt2Monomial(), AddMonomial(), AddVariable2Monomial(), DeleteMonomial(), Error(), GetCSVariableID(), HTransformApply(), InitMonomial(), LINK_ROT2, Tlink::name, NEW, NFUN, NO_UINT, Tlink::R, ResetMonomial(), and ZERO.
Referenced by ApplyLinkRot().
Version of ApplyLinkRot for full matrix representation.
- Parameters
-
sf | Constant scale factor to apply to the input vector. |
sv | Variable scale factor given as the identifier of the range in the given box whose center have to be used as scale factor. If no variable scale factor is to be used this parameter should be NO_UINT. |
p | The 3D vector in the link reference frame that we want to transform to the global one and to add to trans. |
eq | Set of 3 equations where to add the 3 expressions resulting from this function (one for the X component of the vector in the globla frame, another for the Y expression and, finally the expression for the Z component). |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers. The numerical identifier of the variable is used to generate a unique name for it. |
groundLink | TRUE if the given link is the ground link. |
l | The link to use to rotate the given input vector p. |
Definition at line 859 of file link.c.
References AddCt2Monomial(), AddMonomial(), AddVariable2Monomial(), DeleteMonomial(), Error(), GetCSVariableID(), HTransformApply(), InitMonomial(), LINK_ROT, Tlink::name, NEW, NFUN, NO_UINT, Tlink::R, ResetMonomial(), and ZERO.
Referenced by ApplyLinkRot().
Version of ApplyLinkRot for quaternion representation.
- Parameters
-
sf | Constant scale factor to apply to the input vector. |
sv | Variable scale factor given as the identifier of the range in the given box whose center have to be used as scale factor. If no variable scale factor is to be used this parameter should be NO_UINT. |
p | The 3D vector in the link reference frame that we want to transform to the global one and to add to trans. |
eq | Set of 3 equations where to add the 3 expressions resulting from this function (one for the X component of the vector in the globla frame, another for the Y expression and, finally the expression for the Z component). |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers. The numerical identifier of the variable is used to generate a unique name for it. |
groundLink | TRUE if the given link is the ground link. |
l | The link to use to rotate the given input vector p. |
Definition at line 994 of file link.c.
References AddCt2Monomial(), AddMonomial(), AddVariable2Monomial(), DeleteMonomial(), Error(), GetCSVariableID(), InitMonomial(), LINK_ROT3_E, Tlink::name, NEW, NFUN, NO_UINT, ResetMonomial(), and ZERO.
Referenced by ApplyLinkRot().
Solution points only include values for the system (and secondary) variables. However, in some formulations, the frame of reference for each link is represented using not only system variables, but dummy variable too. This function computes the values for the link-related dummy variables form the system ones for a given link.
- Parameters
-
p | The set of parameters. |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point with the values for the system variables. At the end of the function, this vector also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1155 of file link.c.
References CT_REPRESENTATION, Error(), GetParameter(), RegenerateLinkSolutionLinks(), RegenerateLinkSolutionQLinks(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS.
Referenced by RegenerateMechanismSolution().
Version of RegenerateLinkSolution for partial matrix representation.
- Parameters
-
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point with the values for the system variables. At the end of the function, this vector also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1181 of file link.c.
References CacheRotVarsLinks(), Tlink::s, and Tlink::vID.
Referenced by GenerateLinkSolutionLinks(), and RegenerateLinkSolution().
Version of RegenerateLinkSolution for quaternion representation.
- Parameters
-
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point with the values for the system variables. At the end of the function, this vector also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1198 of file link.c.
References CacheRotVarsQLinks(), and Tlink::vID.
Referenced by GenerateLinkSolutionQLinks(), and RegenerateLinkSolution().
This is the same as RegenerateLinkSolution but working on solution boxes instead of on solution points (i.e. it is interval-based instead of floating point based).
- Parameters
-
p | The set of parameters. |
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
b | The solution box with the values for the system variables. At the end of the function, this box also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1222 of file link.c.
References CT_REPRESENTATION, Error(), GetParameter(), RegenerateLinkBoxLinks(), RegenerateLinkBoxQLinks(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS.
Referenced by RegenerateMechanismBox().
Version of RegenerateLinkBox for partial matrix representation.
- Parameters
-
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
b | The solution box with the values for the system variables. At the end of the function, this box also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1248 of file link.c.
References CacheRotVarsLinks(), GetBoxIntervals(), IntervalProduct(), IntervalScale(), Tlink::s, SetBoxInterval(), and Tlink::vID.
Referenced by RegenerateLinkBox().
Version of RegenerateLinkBox for quaternion representation.
- Parameters
-
cs | The cuik system on which the boxes are defiend. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
b | The solution box with the values for the system variables. At the end of the function, this box also has values for the link-related dummy variables. |
groundLink | TRUE if the given link is the ground link. The rotation matrix for the ground link is fixed (the identity) and, its rotation matrix generates no variables (nor system nor dummy). |
l | The link. |
Definition at line 1285 of file link.c.
References CacheRotVarsQLinks(), CopyInterval(), GetBoxInterval(), IntervalProduct(), SetBoxInterval(), and Tlink::vID.
Referenced by RegenerateLinkBox().
Returns the homogeneous transform with the position and orientation of the link for a given solution point.
- Parameters
-
p | The set of parameters. |
cs | The cuik system on which the boxes are defined. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point including values for all variables (i.e., already regenerated using RegenerateLinkSolution before calling this function). |
groundLink | TRUE if the given link is the ground link. |
trans | 3d vector with the translation from the ground link to this link. The variables for these translations are removed from the cuiksystems and computed from rotations and fixed vectors. Consequently they can only be computed at the level where we have cuiksystems and links (i.e. in world.h) |
t | The returned homogeneous transform. |
l | The link whose reference frame we want to retrive. |
Definition at line 1311 of file link.c.
References CT_REPRESENTATION, Error(), GetParameter(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS.
Referenced by GetLinkTransformsFromSolution(), and PrintJointAxes().
Version of GetTransform2Link for full partial representation.
- Parameters
-
cs | The cuik system on which the boxes are defined. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point including values for all variables (i.e., already regenerated using RegenerateLinkSolution before calling this function). |
groundLink | TRUE if the given link is the ground link. |
trans | 3d vector with the translation from the ground link to this link. The variables for these translations are removed from the cuiksystems and computed from rotations and fixed vectors. Consequently they can only be computed at the level where we have cuiksystems and links (i.e. in world.h) |
t | The returned homogeneous transform. |
l | The link whose reference frame we want to retrive. |
Definition at line 1372 of file link.c.
References AXIS_H, CacheRotVarsLinks(), HTransformIdentity(), HTransformOrthonormalize(), HTransformProduct(), HTransformSetElement(), Tlink::R, and Tlink::vID.
Referenced by GetTransform2Link().
Version of GetTransform2Link for full matrix representation.
- Parameters
-
cs | The cuik system on which the boxes are defined. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point including values for all variables (i.e., already regenerated using RegenerateLinkSolution before calling this function). |
groundLink | TRUE if the given link is the ground link. |
trans | 3d vector with the translation from the ground link to this link. The variables for these translations are removed from the cuiksystems and computed from rotations and fixed vectors. Consequently they can only be computed at the level where we have cuiksystems and links (i.e. in world.h) |
t | The returned homogeneous transform. |
l | The link whose reference frame we want to retrive. |
Definition at line 1335 of file link.c.
References AXIS_H, CacheRotVarsFLinks(), HTransformIdentity(), HTransformOrthonormalize(), HTransformProduct(), HTransformSetElement(), Tlink::R, and Tlink::vID.
Referenced by GetTransform2Link().
Version of GetTransform2Link for quaternion representation.
- Parameters
-
cs | The cuik system on which the boxes are defined. It is used to, given the name of the variables corresponding the reference frame of the given link, retrive its numerical identifiers, i.e., the number of range of the box to use to instantiate each variable. |
sol | The solution point including values for all variables (i.e., already regenerated using RegenerateLinkSolution before calling this function). |
groundLink | TRUE if the given link is the ground link. |
trans | 3d vector with the translation from the ground link to this link. The variables for these translations are removed from the cuiksystems and computed from rotations and fixed vectors. Consequently they can only be computed at the level where we have cuiksystems and links (i.e. in world.h) |
t | The returned homogeneous transform. |
l | The link whose reference frame we want to retrive. |
Definition at line 1415 of file link.c.
References HTransformIdentity(), HTransformOrthonormalize(), HTransformSetElement(), and Tlink::vID.
Referenced by GetTransform2Link().
Checks if a links has some visible parts, i.e., if not all the parts of the link are HIDDEN.
- Parameters
-
- Returns
- TRUE if the link has, at least, one NORMAL of DECOR part.
Definition at line 1564 of file link.c.
References FALSE, GetLinkBody(), GetPolyhedronStatus(), HIDDEN_SHAPE, and LinkNBodies().
Referenced by LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), MoveLinkFromTransform(), and PlotLink().
double GetLinkMaxCoordinate |
( |
Tlink * |
l | ) |
|
Returns the sum of the maximum coordinate value (either for X,Y or Z) for all the convex polyhedrons in the link. This is used in higher levels to define an over-estimate bounding-box of the world. This bounding box is used to define the ranges for some of the coordinate and separating planes variables.
- Parameters
-
- Returns
- The sum of the maximum coordinate values for all bodies in the link.
Definition at line 1580 of file link.c.
References Tlink::maxCoord.
Referenced by AddBody2Mechanism(), and AddLink2Mechanism().
Stores the centers of the atoms in a given link in global coordinates.
This is used only whent the world represents a molecule and we want to store the atom (i.e., the sphere) positions into a file.
- Parameters
-
f | The file where to store the atom centers. |
tl | The transform to get the global coordinates of the link. |
l | The link to process. |
Definition at line 1624 of file link.c.
References GetLinkBody(), LinkNBodies(), PolyhedronPrintCenter(), and VisibleLink().
Referenced by MechanismPrintAtoms().
void PlotLink |
( |
Tplot3d * |
pt, |
|
|
double |
axesLength, |
|
|
Tlink * |
l |
|
) |
| |
Adds a link to a 3d scene. It adds the diffent parts of the link as if they are expressed in the global frame. To displace the use MoveLinkFromTransform
- Parameters
-
pt | The 3d geometry where to add the link. |
axesLength | >0 to display the link axes. The value is the length of the lines representing the axes. The reference axes for the link are represeted as red for X, green for Y and blue for Z. |
l | The link to add to the scene. |
Definition at line 1585 of file link.c.
References Tlink::axisID, Close3dObject(), DeleteColor(), GetLinkBody(), LinkNBodies(), NewColor(), NO_UINT, PlotPolyhedron(), PlotVect3d(), StartNew3dObject(), and VisibleLink().
Referenced by PlotMechanism().
void PrintLink |
( |
FILE * |
f, |
|
|
char * |
path, |
|
|
char * |
prefix, |
|
|
Tlink * |
l |
|
) |
| |
void DeleteLink |
( |
Tlink * |
l | ) |
|
Deletes the information stored in a link and frees the allocated memory.
- Parameters
-
Definition at line 1722 of file link.c.
References Tlink::bodies, Tlink::csvID, DeletePolyhedron(), DeleteVector(), GetLinkBody(), HTransformDelete(), Tlink::iR, LinkNBodies(), Tlink::name, Tlink::nvID, Tlink::R, and Tlink::vID.
Referenced by DeleteMechanism(), InitWorldFromMolecule(), and main().
|
Follow us!