Detailed DescriptionModule to manage homogeneous transforms in R^3 used to manipulated 3D geometry.
Definition in file htransform.h.
Macro Definition Documentation
Dimensions of R^3.
Definition at line 27 of file htransform.h. Referenced by AccumulateEqVectors(), AccumulateVector2EqVector(), CopyEqVector(), DeleteEqVector(), DotProductEqVectors(), EqVectorFromVector(), EvaluateEqVector(), EvaluateEqVectorInt(), GetEqVectorElement(), HTransformAdd(), HTransformApply(), HTransformApplyRot(), HTransformPrint(), HTransformPrintT(), HTransformProduct(), HTransformTranspose(), InitEqVector(), PrintTransSeq(), ScaleEqVector(), SHTransformAdd(), SHTransformApply(), SHTransformApplyRot(), SHTransformCopy(), SHTransformDelete(), SHTransformEvaluate(), SHTransformFromEqVectors(), SHTransformInit(), SHTransformInverse(), SHTransformPostCtProduct(), SHTransformPreCtProduct(), SHTransformPrint(), SHTransformProduct(), SHTransformTranspose(), Var2AccumulateVector2EqVector(), VarAccumulateEqVectors(), VarAccumulateVector2EqVector(), and VarScaleEqVector().
One of the types of homogeneous transforms in R^3: Translation along X.
Definition at line 35 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointTransSeq(), HTransformCreate(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the types of homogeneous transforms in R^3: Translation along Y.
Definition at line 43 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), HTransformCreate(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the types of homogeneous transforms in R^3: Translation along Z.
Definition at line 51 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), HTransformCreate(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the types of homogeneous transforms in R^3: Rotation about X.
Definition at line 59 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointTransform(), GetJointTransSeq(), HasRotations(), HTransformAcumRot(), HTransformCreate(), HTransformYawPitchRoll(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the types of homogeneous transforms in R^3: Rotation about Y.
Definition at line 67 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointTransSeq(), HasRotations(), HTransformAcumRot(), HTransformCreate(), HTransformYawPitchRoll(), MoveJointFromTransforms(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the types of homogeneous transforms in R^3: Rotation about Z.
Definition at line 75 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointTransform(), GetJointTransSeq(), HasRotations(), HTransformAcumRot(), HTransformCreate(), MoveJointFromTransforms(), PrintTransSeq(), RecomputeScalarEquations(), SHTransformCreate(), SHTransformVarCreate(), and UpdateUsedDOF().
One of the axis of R^3.
Definition at line 83 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointDOFValues(), GetYawPitchRoll(), HTransformAcumRot(), HTransformAcumTrans(), HTransformFromVectors(), HTransformInverse(), HTransformIsTranslation(), HTransformPrettyPrint(), HTransformRy(), HTransformRy2(), HTransformRz(), HTransformRz2(), HTransformScale(), HTransformScaleX(), HTransformTx(), HTransformTxyz(), RecomputeScalarEquations(), SHTransformFromEqVectors(), SHTransformRy(), SHTransformRz(), SHTransformTx(), SHTransformTxyz(), SHTransformVarDisplacementAlongVector(), SHTransformVarRx(), SHTransformVarRy(), SHTransformVarRz(), SHTransformVarTx(), and SHTransformVarTxyz().
One of the axis of R^3.
Definition at line 91 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointDOFValues(), GetYawPitchRoll(), HTransformAcumRot(), HTransformAcumTrans(), HTransformFromVectors(), HTransformInverse(), HTransformIsTranslation(), HTransformPrettyPrint(), HTransformRx(), HTransformRx2(), HTransformRz(), HTransformRz2(), HTransformScale(), HTransformScaleY(), HTransformTxyz(), HTransformTy(), RecomputeScalarEquations(), SHTransformFromEqVectors(), SHTransformRx(), SHTransformRz(), SHTransformTxyz(), SHTransformTy(), SHTransformVarDisplacementAlongVector(), SHTransformVarRx(), SHTransformVarRy(), SHTransformVarRz(), SHTransformVarTxyz(), and SHTransformVarTy().
One of the axis of R^3.
Definition at line 99 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointDOFValues(), GetYawPitchRoll(), HTransformAcumRot(), HTransformAcumTrans(), HTransformFromVectors(), HTransformInverse(), HTransformIsTranslation(), HTransformPrettyPrint(), HTransformRx(), HTransformRx2(), HTransformRy(), HTransformRy2(), HTransformScale(), HTransformScaleZ(), HTransformTxyz(), HTransformTz(), RecomputeScalarEquations(), SHTransformFromEqVectors(), SHTransformRx(), SHTransformRy(), SHTransformTxyz(), SHTransformTz(), SHTransformVarDisplacementAlongVector(), SHTransformVarRx(), SHTransformVarRy(), SHTransformVarRz(), SHTransformVarTxyz(), and SHTransformVarTz().
The 4-th dimension used to represent rotations with a lineal mapping.
Definition at line 108 of file htransform.h. Referenced by DeriveTransSeq(), EvaluateTransSeq(), GetJointDOFValues(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), HTransform2GLMatrix(), HTransformAcumRot(), HTransformAcumTrans(), HTransformApply(), HTransformFromGLMatrix(), HTransformFromVectors(), HTransformGetElement(), HTransformInverse(), HTransformOrthonormalize(), HTransformPrettyPrint(), HTransformSetElement(), HTransformTx(), HTransformTxyz(), HTransformTy(), HTransformTz(), PQPTest(), RecomputeScalarEquations(), SetTranslationMEquation(), SHTransformApply(), SHTransformFromEqVectors(), SHTransformGetElement(), SHTransformIdentity(), SHTransformInverse(), SHTransformTx(), SHTransformTxyz(), SHTransformTy(), SHTransformTz(), SHTransformVarDisplacementAlongVector(), SHTransformVarRx(), SHTransformVarRy(), SHTransformVarRz(), SHTransformVarTx(), SHTransformVarTxyz(), SHTransformVarTy(), SHTransformVarTz(), and WorldDOF2Sol(). Typedef Documentation
A 4x4 matrix typically representing a homogenous matrix in R^3. This is also used to represent generic 4x4 matrices sometimes. Therefor operations do not assume any structure in the matrix.
Definition at line 129 of file htransform.h. Function Documentation
Initializes a homogeneous transform with the identity matrix.
Definition at line 69 of file htransform.c. References MATRIX_INT_COPY. Referenced by CDCallBackInfo(), EvaluateTransSeq(), GetLinkTransformsFromDOF(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), GetTransformFromBranch(), HTransformX2Vect(), InitJoint(), InitLink(), InitMEquation(), InitSolidCD(), main(), NewInPatchJoint(), ResetMEquation(), SHTransformEvaluate(), and SolidCorrection().
Initializes a homogeneous transform with the zero matrix.
Definition at line 75 of file htransform.c. References MATRIX_INT_COPY. Referenced by DeriveMEquation(), and DeriveTransSeq().
Initializes a homogeneous transform from another transform.
Definition at line 83 of file htransform.c. References MATRIX_INT_COPY. Referenced by CDCallBackInfo(), CheckCollisionSolid(), CopyJoint(), CopyLink(), CopyMEquation(), CopyTrans(), GetJointDOFValues(), GetJointTransform(), InitCtTrans(), and NewFixJoint().
Identifies identity matrix (up to a tiny error).
Definition at line 91 of file htransform.c. References Distance(), and ZERO. Referenced by AddCtTrans2TransSeq(), AddDispTrans2TransSeq(), AddPatchTrans2TransSeq(), AddTrans2TransSeq(), AddVarTrans2TransSeq(), HTransformPrettyPrint(), PrintMEquation(), PrintTransSeq(), SolidCorrection(), and TransformPolyhedron().
Identifies translation matrices (up to a tiny error), i.e., it does not include any rotation. It returns TRUE also for the identity (no rotation and no translation).
Definition at line 96 of file htransform.c. References AXIS_X, AXIS_Y, AXIS_Z, and ZERO. Referenced by HasCtRotTransSeq(), and HTransformPrettyPrint().
Initializes a homogeneous transform as a translation along X.
Definition at line 106 of file htransform.c. References AXIS_H, AXIS_X, and MATRIX_INT_COPY. Referenced by GetJointDOFValues(), GetJointTransform(), GetJointTransSeq(), HTransformCreate(), and main().
Initializes a homogeneous transform as a translation along Y.
Definition at line 117 of file htransform.c. References AXIS_H, AXIS_Y, and MATRIX_INT_COPY. Referenced by HTransformCreate(), main(), and SolidCorrection().
Initializes a homogeneous transform as a translation along Z.
Definition at line 128 of file htransform.c. References AXIS_H, AXIS_Z, and MATRIX_INT_COPY. Referenced by HTransformCreate(), and main().
Initializes a homogeneous transform as a translation.
Definition at line 140 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, and MATRIX_INT_COPY. Referenced by GenerateSphereOFF(), GetJointTransform(), HTransformX2Vect(), main(), NewPrismaticJoint(), NewSphericalJoint(), NewSphPrsSphJoint(), NewSphSphJoint(), and SolidCorrection().
Initializes a homogeneous transform as a rotation about X.
Definition at line 155 of file htransform.c. References AXIS_Y, AXIS_Z, and MATRIX_INT_COPY. Referenced by GetJointTransform(), HTransformCreate(), main(), NewRevoluteJoint(), and NewUniversalJoint().
Initializes a homogeneous transform as a rotation about Y.
Definition at line 172 of file htransform.c. References AXIS_X, AXIS_Z, and MATRIX_INT_COPY. Referenced by GetJointTransform(), HTransformCreate(), HTransformX2Vect(), and main().
Initializes a homogeneous transform as a rotation about Z.
Definition at line 189 of file htransform.c. References AXIS_X, AXIS_Y, and MATRIX_INT_COPY. Referenced by GenerateSphereOFF(), GetJointTransform(), HTransformCreate(), HTransformX2Vect(), HTransformYawPitchRoll(), and main().
Initializes a homogeneous transform as a rotation about X.
Definition at line 206 of file htransform.c. References AXIS_Y, AXIS_Z, and MATRIX_INT_COPY. Referenced by EvaluateTransSeq(), and GetJointTransSeq().
Initializes a homogeneous transform as a rotation about Y.
Definition at line 216 of file htransform.c. References AXIS_X, AXIS_Z, and MATRIX_INT_COPY. Referenced by EvaluateTransSeq().
Initializes a homogeneous transform as a rotation about Z.
Definition at line 226 of file htransform.c. References AXIS_X, AXIS_Y, and MATRIX_INT_COPY. Referenced by EvaluateTransSeq(), GetJointTransSeq(), and SolidCorrection().
Initializes a homogeneous transform as a scale matrix.
Definition at line 233 of file htransform.c. References AXIS_X, AXIS_Y, AXIS_Z, and MATRIX_INT_COPY. Referenced by main().
Initializes a homogeneous transform as a scale matrix along the X axis.
Definition at line 243 of file htransform.c. References AXIS_X, and MATRIX_INT_COPY. Referenced by main().
Initializes a homogeneous transform as a scale matrix along the Y axis.
Definition at line 251 of file htransform.c. References AXIS_Y, and MATRIX_INT_COPY. Referenced by main().
Initializes a homogeneous transform as a scale matrix along the Z axis.
Definition at line 259 of file htransform.c. References AXIS_Z, and MATRIX_INT_COPY. Referenced by main().
Initializes a homogeneous transform as translation/rotation in a given degree of freedom.
Definition at line 272 of file htransform.c. References Error(), HTransformRx(), HTransformRy(), HTransformRz(), HTransformTx(), HTransformTy(), HTransformTz(), RX, RY, RZ, TX, TY, and TZ.
Sets an element in a homogeneous transform. Note that if the element value is not carefully computed the result of using this function could not be an homogeneous matrix anymore (recall that the 3x3 top left sub-matrix must be orthonormal).
Definition at line 306 of file htransform.c. References AXIS_H, and Error(). Referenced by ChangeLinkReferenceFrame(), DeriveTransSeq(), EvaluateTransSeq(), GetJointDOFValues(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), HTransformX2Vect(), main(), and SHTransformEvaluate().
Gets an element from a homogeneous transform.
Definition at line 323 of file htransform.c. References AXIS_H, and Error(). Referenced by EvaluateMEquation(), GenerateJointEquations(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateLinkSolutionQLinks(), GetJointDOFValues(), NewFixJoint(), PQPTest(), PrintTransSeq(), SHTransformPostCtProduct(), SHTransformPreCtProduct(), and WorldDOF2Sol().
Defines a homogeneous transform from 4 vectors defining its columns. No check is performed to verify if the rotation part (x,y,z columns) is actually a rotation matrix.
Definition at line 335 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, and AXIS_Z. Referenced by Atoms2Transforms(), EvaluatePATrans(), EvaluateTransSeq(), GetJointDOFValues(), GetJointTransform(), NewRevoluteJoint(), and NewUniversalJoint().
Defines a homogeneous transform a la GL (colum-major) from our format of homogeneous transforms.
Definition at line 351 of file htransform.c. References AXIS_H. Referenced by CheckCollisionSolid(), and InitSolidCD().
The reverse of HTransform2GLMatrix.
Definition at line 373 of file htransform.c. References AXIS_H.
Product of two homogeneous transforms.
Definition at line 404 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. Referenced by AddCtTrans2TransSeq(), CheckCollisionSolid(), EvaluateTransSeq(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateSphereOFF(), GetJointDOFValues(), GetJointTransform(), GetLinkTransformsFromDOF(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransformFromBranch(), HTransformInverse(), HTransformX2Vect(), main(), MoveJointFromTransforms(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), SimplifyTransSeq(), and SolidCorrection().
Addition of two homogeneous transforms.
Definition at line 437 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY.
Addition of a homogeneous transform.
Definition at line 468 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, HTransformProduct(), and MATRIX_INT_COPY. Referenced by AddTrans2TransSeq(), EvaluatePATrans(), GetJointDOFValues(), GetJointTransform(), GetLinkTransformsFromDOF(), GetTransformFromBranch(), InitWorldFromMolecule(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewSphPrsSphJoint(), NewSphSphJoint(), NewUniversalJoint(), PrintCollisionInfoInt(), and TransInvert().
Orthonormalizes the rotation part of a homogenouos transform. This is to be used when we have an approximated homogeneous transform (for instance, a homogeneous transform that is derived after several floating point operations). If the rotation part is not orthonormal then the homogeneous transform is no longer a rigid transform (it produces deformations in the objects). Right now this is implemented in a simple way
An alternative implementation could be based in a SVD of the rotation matrix: after the decomposition the diagonal matrix of (squared) eigenvalues is set to the identity and the matrix is reconstucted. In this way we could avoid the bias of adjusting the matrix from the first column.
Definition at line 494 of file htransform.c. References AXIS_H, and MATRIX_INT_COPY. Referenced by GetTransform2LinkFLinks(), GetTransform2LinkLinks(), and GetTransform2LinkQLinks().
Computes the homogeneous matrix that transform a unitary vector along the X axis into a generic vector. The resulting transform includes, scaling, rotation and translation. This function is typically used when plotting cylinders. This is the reason to include scale factors in Y and Z (to deform the unitary cylinder along X with radii 1 so that we get the cylinder in the desired position and with the desired witdh, typically the same in Y and Z). The length is controlled by the start-end points of the cilynder.
Definition at line 539 of file htransform.c. References Error(), HTransformIdentity(), HTransformProduct(), HTransformRy(), HTransformRz(), HTransformSetElement(), HTransformTxyz(), and M_PI_2. Referenced by GenerateCylinderOFF(), GetJointDOFValues(), MoveJointFromTransforms(), NewInPatchJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), PlotCylinder(), and SolidCorrection().
Defines de rotation matrix resulting from R=Rz(a)Ry(b)Rx(c) This is the invers of GetYawPitchRoll.
Definition at line 590 of file htransform.c. References HTransformAcumRot(), HTransformRz(), RX, and RY. Referenced by main().
Recovers the Yaw, Pitch, and Roll angles from the rotation part of a homogeneous matrix, i.e., recovers the parameters such that Rz(a)Ry(b)Rx(c)=R with R the rotation part of the given transform. Note that in the expression Rz(a)Ry(b)Rx(c) we first apply the roll, then the pitch, and finally the yaw. The implementation uses the method taken from http://planning.cs.uiuc.edu/node103.html This is the inverse of HTransformYawPitchRoll
Definition at line 599 of file htransform.c. References AXIS_X, AXIS_Y, and AXIS_Z. Referenced by GetJointDOFValues(), and HTransformPrettyPrint().
Transpose of a homogeneous transform. Note that, in general the transpose of a homogeneous transform is not a homogeneous transform.
Definition at line 618 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. Referenced by EvaluateTransSeq().
Computes the result of multiplying a homogeneous transform by a translation matrix with parameters tx, ty, tz. The result is accumulated in the given transform.
Definition at line 641 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, and AXIS_Z. Referenced by EvaluateTransSeq(), HTransformAcumTrans2(), and MoveJointFromTransforms().
Computes the result of multiplying a homogeneous transform by a translation matrix with parameters tx, ty, tz. The result is accumulated in the given transform.
Definition at line 656 of file htransform.c. References HTransformAcumTrans(), and MATRIX_INT_COPY.
Computes the result of multiplying a homogeneous transform by a rotation matrix. The result is accumulated in the given transform.
Definition at line 673 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, Error(), RX, RY, and RZ. Referenced by EvaluateTransSeq(), GetJointTransform(), HTransformAcumRot2(), and HTransformYawPitchRoll().
Computes the result of multiplying a homogeneous transform by a rotation matrix.
Definition at line 716 of file htransform.c. References HTransformAcumRot(), and MATRIX_INT_COPY. Referenced by MoveJointFromTransforms().
Multiply a homogeneous transform and a vector.
Definition at line 728 of file htransform.c. References AXIS_H, and DIM_SP. Referenced by ApplyLinkRotFLinks(), ApplyLinkRotLinks(), BioWordGetAtomPositionsFromConformation(), EvaluateMEquationXVectors(), GenerateCylinderOFF(), GenerateJointSolution(), GenerateSphereOFF(), GetJointDOFValues(), InitWorldFromMolecule(), main(), MoveJointFromTransforms(), NewRevoluteJoint(), NewUniversalJoint(), PolyhedronPrintCenter(), PolyhedronPrintCenterAndCenter(), PrintCollisionInfoInt(), PrintJointAxes(), and TransformPolyhedron().
Applies the rotation encoded in a homogeneous transform to a vector (i.e., rotates the vector).
Definition at line 747 of file htransform.c. References DIM_SP. Referenced by EvaluateTransSeq(), GenerateJointSolution(), and PrintJointAxes().
Prints the a homogeneous transform to a stream that can be stdtout.
Definition at line 768 of file htransform.c. References DIM_SP. Referenced by Atoms2Transforms(), and StoreCollisionInfoInt().
Prints the transpose of a homogeneous transform to a stream that can be stdtout. This is implemented because computer graphics community use transposed homogeneous transforms and, consequently, this is how geomview requires the transforms to be printed.
Definition at line 794 of file htransform.c. References DIM_SP. Referenced by Move3dObject(), and PlotCylinder().
Prints a homogenoeus transform compactly using basic transforms, whenever possible.
Definition at line 809 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, GetYawPitchRoll(), HTransformIsIdentity(), and HTransformIsTranslation(). Referenced by PrintJoint().
Deletes the information stored in the THTransform and frees the allocated memory space.
Definition at line 833 of file htransform.c. Referenced by AddTrans2TransSeq(), BioWordConformationFromAtomPositions(), DeleteBioWorld(), DeleteJoint(), DeleteLink(), DeleteLinkTransforms(), DeleteMEquation(), DeleteSolidCD(), DeleteTrans(), DeriveTransSeq(), EvaluateMEquation(), EvaluateMEquationXVectors(), EvaluateTransSeq(), GenerateCylinderOFF(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateSphereOFF(), GetJointDOFValues(), GetJointTransform(), GetLinkTransformsFromDOF(), InitWorldFromMolecule(), main(), MoveJointFromTransforms(), NewRevoluteJoint(), NewUniversalJoint(), PlotCylinder(), and PrintCollisionInfoInt(). |
Follow us!