link.h File Reference Introduction
Macro Definition Documentation◆ ROT_REDUNDANCY
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. ◆ INIT_NUM_SHAPES
Initial room for shapes in a link. Each shape is a convex polyhedron. It will be enlarged if necessary.
◆ DLC_R
◆ DLC_G
◆ DLC_B
◆ LINK_FullRot
◆ LINK_AxisX
A link where only the X axis is relevant (the actual pose of the Y and Z axis is not relevant). This is used, for instance, in composite joints (sph_sph, sph_prs_sph, strut, bar, cables). Irrespectively of the representation, axis-X links are represented by a single vector since this is the simpler possible representation. ◆ LINK_DeformX
◆ LINK_PrismaticX
◆ LINK_NoRot
◆ LINK_Connect
This is a particular type of link which is not included in the kinematic tree and whose pose is not directly included in the configuration, but deduced when the pose of other links is fixed. Rigth now links of this class include cables and springs (and possibly legs) added between porticular points of some other links, whose pose can be directly deduced from the configuration. This class of links can be seen as a LINK_DeformX link, but the deformation parameters and the parameters of the joints around the link are not included in the configuration. Right not connection links are only used for representation and collision detection, but they do not impose any kink of constraint, i.e., they are of variable lenght. Imposing a fixed length would imply to add equations to the problem. Such equations would involve the rotation/translation of the connected links and this would result in complex expressions which we can not generate at this point. In non-DOF representations they require the explicit representaiton of rotations (which are long expression depending on the kinematic chains). In DOF representations they would require the matrix x vector product (which leads to 3 equations), which is not implemented yet. Note that the matrix in this case is actually a product of several matrices.
◆ NO_FORCE
◆ VAR_FORCE
Force model used for links that can support/exert compression/tension but the resulting force is unrelated with the link length. This is used, for instance, for tensegrity elements with constant length (e.g. struts, bars or fixed length cables) that can apply some force. If we use a linear model for this case, the have to introduce another variable (the rest length or the stitffness) that will vary as the force varies. This extra variable is actually useless. Note that introducing both the rest length and the stiffness will introduce a fake degree of freedom. ◆ LINEAR_FORCE
Force model used some of the tensegrity links such as variable length cables or springs. In this model the compression/tension is computed as
Where 'f' is the compression/tension force, 'k' is the stiffness constant, 'l' is the link length, and 'r' is the rest length. This model is basically used for elements in tension, which are the ones that typically vary in length. Note that these are the only links contributing to the potential energy of the tensegrity (see LinkPotentialEnergy). ◆ C_CABLE◆ C_SPRING◆ C_LEG◆ IsGroundLink
Function Documentation◆ EmptyLinkConf()Determines if a link internal configuration is empty, i.e., if it is a link without internal deformation degrees of freedom (it may have internal force degrees of freedom but those are not relevant ot the kinematics).
Definition at line 649 of file link.c. References IsVariableLengthLink(), and TLinkConf::l. Referenced by CheckCollisionSolid(), GetLinkConfExtension(), GetLinkConfTransform(), and MoveLinkFromTransform(). ◆ GetLinkConfExtension()
Extension of the link. Only defined for prismatic links. For other links it triggers an error.
Definition at line 654 of file link.c. References EmptyLinkConf(), Error(), GetLinkType(), TLinkConf::l, LINK_PrismaticX, and TLinkConf::p. Referenced by main(). ◆ GetLinkConfTransform()
Defines a transformation that traverses the link, taking into account the possible link deformation..
Definition at line 665 of file link.c. References EmptyLinkConf(), GetLinkType(), HTransformIdentity(), HTransformScaleX(), HTransformTx(), TLinkConf::l, LINK_DeformX, LinkNBodies(), and TLinkConf::p. Referenced by CheckCollisionSolid(), and MoveLinkFromTransform(). ◆ DeleteLinkConf()
Release memory.
Definition at line 684 of file link.c. References TLinkConf::p. Referenced by DeleteLinkTransforms(). ◆ InitLink()
Initializes a link structure with no bodies.
Definition at line 701 of file link.c. References Tlink::allSpheres, Tlink::axisID, Tlink::bodies, Tlink::c, CopyVoidPtr(), Tlink::csvID, DeleteVoidPtr(), Error(), Tlink::extForce, FALSE, Tlink::fixedDim, Tlink::force, Tlink::forceEquilibrium, Tlink::forceModel, HTransformCopy(), HTransformIdentity(), Tlink::iFrame, Tlink::iMatrix, INF, INIT_NUM_SHAPES, InitVector(), Tlink::iR, Tlink::l1, Tlink::l2, Tlink::length, LINK_FullRot, Tlink::mass, Tlink::maxCoord, Tlink::name, NEW, NewInterval(), NO_FORCE, NO_UINT, Tlink::nvID, Tlink::p1, Tlink::p2, Tlink::R, Tlink::rest, Tlink::s, Tlink::stiffness, TRUE, Tlink::type, Tlink::varLength, and Tlink::vID. Referenced by InitAxisXLink(), InitConnectLink(), InitDeformXLink(), InitNoRotLink(), InitPrismaticXLink(), InitWorldFromMolecule(), and main(). ◆ InitNoRotLink()
Initializes a link structure with no bodies. In this particular type of links the orientation of the link is not relevant. Up to now we only use this kink of links for tensegrities where the relevant information is in the connections between links and not in the links themselves. In principle NoRot links have to be in force equilibrium, except if it is explicitly de-activated (see NoForceEquilibriumLink)
Definition at line 781 of file link.c. References Tlink::forceEquilibrium, InitLink(), LINK_NoRot, TRUE, and Tlink::type. ◆ InitAxisXLink()
Initializes a link structure with no bodies. In this particular type of links only the X axis of the frame attached to the link is relevant for the problem. This is used, for instance, when defining composite links (e.g. spherical-spherical) where the internal rotation of the link is not relevant.
Definition at line 853 of file link.c. References CopyInterval(), Error(), FALSE, Tlink::force, Tlink::forceModel, InitLink(), IntervalSize(), Tlink::length, LINEAR_FORCE, LINK_AxisX, LowerLimit(), NewInterval(), NO_FORCE, Tlink::rest, Tlink::stiffness, Tlink::type, VAR_FORCE, Tlink::varLength, ZERO, and ZeroInterval(). Referenced by AddLeg2World(), and InitPrismaticXLink(). ◆ InitDeformXLink()
Initializes an axis X link that can elongate along the X axis (i.e., a deformable Axis X link).
Definition at line 895 of file link.c. References AdjustLinkForceParameters(), CopyInterval(), Error(), Tlink::force, Tlink::forceModel, InitLink(), IntervalSize(), Tlink::length, LINEAR_FORCE, LINK_DeformX, LowerLimit(), NewInterval(), NO_FORCE, Tlink::rest, Tlink::stiffness, TRUE, Tlink::type, UpperLimit(), VAR_FORCE, Tlink::varLength, ZERO, and ZeroInterval(). Referenced by AddLeg2World(). ◆ InitPrismaticXLink()
Initializes an axis X link that can extend along the X axis in a prismatic way. It can be seen as the same as a LINK_DeformX but here the deformation is an extension of a prismatic element.
Definition at line 954 of file link.c. References AdjustLinkForceParameters(), CopyInterval(), Error(), Tlink::force, Tlink::forceModel, InitAxisXLink(), InitLink(), IntervalSize(), Tlink::length, LINEAR_FORCE, LINK_PrismaticX, LowerLimit(), NewInterval(), NO_FORCE, Tlink::rest, Tlink::stiffness, TRUE, Tlink::type, UpperLimit(), VAR_FORCE, Tlink::varLength, ZERO, and ZeroInterval(). Referenced by AddLeg2World(). ◆ InitConnectLink()
Initializes a connection link: a cable, spring or leg connecting two different links.
Definition at line 1026 of file link.c. References AddBody2Link(), C_CABLE, C_LEG, C_SPRING, CopyInterval(), DECOR_SHAPE, DeletePolyhedron(), Error(), HIDDEN_SHAPE, InitLink(), Tlink::l1, Tlink::l2, LINK_Connect, NewCylinder(), NewSphere(), NewSpring(), Tlink::p1, Tlink::p2, Tlink::rest, Tlink::stiffness, and Tlink::type. ◆ CopyLink()Initializes a link copying the information from another link.
Definition at line 1113 of file link.c. References AddBody2Link(), Tlink::allSpheres, Tlink::axisID, Tlink::bodies, Tlink::c, CopyInterval(), CopyVoidPtr(), Tlink::csvID, DeleteVoidPtr(), Tlink::extForce, Tlink::fixedDim, Tlink::force, Tlink::forceEquilibrium, Tlink::forceModel, GetLinkBody(), HTransformCopy(), Tlink::iFrame, Tlink::iMatrix, INIT_NUM_SHAPES, InitVector(), Tlink::iR, Tlink::l1, Tlink::l2, Tlink::length, LinkNBodies(), Tlink::mass, Tlink::maxCoord, Tlink::name, NEW, Tlink::nvID, Tlink::p1, Tlink::p2, Tlink::R, Tlink::rest, Tlink::s, Tlink::stiffness, TRUE, Tlink::type, Tlink::varLength, and Tlink::vID. Referenced by AddLink2Mechanism(). ◆ SetLinkMass()
Sets the mass of the link. If set to 0, the dynamic information is reseted.
Definition at line 1196 of file link.c. References Error(), Tlink::mass, SetLinkInertialFrame(), and SetLinkInertiaMatrix(). ◆ SetLinkInertiaMatrix()
Sets the inertia matrix of the link.
Definition at line 1209 of file link.c. References Tlink::iMatrix. Referenced by SetLinkMass(). ◆ SetLinkInertialFrame()
Sets the inertial frame of the link, i.e., the transfrom from the link reference frame to the inertial reference frame. The inertial reference frame is centered at the center of mass of the link.
Definition at line 1223 of file link.c. References HTransformCopy(), HTransformIdentity(), and Tlink::iFrame. Referenced by SetLinkMass(). ◆ GetLinkMass()
Gives the mass of the link (0 if not set explicitly).
Definition at line 1231 of file link.c. References Tlink::mass. Referenced by InitHandC(), and main(). ◆ GetLinkInertiaMatrix()
Gives the (symmetric) inertia matrix of the link.
Definition at line 1236 of file link.c. References Tlink::iMatrix. Referenced by InitHandC(), and main(). ◆ GetLinkInertialFrame()
Gives the inertial frame of the link with respect to the link frame. This is the identity if not set explicity.
Definition at line 1241 of file link.c. References Tlink::iFrame. Referenced by InitHandC(), and main(). ◆ AddBody2Link()
Adds a body to the link.
Definition at line 1246 of file link.c. References Tlink::allSpheres, Tlink::bodies, CopyPolyhedron(), DECOR_SHAPE, EmptyPolyhedron(), Error(), GetPolyhedronMaxCoordinate(), GetPolyhedronStatus(), GetPolyhedronType(), LINK_NoRot, Tlink::maxCoord, NEW, NewVectorElement(), SPHERE, and Tlink::type. Referenced by AddBody2Mechanism(), AddLeg2World(), CopyLink(), InitConnectLink(), InitWorldFromMolecule(), and main(). ◆ AddForce2Link()
Adds an external force to a link. The force on the link is initalized to zero and several exteran forces can be added. Forces must be expressed in a global reference frame. This is only used in tensegrity structures. In other mechanisms this is not relevant at all.
Definition at line 1269 of file link.c. References Tlink::extForce. ◆ GetForceOnLink()
Retrives the force on a link as defined using AddForce2Link. This is only used in tensegrity structures. In other mechanisms this is not relevant at all.
Definition at line 1276 of file link.c. References Error(), and Tlink::extForce. Referenced by GenerateForceEquilibriumEquations(). ◆ NoForceEquilibriumLink()
Deactivates the force equilibrium on a link. It only has effect on links of type LINK_NoRot (which have not been previously deactivated)
Definition at line 1283 of file link.c. References FALSE, and Tlink::forceEquilibrium. ◆ IsForceEquilibriumLink()Identify links where forces must be in equilibrium (sum to 0, including external forces). Only some of the links in tensegrities are of this type.
Definition at line 1289 of file link.c. References Tlink::forceEquilibrium. Referenced by GenerateForceEquilibriumEquations(). ◆ SetLinkTrans()
Fixes one of the dimension of the translation of a link. This is only used in tensegrity structures. In other mechanisms this is not relevant at all.
Definition at line 1294 of file link.c. References Error(), and Tlink::fixedDim. ◆ GetLinkTrans()
Retives the one of the dimension of the translation of a link. This is only used in tensegrity structures. In other mechanisms this is not relevant at all.
Definition at line 1301 of file link.c. References Error(), and Tlink::fixedDim. Referenced by FixLinks(). ◆ GetLinkLength()The length of the link. Only defined for Axis X links.
Definition at line 1308 of file link.c. References Tlink::length. Referenced by PrintMechanism(). ◆ GetLinkStiffness()
Stiffness of the link. Only defined for some Axis X and Deform X links.
Definition at line 1313 of file link.c. References Error(), Tlink::forceModel, IsConnectionSpring(), LINEAR_FORCE, and Tlink::stiffness. ◆ GetLinkRest()The rest interval for a given link. It is a zero-size interval if the rest is a constant. This is only relevant for tensegrites and not used at all for mechanisms.
Definition at line 1321 of file link.c. References Error(), Tlink::forceModel, IsConnectionSpring(), LINEAR_FORCE, and Tlink::rest. ◆ GetLinkMaxForce()The maximum range for compression, tension forces for this link.
Definition at line 1329 of file link.c. References Error(), Tlink::force, Tlink::forceModel, and NO_FORCE. ◆ ChangeLinkReferenceFrame()
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 1336 of file link.c. References Tlink::c, Error(), HTransformSetElement(), Tlink::iR, LINK_FullRot, Tlink::R, REP_JOINTS, REP_QLINKS, Tlink::s, and Tlink::type. Referenced by InitWorldKinCS(). ◆ LinkNBodies()
Gets the number of convex parts of the link.
Definition at line 1422 of file link.c. References Tlink::bodies, and VectorSize(). Referenced by AddLink2Mechanism(), AddLink2World(), CopyLink(), DeleteLink(), GetLinkConfTransform(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), IsConnectionCable(), IsConnectionLeg(), IsConnectionSpring(), LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), main(), MoveLinkFromTransform(), PlotLink(), PrintLink(), VisibleLink(), and WorldAtomJacobian(). ◆ LinkNAtoms()
Gets the number of atoms (i.e., spheres) in a link.
Definition at line 1427 of file link.c. References GetLinkBody(), GetPolyhedronType(), LinkNBodies(), SPHERE, and VisibleLink(). Referenced by MechanismStoreRigidAtoms(). ◆ GetLinkBody()
Gets one of the convex parts of the link.
Definition at line 1448 of file link.c. References Tlink::bodies, and GetVectorElement(). Referenced by CopyLink(), DeleteLink(), GetMechanismDefiningPoint(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), IsConnectionCable(), IsConnectionLeg(), IsConnectionSpring(), LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), main(), MoveLinkFromTransform(), PlotLink(), PrintLink(), PrintMechanism(), VisibleLink(), and WorldAtomJacobian(). ◆ GetLinkBodyStatus()
Gets the status of one of the convex parts of the link.
Definition at line 1459 of file link.c. References Tlink::bodies, GetPolyhedronStatus(), GetVectorElement(), and NO_UINT. Referenced by InitPQPCD(), InitSolidCD(), and InitVcollideCD(). ◆ GetLinkName()
Gets the name of a link.
Definition at line 1470 of file link.c. References Tlink::name. Referenced by AddLink2World(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), GenerateJointRangeSingularityEquations(), GenerateJointSolution(), GenerateWorldSingularityEquations(), GetJointName(), GetJointTransSeq(), GetLinkID(), GetMechanismLinkID(), GetWorldDOFLabel(), JointForceEquation(), main(), PrintCollisionInfoInt(), PrintCollisions(), PrintJoint(), PrintMechanism(), RegenerateJointBox(), RegenerateJointSolution(), StoreCollisionInfoInt(), WorldDOF2Sol(), and WorldFixTensegrityAddon(). ◆ GetLinkType()
Gets the type of a link.
Definition at line 1475 of file link.c. References Tlink::type. Referenced by AddLink2Mechanism(), AddLink2World(), FixLinks(), FixZToZero(), GenerateKinTree(), GetLinkConfExtension(), GetLinkConfTransform(), GetLinkTransformsFromDOF(), GetLinkTransformsFromSolution(), InitJoint(), main(), NoCheckConnectedCollisions(), PrintMechanism(), WorldAtomJacobian(), and WorldCoupleTensegrityVariable(). ◆ IsVariableLengthLink()Used to determine wheter a link has variable length (up to now only Deform_X links have variable length).
Definition at line 1480 of file link.c. References Tlink::varLength. Referenced by EmptyLinkConf(), GetLinkTransformsFromDOF(), GetMechanismDOFsFromTransforms(), NewRevUpJoint(), NewSphSphUpJoint(), and WorldCoupleTensegrityVariable(). ◆ GetLinkForceModel()
Use to determine the force model of the link: NO_FORCE, VAR_FORCE, LINEAR_FORCE.
Definition at line 1485 of file link.c. References Tlink::forceModel. Referenced by GenerateForceEquilibriumEquations(), JointForceEquation(), and WorldCoupleTensegrityVariable(). ◆ GetLinkForceVars()
Get the identifiers of the force-related of the link, if any.
Definition at line 1490 of file link.c. References Error(), Tlink::forceModel, GetRotVarID(), LINEAR_FORCE, LINK_Connect, LINK_NoRot, MAX_ROT_VARS, NO_FORCE, NO_UINT, Tlink::type, and VAR_FORCE. Referenced by GenerateForceEquilibriumEquations(), and WorldCoupleTensegrityVariable(). ◆ LinkPotentialEnergy()
Evaluates the potential energy stored in the link. It only works for tensegrity related links with variable length. For other links the output is 0. Thus, we capture the potential energy in the springs, cables, and prismatic legs of tensegrity structures. This energy is somehow compensated by struts (i.e., the compressive elements with constant length). but we do not model this part. We assume that the energy of the struts comes "for free" as a reaction of the energy in the active elements (mainly cables). If the energy of the struts need to be taken into account too, just model the struts as prismatic legs (with low motion raange and high stiffness). Prismatic legs have an associated force model that can be used to compute the associated energy. In structures with struts, this energy function might not be in equilibrium (i.e., null gradient) in the valid tensegrity configurations.
Definition at line 1534 of file link.c. References Error(), Tlink::forceModel, GetRotVarID(), LINEAR_FORCE, MAX_ROT_VARS, NO_UINT, Tlink::stiffness, and Tlink::varLength. Referenced by WorldPotentialEnergy(). ◆ LinkForceField()
Evaluates the gradient of the potential energy stored in the link. It only works for tensegrity related links. For other links the output is a null vector. IMPORTANT: see the notes in LinkPotentialEnergy
Definition at line 1560 of file link.c. References Error(), Tlink::forceModel, GetRotVarID(), LINEAR_FORCE, MAX_ROT_VARS, NO_UINT, Tlink::stiffness, and Tlink::varLength. Referenced by WorldForceField(). ◆ GetLinkTransSeq()
Build the sequence of transforms traversing the link. Only has effects for deformable links since in them the shape and thus the transform tot traverse them varies with the configuration. Note that here we accumulate homogeneous transform traversing the deformable link. This is NOT the the non-homogeneous transform used to model the link deformation.
Definition at line 1579 of file link.c. References AddVarTrans2TransSeq(), Error(), GetCSVariableID(), InitTransSeq(), LINK_LENGTH, Tlink::name, NEW, NO_UINT, TX, and Tlink::varLength. Referenced by GenerateMEquationFromBranch(). ◆ GetLinkTransform()
Builds the homogeneous transform traversing the link. This only works for deformable links since in them the shape and thus the transform tot traverse them varies with the configuration. This is like GetLinkTransSeq but here the transform is constant instead of symbolic.
Definition at line 1600 of file link.c. References HTransformIdentity(), HTransformTx(), and Tlink::varLength. Referenced by GetLinkTransformFromConf(), and GetLinkTransformsFromDOF(). ◆ GetLinkTransformFromConf()
The same as GetLinkTransform but here the degrees of freedom are taken from the information stored in a link deformation structure.
Definition at line 1608 of file link.c. References GetLinkTransform(), and TLinkConf::p. Referenced by GetMechanismDOFsFromTransforms(). ◆ GetLinkConfFromSolution()
Defines a link configuration from the a solution point. This sets the link configuration from the solution. For the reverse see GenerateSolutionFromLinkConf
Definition at line 1613 of file link.c. References Tlink::forceModel, GetRotVarID(), TLinkConf::l, LINEAR_FORCE, MAX_ROT_VARS, TLinkConf::ndp, NEW, NO_FORCE, NumLinkDOF(), TLinkConf::p, and Tlink::varLength. Referenced by GetTransform2Link(). ◆ GetLinkConfFromDOF()Defines a link configuration from an array of degrees of freedom. This sets the link configuration from the dof. For the reverse see GenerateDOFFromLinkConf.
Definition at line 1645 of file link.c. References Tlink::forceModel, TLinkConf::l, LINEAR_FORCE, TLinkConf::ndp, NEW, NO_FORCE, NumLinkDOF(), TLinkConf::p, and Tlink::varLength. Referenced by GetLinkTransformsFromDOF(). ◆ GenerateSolutionFromLinkConf()
Sets the solution entries corresponding to the link configuration. This sets the solution from the link configuration. For the reverse see GetLinkConfFromSolution.
Definition at line 1673 of file link.c. References Error(), Tlink::forceModel, GetRotVarID(), TLinkConf::l, LINEAR_FORCE, MAX_ROT_VARS, NO_FORCE, NumLinkDOF(), TLinkConf::p, and Tlink::varLength. Referenced by GenerateLinkSolution(). ◆ GenerateDOFFromLinkConf()Sets the dof entries corresponding to the link configuration. This sets the dof from the link configuration. For the reverse see GetLinkConfFromDOF.
Definition at line 1702 of file link.c. References Error(), TLinkConf::l, TLinkConf::ndp, and TLinkConf::p. Referenced by GetMechanismDOFsFromTransforms(). ◆ NumLinkDOF()
Definition at line 1711 of file link.c. References Tlink::forceModel, LINEAR_FORCE, VAR_FORCE, and Tlink::varLength. Referenced by GenerateSolutionFromLinkConf(), GetLinkConfFromDOF(), GetLinkConfFromSolution(), GetLinkDOFLabel(), GetLinkDOFRange(), GetMechanismDOFsFromTransforms(), and WorldInitDOFInfo(). ◆ GetLinkDOFRange()Returns a given link DOF range.
Definition at line 1721 of file link.c. References Error(), Tlink::force, Tlink::length, NumLinkDOF(), Tlink::rest, and Tlink::varLength. Referenced by GetWorldRangeDOF(). ◆ GetLinkDOFLabel()
Creates a string with a label for a configuration parameter. This is used to create interfaces.
Definition at line 1756 of file link.c. References Error(), NEW, NumLinkDOF(), and Tlink::varLength. Referenced by GetWorldDOFLabel(). ◆ IsLinkAllSpheres()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 1791 of file link.c. References Tlink::allSpheres. Referenced by AddBody2Mechanism(), and AddLink2Mechanism(). ◆ SetPoseVars()
Sets to TRUE the translations/rotation variables for the given link in the given array of variables.
Definition at line 1796 of file link.c. References SetRotVars(), and SetTransVars(). ◆ SetForceVars()
Sets to TRUE the force variables for the given link in the given array of variables.
Definition at line 1802 of file link.c. References Tlink::forceModel, GetRotVarID(), MAX_ROT_VARS, NO_FORCE, and TRUE. Referenced by WorldForceVars(). ◆ SetForceRelatedVars()
Sets to TRUE the force and rest-length variables, i.e., the variables without a geometric impact. It is like SetForceVars but the rest-length variable is also set, if necesary.
Definition at line 1820 of file link.c. References Tlink::forceModel, GetRotVarID(), LINEAR_FORCE, MAX_ROT_VARS, NO_FORCE, and TRUE. Referenced by WorldSimpKinematicVars(). ◆ GetLinkPoseSimpVars()
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 2114 of file link.c. References CT_REPRESENTATION, Error(), GetCSVariableName(), GetParameter(), GetRotVarID(), IsSystemVarInSimpCS(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, MAX_ROT_VARS, NO_UINT, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, TRUE, and Tlink::type. Referenced by GetWorldSimpVariableMask(). ◆ GenerateLinkRot()
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 2173 of file link.c. References CT_REPRESENTATION, Error(), GenerateLinkConf(), GenerateLinkRotAxisX(), GenerateLinkRotFLinks(), GenerateLinkRotLinks(), GenerateLinkRotQLinks(), GetParameter(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, and Tlink::type. Referenced by InitWorldKinCS(). ◆ FixLinkZToZero()
Fixes the Z compoment of the vector giving the pose of the link. This only works for links represented by a single vector (i.e., AxisX, DeforX, PrismaticX links) and when the representation is not REP_JOINTS)
Definition at line 2639 of file link.c. References AddEquation2CS(), AddMonomial(), AddVariable2Monomial(), CT_REPRESENTATION, DeleteEquation(), DeleteMonomial(), EQU, Error(), GetParameter(), GetRotVarID(), InitEquation(), InitMonomial(), IsGroundLink, LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_PrismaticX, MAX_ROT_VARS, NFUN, REP_JOINTS, SetEquationCmp(), SetEquationType(), SetEquationValue(), SYSTEM_EQ, and Tlink::type. Referenced by FixZToZero(). ◆ ApplyLinkRot()
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 2678 of file link.c. References ApplyLinkRotAxisX(), ApplyLinkRotDeformX(), ApplyLinkRotFLinks(), ApplyLinkRotLinks(), ApplyLinkRotQLinks(), CT_REPRESENTATION, Error(), GetParameter(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, Norm(), REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, TRUE, Tlink::type, and ZERO. Referenced by ApplyLinkRotNoDeform(), ApplyLinkRotVar(), GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), and WorldFixTensegrityAddon(). ◆ ApplyLinkRotNoDeform()
Version of ApplyLinkRot for deformable links where the deformation is not considered. For non-deformable links this is the same as ApplyLinkRot. This can also be seen as a ApplyLinkRot for a deformable links with a particular deformation status (i.e., a default deformation) that is given in the 'sf' and 'sv' parameters.
Definition at line 2738 of file link.c. References ApplyLinkRot(), ApplyLinkRotAxisX(), and Tlink::varLength. Referenced by JointForceEquation(). ◆ ApplyLinkRotVar()
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 3121 of file link.c. References ApplyLinkRot(), CT_REPRESENTATION, DeleteEquation(), Error(), GetParameter(), GetRotVarID(), InitEquation(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, MAX_ROT_VARS, NO_UINT, Tlink::R, REP_JOINTS, Tlink::type, VarAccumulateEquations(), VarScaleEquation(), and ZERO. ◆ RegenerateLinkSolution()
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 or force variables too. This function computes the values for the link-related non-basic variables form the basic ones for a given link.
Definition at line 3228 of file link.c. References CT_REPRESENTATION, Error(), GetParameter(), LINK_FullRot, RegenerateLinkSolutionConf(), RegenerateLinkSolutionLinks(), RegenerateLinkSolutionQLinks(), REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, and Tlink::type. Referenced by RegenerateMechanismSolution(). ◆ RegenerateLinkBox()
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 3310 of file link.c. References CT_REPRESENTATION, Error(), GetParameter(), LINK_FullRot, RegenerateLinkBoxConf(), RegenerateLinkBoxLinks(), RegenerateLinkBoxQLinks(), REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, and Tlink::type. Referenced by RegenerateMechanismBox(). ◆ GetTransform2Link()
Returns the homogeneous transform with the position and orientation of the link for a given solution point.
Definition at line 3415 of file link.c. References CT_REPRESENTATION, Error(), GetLinkConfFromSolution(), GetParameter(), GetTransform2LinkAxisX(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), HTransformTxyz(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, and Tlink::type. Referenced by GetLinkTransformsFromSolution(), and PrintJointAxes(). ◆ GetTransform2ConnectionLink()
Computes the transform to a connectin link given the transforms to the normal links.
Definition at line 3461 of file link.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, CrossProduct(), DefineNormalVector(), DifferenceVector(), Error(), HTransformApply(), HTransformIdentity(), HTransformSetElement(), TLinkConf::l, Tlink::l1, Tlink::l2, LINK_Connect, TLinkConf::ndp, Norm(), Normalize(), TLinkConf::p, Tlink::p1, Tlink::p2, and Tlink::type. Referenced by GetLinkTransformsFromDOF(), and GetLinkTransformsFromSolution(). ◆ GetConnectionLinkWrench()
Computes the wrench exerced by a spring on the connected links. For connection links that are not springs, the output wrenches are zero.
Definition at line 3497 of file link.c. References CrossProduct(), DifferenceVector(), Error(), HTransformApply(), IntervalCenter(), IsConnectionSpring(), Tlink::l1, Tlink::l2, LINK_Connect, Norm(), Tlink::p1, Tlink::p2, Tlink::rest, ScaleVector(), Tlink::stiffness, and Tlink::type. Referenced by ApplyExternalForces(). ◆ GetConnectionLinkPotentialEnergy()
This is a generalization of LinkPotentialEnergy which works in general (not only for tensegrity structures). It is used when computing the potential (mechanical) energy of a dynamical system.
Definition at line 3548 of file link.c. References DifferenceVector(), HTransformApply(), IntervalCenter(), IsConnectionSpring(), Tlink::l1, Tlink::l2, LINK_Connect, Norm(), Tlink::p1, Tlink::p2, Tlink::rest, Tlink::stiffness, and Tlink::type. Referenced by MechEnergy(). ◆ GenerateLinkSolution()
Generate the solution variables form an homogenous transform giving the pose of the link and the internal link configuration.
Definition at line 3743 of file link.c. References CT_REPRESENTATION, Error(), GenerateLinkSolutionAxisX(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateLinkSolutionQLinks(), GenerateSolutionFromLinkConf(), GetParameter(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_FullRot, LINK_NoRot, LINK_PrismaticX, REP_FLINKS, REP_JOINTS, REP_LINKS, REP_QLINKS, and Tlink::type. Referenced by WorldDOF2Sol(). ◆ IsConnectionCable()Identifies connection cables.
Definition at line 3883 of file link.c. References CYLINDER, GetLinkBody(), GetPolyhedronType(), LINK_Connect, LinkNBodies(), and Tlink::type. Referenced by PrintLink(). ◆ IsConnectionSpring()Identifies connection springs.
Definition at line 3890 of file link.c. References GetLinkBody(), GetPolyhedronType(), LINK_Connect, LinkNBodies(), SEGMENTS, and Tlink::type. Referenced by ApplyExternalForces(), GetConnectionLinkPotentialEnergy(), GetConnectionLinkWrench(), GetLinkRest(), GetLinkStiffness(), InitHandC(), MechEnergy(), and PrintLink(). ◆ IsConnectionLeg()Identifies connection legs.
Definition at line 3897 of file link.c. References CYLINDER, GetLinkBody(), GetPolyhedronType(), LINK_Connect, LinkNBodies(), SPHERE, and Tlink::type. Referenced by PrintLink(). ◆ GetConnectLinkFrom()
Returns the first link connected by a connection link.
Definition at line 3906 of file link.c. References Error(), Tlink::l1, LINK_Connect, and Tlink::type. Referenced by ApplyExternalForces(), and PrintMechanism(). ◆ GetConnectLinkTo()
Returns the second link connected by a connection link.
Definition at line 3914 of file link.c. References Error(), Tlink::l2, LINK_Connect, and Tlink::type. Referenced by ApplyExternalForces(), and PrintMechanism(). ◆ GetConnectLinkPointFrom()
Returns the point on the first link connected by a connection link.
Definition at line 3922 of file link.c. References Error(), LINK_Connect, Tlink::p1, and Tlink::type. ◆ GetConnectLinkPointTo()
Returns the point on the second link connected by a connection link.
Definition at line 3933 of file link.c. References Error(), LINK_Connect, Tlink::p2, and Tlink::type. ◆ VisibleLink()Checks if a links has some visible parts, i.e., if not all the parts of the link are HIDDEN.
Definition at line 3944 of file link.c. References FALSE, GetLinkBody(), GetPolyhedronStatus(), HIDDEN_SHAPE, LINK_NoRot, LinkNBodies(), and Tlink::type. Referenced by LinkNAtoms(), LinkPrintAtoms(), LinkStoreAtoms(), MoveLinkFromTransform(), and PlotLink(). ◆ GetLinkMaxCoordinate()
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 3963 of file link.c. References Tlink::maxCoord. Referenced by AddBody2Mechanism(), and AddLink2Mechanism(). ◆ LinkPrintAtoms()
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 3968 of file link.c. References GetLinkBody(), LinkNBodies(), PolyhedronPrintCenter(), and VisibleLink(). Referenced by MechanismPrintAtoms(). ◆ LinkStoreAtoms()
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 3985 of file link.c. References GetLinkBody(), LinkNBodies(), PolyhedronPrintCenterAndRadius(), and VisibleLink(). Referenced by MechanismStoreRigidAtoms(). ◆ PlotLink()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 4002 of file link.c. References Tlink::axisID, Close3dObject(), DeleteColor(), GetLinkBody(), LINK_AxisX, LINK_Connect, LINK_DeformX, LINK_PrismaticX, LinkNBodies(), NewColor(), NO_UINT, PlotPolyhedron(), PlotVect3d(), StartNew3dObject(), Tlink::type, and VisibleLink(). Referenced by PlotMechanism(). ◆ MoveLinkFromTransform()
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 4038 of file link.c. References Tlink::axisID, EmptyLinkConf(), GetLinkBody(), GetLinkConfTransform(), HTransformDelete(), HTransformProduct(), LinkNBodies(), Move3dObject(), MovePolyhedron(), NO_UINT, and VisibleLink(). Referenced by MoveMechanismFromTransforms(). ◆ PrintLink()
Stores the link information into a file in the format valid to be read by InitWorldFromFile.
Definition at line 4075 of file link.c. References DECOR_SHAPE, Error(), FALSE, GetBlue(), GetGreen(), GetLinkBody(), GetPolyhedronGranularity(), GetPolyhedronRadius(), GetPolyhedronStatus(), GetRed(), HIDDEN_SHAPE, HTransformIsIdentity(), HTransformPrettyPrint(), Tlink::iFrame, Tlink::iMatrix, IntervalCenter(), IsConnectionCable(), IsConnectionLeg(), IsConnectionSpring(), LINK_Connect, LINK_FullRot, LinkNBodies(), Tlink::mass, Tlink::name, NEW, NORMAL_SHAPE, Tlink::p1, Tlink::p2, PrintPolyhedron(), Tlink::rest, SetPolyhedronColor(), Tlink::stiffness, TrivialInertiaMatrix(), TRUE, and Tlink::type. Referenced by PrintMechanism(). ◆ DeleteLink()
Deletes the information stored in a link and frees the allocated memory.
Definition at line 4239 of file link.c. References Tlink::bodies, Tlink::csvID, DeleteInterval(), DeletePolyhedron(), DeleteVector(), FALSE, Tlink::force, Tlink::forceModel, GetLinkBody(), HTransformDelete(), Tlink::iMatrix, Tlink::iR, Tlink::length, LinkNBodies(), Tlink::name, NO_FORCE, Tlink::nvID, Tlink::R, Tlink::rest, Tlink::stiffness, Tlink::varLength, and Tlink::vID. Referenced by AddLeg2World(), DeleteMechanism(), InitWorldFromMolecule(), and main(). |
Follow us!