link.c File Reference Detailed Description
Function Documentation
Defines the csvID, vID, and nvID fields for the link. If the values are already cached nothing is done. If the cuiksystem is diferent from that for which the identified where computed before they are re-computed. Note that in general there are not translation variables associated with a link but that translations are computed accumulating displacements on links from the ground link to the current one. In global cuiksystems, though, those accumulations are identified with given variables and they can be directly retrieved (see SetTransVars).
Definition at line 326 of file link.c. References CacheRotVarsFLinks(), CacheRotVarsLinks(), CacheRotVarsQLinks(), Error(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS. Referenced by GetLinkPoseSimpVars(), and SetRotVars().
Version of CacheRotVars for REP_FLINKS representations.
Definition at line 346 of file link.c. References Tlink::csvID, GetCSVariableID(), LINK_ROT, Tlink::name, NEW, Tlink::nvID, and Tlink::vID. Referenced by CacheRotVars(), GenerateLinkSolutionFLinks(), and GetTransform2LinkFLinks().
Version of CacheRotVars for REP_LINKS representations.
Definition at line 376 of file link.c. References Tlink::csvID, GetCSVariableID(), LINK_ROT2, Tlink::name, NEW, Tlink::nvID, and Tlink::vID. Referenced by CacheRotVars(), GenerateLinkSolutionLinks(), GetTransform2LinkLinks(), RegenerateLinkBoxLinks(), and RegenerateLinkSolutionLinks().
Version of CacheRotVars for REP_QLINKS representations.
Definition at line 405 of file link.c. References Tlink::csvID, GetCSVariableID(), LINK_ROT3_E, LINK_ROT3_Q, Tlink::name, NEW, Tlink::nvID, and Tlink::vID. Referenced by CacheRotVars(), GenerateLinkSolutionQLinks(), RegenerateLinkBoxQLinks(), and RegenerateLinkSolutionQLinks().
Initializes a link structure with no bodies.
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.
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.
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().
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.
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().
Gets 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().
Gets the number of atoms (i.e., spheres) in a link.
Definition at line 251 of file link.c. References GetLinkBody(), GetPolyhedronType(), LinkNBodies(), SPHERE, and VisibleLink(). Referenced by MechanismStoreRigidAtoms().
Gets one of the convex parts of the link.
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().
Gets the status of one of the convex parts of the link.
Definition at line 282 of file link.c. References Tlink::bodies, GetPolyhedronStatus(), GetVectorElement(), and NO_UINT. Referenced by InitPQPCD(), InitSolidCD(), and InitVcollideCD().
Gets the name of a 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.
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.
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.
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.
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).
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.
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 full matrix representation.
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 partial matrix representation.
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 quaternion representation.
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).
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().
Version of ApplyLinkRot for full matrix representation.
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 partial matrix representation.
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 quaternion representation.
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().
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.
Definition at line 1106 of file link.c. References ApplyLinkRot(), CT_REPRESENTATION, DeleteEquation(), GetParameter(), InitEquation(), NO_UINT, Tlink::R, REP_JOINTS, and VarAccumulateEquations().
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.
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.
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.
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).
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.
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.
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.
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 matrix representation.
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 full partial representation.
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 quaternion representation.
Definition at line 1415 of file link.c. References HTransformIdentity(), HTransformOrthonormalize(), HTransformSetElement(), and Tlink::vID. Referenced by GetTransform2Link().
Generate the solution variables form an homogenous transform giving the pose of the link. This is basically the reverse of GetTransform2Link.
Definition at line 1460 of file link.c. References CT_REPRESENTATION, Error(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateLinkSolutionQLinks(), GetParameter(), REP_FLINKS, REP_JOINTS, REP_LINKS, and REP_QLINKS. Referenced by WorldDOF2Sol().
Version of GenerateLinkSolution for full matrix representation.
Definition at line 1484 of file link.c. References CacheRotVarsFLinks(), HTransformDelete(), HTransformGetElement(), HTransformProduct(), Tlink::iR, and Tlink::vID. Referenced by GenerateLinkSolution().
Version of GenerateLinkSolution for partial matrix representation.
Definition at line 1510 of file link.c. References CacheRotVarsLinks(), HTransformDelete(), HTransformGetElement(), HTransformProduct(), Tlink::iR, RegenerateLinkSolutionLinks(), and Tlink::vID. Referenced by GenerateLinkSolution().
Version of GenerateLinkSolution for quaternion representation.
Definition at line 1538 of file link.c. References CacheRotVarsQLinks(), HTransformGetElement(), RegenerateLinkSolutionQLinks(), and Tlink::vID. Referenced by GenerateLinkSolution(). Checks if a links has some visible parts, i.e., if not all the parts of the link are HIDDEN.
Definition at line 1564 of file link.c. References FALSE, GetLinkBody(), GetPolyhedronStatus(), HIDDEN_SHAPE, and LinkNBodies(). Referenced by LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), MoveLinkFromTransform(), and PlotLink().
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.
Definition at line 1580 of file link.c. References Tlink::maxCoord. Referenced by AddBody2Mechanism(), and AddLink2Mechanism(). 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
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().
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.
Definition at line 1624 of file link.c. References GetLinkBody(), LinkNBodies(), PolyhedronPrintCenter(), and VisibleLink(). Referenced by MechanismPrintAtoms().
Stores the centers of the atoms and their radius in a given link in global coordinates. This is an auxiliary function of MechanismStoreRigidAtoms.
Definition at line 1641 of file link.c. References GetLinkBody(), LinkNBodies(), PolyhedronPrintCenterAndCenter(), and VisibleLink(). Referenced by MechanismStoreRigidAtoms().
Displaces a link previously added to a 3d scene from the transform giving the pose of the link. This function triggers an error (actually the error is triggered in GetTransform2Link) if applied to the groundlink. Note that the groundLink is not suposed to move.
Definition at line 1658 of file link.c. References Tlink::axisID, GetLinkBody(), LinkNBodies(), Move3dObject(), MovePolyhedron(), NO_UINT, and VisibleLink(). Referenced by MoveMechanismFromTransforms().
Stores the link information into a file in the format valid to be read by InitWorldFromFile.
Definition at line 1687 of file link.c. References GetLinkBody(), LinkNBodies(), Tlink::name, NEW, and PrintPolyhedron(). Referenced by PrintMechanism().
Deletes the information stored in a link and frees the allocated memory.
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!