mechanism.h File Reference Detailed DescriptionDefinition of the Tmechanism type and the associated functions.
Definition in file mechanism.h.
Macro Definition Documentation
Initial room for links in a mechanisms. It will be enlarged if necessary.
Definition at line 28 of file mechanism.h. Referenced by InitMechanism().
Initial room for joints in a mechanisms. It will be enlarged if necessary.
Definition at line 36 of file mechanism.h. Referenced by CreateBranch(), and InitMechanism(). Function Documentation
Defines an empty mechanism.
Definition at line 16 of file mechanism.c. References Tmechanism::allSpheres, CopyVoidPtr(), DeleteVoidPtr(), INIT_NUM_JOINTS, INIT_NUM_LINKS, InitVector(), Tmechanism::joints, Tmechanism::links, Tmechanism::maxCoord, Tmechanism::nbodies, and TRUE. Referenced by InitWorld().
Gets the number of links of a mechanism.
Definition at line 25 of file mechanism.c. References Tmechanism::links, and VectorSize(). Referenced by AddLink2Mechanism(), DeleteMechanism(), GetLinkID(), GetMechanismMobility(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), MechanismPrintAtoms(), MechanismStoreRigidAtoms(), MoveMechanismFromTransforms(), PlotMechanism(), PrintMechanism(), RegenerateMechanismBox(), and RegenerateMechanismSolution().
Gets the number of joints of a mechanism.
Definition at line 30 of file mechanism.c. References Tmechanism::joints, and VectorSize(). Referenced by AddJoint2Mechanism(), AllRevolute(), DeleteMechanism(), GetMechanismDOFsFromTransforms(), GetMechanismMobility(), MoveMechanismFromTransforms(), PlotMechanism(), PrintMechanism(), RegenerateMechanismBox(), and RegenerateMechanismSolution().
Gets the number of convex sub-parts of a mechanism added all over the links of the mechanism.
Definition at line 35 of file mechanism.c. References Tmechanism::nbodies. Referenced by InitPQPCD(), InitSolidCD(), and InitVcollideCD().
Identifies mechanisms composed by spheres only. Mechanism derived from molecules are typically composed by spheres only and we can take advantage of this by implementing speciallzed collision detection precedures.
Definition at line 40 of file mechanism.c. References Tmechanism::allSpheres. Referenced by IsMechanismInWorldAllSpheres(), and WorldAtomJacobian().
Returns the sum of the maximum coordinate value for all the links and joints in the mechanism. This is used in higher levels to define an over-estimate bounding-box of the mechanism. This bounding box is used to define the ranges for some of the coordinate and separating planes variables.
Definition at line 45 of file mechanism.c. References Tmechanism::maxCoord. Referenced by GenerateWorldEquations().
Computes the degrees of freedom of a mechanism. The degrees of freedom are computed as 6 per link (but for the ground link) less the degrees of freedom reduced by the joints (6-the degrees of freedom of the joint given by GetJointDOF). Of course, this computation assumes that all link dimensions are general. For special link sizes/joint points the mechanisms can have more degrees of freedom than the returned by this function (i.e., the mechanism can be architecturally singular).
Definition at line 73 of file mechanism.c. References GetJointDOF(), GetMechanismJoint(), GetMechanismNJoints(), and GetMechanismNLinks(). Referenced by GetWorldMobility().
Gets a 3d point from the mechanism, i.e., from a convex body of a link of the mechanism. Note that identifier are numbered form 0.
Definition at line 88 of file mechanism.c. References GetLinkBody(), GetMechanismLink(), and GetPolyhedronDefiningPoint().
Adds a link to a mechanism.
Definition at line 94 of file mechanism.c. References Tmechanism::allSpheres, CopyLink(), GetLinkMaxCoordinate(), GetMechanismNLinks(), IsLinkAllSpheres(), LinkNBodies(), Tmechanism::links, Tmechanism::maxCoord, Tmechanism::nbodies, NEW, and SetVectorElement(). Referenced by AddLink2World().
Adds a joint to a mechanism.
Definition at line 111 of file mechanism.c. References Tmechanism::allSpheres, CopyJoint(), GetJointMaxCoordinate(), GetMechanismNJoints(), IsJointAllSpheres(), Tmechanism::joints, Tmechanism::maxCoord, NEW, and SetVectorElement(). Referenced by AddJoint2World(), and GenerateKinTree().
Adds a convex sub-part to a mechanism.
Definition at line 127 of file mechanism.c. References AddBody2Link(), Tmechanism::allSpheres, Error(), GetLinkMaxCoordinate(), GetMechanismLink(), IsLinkAllSpheres(), Tmechanism::maxCoord, and Tmechanism::nbodies.
Gets the identifier of a link given its name.
Definition at line 50 of file mechanism.c. References FALSE, GetLinkName(), GetMechanismLink(), GetMechanismNLinks(), NO_UINT, and TRUE. Referenced by GetWorldLinkID().
Gets a link given its identifier.
Definition at line 146 of file mechanism.c. References GetVectorElement(), and Tmechanism::links. Referenced by AddBody2Mechanism(), DeleteMechanism(), GenerateEquationsFromBranch(), GenerateKinTree(), GenerateWorldSingularityEquations(), GetLinkID(), GetLinkTransformsFromSolution(), GetMechanismDefiningPoint(), GetWorldLink(), GetWorldSimpVariableMask(), InitPQPCD(), InitSolidCD(), InitVcollideCD(), InitWorldKinCS(), MechanismPrintAtoms(), MechanismStoreRigidAtoms(), MoveMechanismFromTransforms(), PlotMechanism(), PrintCollisionInfoInt(), PrintCollisions(), PrintMechanism(), RegenerateMechanismBox(), RegenerateMechanismSolution(), StoreCollisionInfoInt(), WorldAtomJacobian(), and WorldDOF2Sol().
Gets a link identifier given its name.
Definition at line 157 of file mechanism.c. References FALSE, GetLinkName(), GetVectorElement(), Tmechanism::links, NO_UINT, TRUE, and VectorSize(). Referenced by GenerateWorldSingularityEquations().
Gets a joint given its identifier.
Definition at line 182 of file mechanism.c. References GetVectorElement(), and Tmechanism::joints. Referenced by AllRevolute(), Branches2Links(), DeleteMechanism(), GenerateKinTree(), GenerateWorldSingularityEquations(), GetLinkTransformsFromDOF(), GetMechanismDOFsFromTransforms(), GetMechanismMobility(), GetWorldDOFLabel(), GetWorldJoint(), GetWorldJointLabel(), GetWorldRangeDOF(), InitWorldKinCS(), IsRevoluteBinaryLink(), MoveMechanismFromTransforms(), PlotMechanism(), PrintMechanism(), PrintWorldAxes(), RegenerateMechanismBox(), RegenerateMechanismSolution(), WorldDOF2Sol(), and WorldInitDOFInfo().
Determines if all the joints in a mechanisms are revolute joints. In mechanisms that are all revolute-based and that have revolute binary links, the reference for some links are adjusted so that we get simpler equations. (see ChangeLinkReferenceFrame)
Definition at line 193 of file mechanism.c. References GetJointType(), GetMechanismJoint(), GetMechanismNJoints(), REV_JOINT, and TRUE. Referenced by InitWorldKinCS().
Adds a mechanism to a 3d scene. All convex parts of all links are added using the same frame of reference (i.e, the global one) and thus they will be displayed colliding unless they are moved.
Definition at line 209 of file mechanism.c. References Close3dBlock(), GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), PlotJoint(), PlotLink(), and Start3dBlock(). Referenced by PlotWorld().
Solution points only include values for the system 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 all the links in the mechanism.
Definition at line 242 of file mechanism.c. References GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), IsGroundLink, RegenerateJointSolution(), and RegenerateLinkSolution(). Referenced by GetLinkTransformsFromSolutionPoint(), MoveWorld(), PrintWorldAxes(), RegenerateWorldOriginalPoint(), RegenerateWorldSolutionPoint(), and WorldSample2DOF().
This is the same as RegenerateMechanismSolution but it works in solution boxes instead of on solution points (i.e. it is interval-based instead of floating point based).
Definition at line 267 of file mechanism.c. References CT_REPRESENTATION, GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), GetParameter(), IsGroundLink, RegenerateJointBox(), RegenerateLinkBox(), and REP_JOINTS.
Obtains the value of the degrees of freedom given the poses for all links.
Definition at line 298 of file mechanism.c. References GetJointDOF(), GetJointDOFValues(), GetMechanismJoint(), GetMechanismNJoints(), JointFromID(), and JointToID(). Referenced by GetSolutionPointFromLinkTransforms(), and WorldSample2DOF().
Stores the centers of the atoms in a mechanism. 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 320 of file mechanism.c. References GetMechanismLink(), GetMechanismNLinks(), and LinkPrintAtoms(). Referenced by WorldPrintAtoms().
Auxiliary function for WorldStoreRigidGroups. It basically stores the spheres giving its center and radius.
Definition at line 335 of file mechanism.c. References GetMechanismLink(), GetMechanismNLinks(), IsGroundLink, LinkNAtoms(), and LinkStoreAtoms(). Referenced by WorldStoreRigidGroups().
Displaces a mechanism previously added to a 3d scene to a given solution piont.
Definition at line 372 of file mechanism.c. References Close3dBlock(), GetJointDOF(), GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), JointFromID(), JointToID(), MoveJointFromTransforms(), MoveLinkFromTransform(), and Start3dBlock(). Referenced by MoveWorld(), and MoveWorldDOF().
Stores the link/joint information into a file in the format valid to be read by InitWorldFromFile.
Definition at line 414 of file mechanism.c. References GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), PrintJoint(), and PrintLink(). Referenced by PrintWorld().
Deletes the information stored in a mechanism and frees the allocated memory.
Definition at line 441 of file mechanism.c. References DeleteJoint(), DeleteLink(), DeleteVector(), GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), GetMechanismNLinks(), Tmechanism::joints, and Tmechanism::links. Referenced by DeleteWorld(). |
Follow us!