IntroductionImplementation of the functions to generate homogeneous transforms in R^3.
Definition in file htransform.c.
Macro Definition Documentation◆ MATRIX_INT_COPY
A fast way to copy one matrix (to) into another matrix(td)
Definition at line 63 of file htransform.c. Function Documentation◆ HTransformIdentity()
Initializes a homogeneous transform with the identity matrix.
Definition at line 69 of file htransform.c. References matrix_identity, and MATRIX_INT_COPY. Referenced by CDCallBackInfo(), EvaluateTransSeq(), FixVarInTransSeq(), GetJointBasicTransform(), GetLinkConfTransform(), GetLinkTransform(), GetLinkTransformsFromDOF(), GetTransform(), GetTransform2ConnectionLink(), GetTransform2LinkAxisX(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), GetTransformFromBranch(), HTransformX2Vect(), IdentityRHSMEquation(), InitHandC(), InitJoint(), InitLink(), InitMEquation(), InitSolidCD(), main(), NewInPatchJoint(), NewRevUpJoint(), NewSphSphUpJoint(), NumericDDTransSeq(), ReadGeneralMesh(), ResetMEquation(), SetLinkInertialFrame(), SHTransformEvaluate(), SolidCorrection(), and TNumericDTransSeq(). ◆ HTransformZero()
Initializes a homogeneous transform with the zero matrix.
Definition at line 75 of file htransform.c. References MATRIX_INT_COPY, and matrix_zero. Referenced by DeriveMEquation(), DeriveTransSeq(), EvaluateDDTrans(), EvaluateDTrans(), and ZeroRHSMEquation(). ◆ HTransformCopy()
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(), EvaluateTrans(), FixVarInTransSeq(), GetJointDOFValues(), GetJointPostT(), GetJointPreT(), GetJointTransform(), HandC(), InitCtTrans(), InitHandC(), InitLink(), main(), MechEnergy(), NewFixJoint(), and SetLinkInertialFrame(). ◆ HTransformIsIdentity()
Identifies identity matrix (up to a tiny error).
Definition at line 91 of file htransform.c. References Distance(), matrix_identity, and ZERO. Referenced by AddCtTrans2TransSeq(), AddDispTrans2TransSeq(), AddPatchTrans2TransSeq(), AddTrans2TransSeq(), AddVarTrans2TransSeq(), FixVarInTransSeq(), HTransformPrettyPrint(), PrintLink(), PrintMEquation(), PrintTransSeq(), SimplifyMEquation(), SimplifyTransSeq(), SolidCorrection(), and TransformPolyhedron(). ◆ HTransformIsZero()
Identifies the null matrix (up to a tiny error).
Definition at line 97 of file htransform.c. References Distance(), matrix_zero, and ZERO. Referenced by AccumulateMEquations(), FixVarInMEquation(), and ScaleMEquation(). ◆ HTransformIsTranslation()
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 102 of file htransform.c. References AXIS_X, AXIS_Y, AXIS_Z, and ZERO. Referenced by HasCtRotTransSeq(), and HTransformPrettyPrint(). ◆ HTransformTx()
Initializes a homogeneous transform as a translation along X.
Definition at line 112 of file htransform.c. References AXIS_H, AXIS_X, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateTrans(), GetLinkConfTransform(), GetLinkTransform(), HTransformCreate(), and main(). ◆ HTransformTy()
Initializes a homogeneous transform as a translation along Y.
Definition at line 123 of file htransform.c. References AXIS_H, AXIS_Y, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateTrans(), HTransformCreate(), main(), and SolidCorrection(). ◆ HTransformTz()
Initializes a homogeneous transform as a translation along Z.
Definition at line 134 of file htransform.c. References AXIS_H, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by body2SDF(), EvaluateTrans(), HTransformCreate(), and main(). ◆ HTransformTxyz()
Initializes a homogeneous transform as a translation.
Definition at line 146 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateTrans(), GenerateSphereOFF(), GetJointBasicTransform(), GetJointTransform(), GetTransform(), GetTransform2Link(), HTransformX2Vect(), NewPrismaticJoint(), NewRevLowJoint(), NewRevUpJoint(), NewSphericalJoint(), and SolidCorrection(). ◆ HTransformRx()
Initializes a homogeneous transform as a rotation about X.
Definition at line 161 of file htransform.c. References AXIS_Y, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateTrans(), GetJointBasicTransform(), GetJointTransform(), HTransformCreate(), main(), NewRevoluteJoint(), NewUniversalJoint(), and PrintTransSeq(). ◆ HTransformRy()
Initializes a homogeneous transform as a rotation about Y.
Definition at line 178 of file htransform.c. References AXIS_X, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by body2SDF(), EvaluateTrans(), GetJointTransform(), HTransformCreate(), HTransformX2Vect(), and main(). ◆ HTransformRz()
Initializes a homogeneous transform as a rotation about Z.
Definition at line 195 of file htransform.c. References AXIS_X, AXIS_Y, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateTrans(), GenerateSphereOFF(), GetJointTransform(), HTransformCreate(), HTransformX2Vect(), HTransformYawPitchRoll(), and main(). ◆ HTransformRx2()
Initializes a homogeneous transform as a rotation about X.
Definition at line 212 of file htransform.c. References AXIS_Y, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateDDTrans(), EvaluateDTrans(), EvaluateTrans(), GetJointBasicTransform(), and GetJointTransSeq(). ◆ HTransformRy2()
Initializes a homogeneous transform as a rotation about Y.
Definition at line 222 of file htransform.c. References AXIS_X, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateDDTrans(), EvaluateDTrans(), EvaluateTrans(), and GetJointBasicTransform(). ◆ HTransformRz2()
Initializes a homogeneous transform as a rotation about Z.
Definition at line 232 of file htransform.c. References AXIS_X, AXIS_Y, matrix_identity, and MATRIX_INT_COPY. Referenced by EvaluateDDTrans(), EvaluateDTrans(), EvaluateTrans(), GetJointBasicTransform(), GetJointTransSeq(), and SolidCorrection(). ◆ HTransformScale()
Initializes a homogeneous transform as a scale matrix.
Definition at line 239 of file htransform.c. References AXIS_X, AXIS_Y, AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by main(). ◆ HTransformScaleX()
Initializes a homogeneous transform as a scale matrix along the X axis.
Definition at line 249 of file htransform.c. References AXIS_X, matrix_identity, and MATRIX_INT_COPY. Referenced by GetLinkConfTransform(), and main(). ◆ HTransformScaleY()
Initializes a homogeneous transform as a scale matrix along the Y axis.
Definition at line 257 of file htransform.c. References AXIS_Y, matrix_identity, and MATRIX_INT_COPY. Referenced by main(). ◆ HTransformScaleZ()
Initializes a homogeneous transform as a scale matrix along the Z axis.
Definition at line 265 of file htransform.c. References AXIS_Z, matrix_identity, and MATRIX_INT_COPY. Referenced by main(). ◆ HTransformCreate()
Initializes a homogeneous transform as translation/rotation in a given degree of freedom.
Definition at line 278 of file htransform.c. References Error(), HTransformRx(), HTransformRy(), HTransformRz(), HTransformTx(), HTransformTy(), HTransformTz(), RX, RY, RZ, TX, TY, and TZ. ◆ HTransformSetElement()
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 312 of file htransform.c. References AXIS_H, and Error(). Referenced by ChangeLinkReferenceFrame(), DeriveTransSeq(), EvaluateDDTrans(), EvaluateDTrans(), EvaluateTrans(), GetJointDOFValues(), GetTransform2ConnectionLink(), GetTransform2LinkAxisX(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransform2LinkQLinks(), HTransformX2Vect(), main(), SAM2HTransform(), and SHTransformEvaluate(). ◆ HTransformGetElement()
Gets an element from a homogeneous transform.
Definition at line 329 of file htransform.c. References AXIS_H, and Error(). Referenced by axis2SDF(), body2SDF(), ComputeHandC_FJH(), EvaluateMEquation(), GenerateJointEquations(), GenerateLinkSolutionAxisX(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateLinkSolutionQLinks(), GetJointDOFValues(), HTransform2SAM(), HTransformXSAV(), InitHandC(), main(), NewFixJoint(), NumericDDTransSeq(), PQPTest(), PrintTransSeq(), SAM2HTransform(), SHTransformPostCtProduct(), SHTransformPreCtProduct(), TNumericDTransSeq(), WorldCoupleTensegrityVariable(), and WorldDOF2Sol(). ◆ HTransformFromVectors()
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 341 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, and AXIS_Z. Referenced by Atoms2Transforms(), EvaluatePATrans(), EvaluateTrans(), GetJointBasicTransform(), GetJointDOFValues(), GetJointTransform(), NewRevoluteJoint(), and NewUniversalJoint(). ◆ HTransform2GLMatrix()
Defines a homogeneous transform a la GL (colum-major) from our format of homogeneous transforms.
Definition at line 357 of file htransform.c. References AXIS_H. Referenced by CheckCollisionSolid(), and InitSolidCD(). ◆ HTransformFromGLMatrix()
The reverse of HTransform2GLMatrix.
Definition at line 379 of file htransform.c. References AXIS_H. ◆ HTransformProduct()
Product of two homogeneous transforms.
Definition at line 410 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. Referenced by AddCtTrans2TransSeq(), axis2SDF(), body2SDF(), CheckCollisionSolid(), ComputeHandC_FJH(), EvaluateTransSeq(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateSphereOFF(), GetJointBasicTransform(), GetJointDOFValues(), GetJointTransform(), GetLinkTransformsFromDOF(), GetMechanismDOFsFromTransforms(), GetTransform(), GetTransform2LinkFLinks(), GetTransform2LinkLinks(), GetTransformFromBranch(), HandC(), HTransformInverse(), HTransformX2Vect(), InitHandC(), main(), MechEnergy(), MoveLinkFromTransform(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), NumericDDTransSeq(), SimplifyTransSeq(), SolidCorrection(), and TNumericDTransSeq(). ◆ HTransformAdd()
Addition of two homogeneous transforms.
Definition at line 450 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. ◆ HTransformSubstract()
Substraction of two homogeneous transforms.
Definition at line 479 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. Referenced by ComputeHandC_FJH(), and FixVarInMEquation(). ◆ HTransformInverse()
Addition of a homogeneous transform.
Definition at line 510 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, HTransformProduct(), matrix_identity, and MATRIX_INT_COPY. Referenced by AddTrans2TransSeq(), axis2SDF(), ComputeHandC_FJH(), EvaluatePATrans(), GetJointBasicTransform(), GetJointDOFValues(), GetJointPostT(), GetJointPreT(), GetJointTransform(), GetLinkTransformsFromDOF(), GetTransformFromBranch(), InitHandC(), InitWorldFromMolecule(), NewPrismaticJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), PrintCollisionInfoInt(), SAMinverse(), and TransInvert(). ◆ HTransformOrthonormalize()
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 536 of file htransform.c. References AXIS_H, matrix_identity, and MATRIX_INT_COPY. Referenced by GetTransform2LinkFLinks(), GetTransform2LinkLinks(), and GetTransform2LinkQLinks(). ◆ HTransformX2Vect()
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 581 of file htransform.c. References Error(), HTransformIdentity(), HTransformProduct(), HTransformRy(), HTransformRz(), HTransformSetElement(), HTransformTxyz(), and M_PI_2. Referenced by body2SDF(), GenerateCylinderOFF(), NewInPatchJoint(), NewRevoluteJoint(), NewSphericalJoint(), NewUniversalJoint(), PlotCylinder(), and SolidCorrection(). ◆ HTransformYawPitchRoll()
Defines de rotation matrix resulting from R=Rz(a)Ry(b)Rx(c) This is the invers of GetYawPitchRoll.
Definition at line 632 of file htransform.c. References HTransformAcumRot(), HTransformRz(), RX, and RY. Referenced by GetTransform(). ◆ GetYawPitchRoll()
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 641 of file htransform.c. References AXIS_X, AXIS_Y, AXIS_Z, and M_PI_2. Referenced by axis2SDF(), body2SDF(), GetJointDOFValues(), HTransformPrettyPrint(), and main(). ◆ HTransformTranspose()
Transpose of a homogeneous transform. Note that, in general the transpose of a homogeneous transform is not a homogeneous transform.
Definition at line 679 of file htransform.c. References DIM_SP, and MATRIX_INT_COPY. Referenced by EvaluateTrans(). ◆ HTransformAcumTrans()
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 702 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, and AXIS_Z. Referenced by EvaluateTransSeq(), HTransformAcumTrans2(), and main(). ◆ HTransformAcumTrans2()
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 717 of file htransform.c. References HTransformAcumTrans(), and MATRIX_INT_COPY. ◆ HTransformAcumRot()
Computes the result of multiplying a homogeneous transform by a rotation matrix. The result is accumulated in the given transform.
Definition at line 734 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, Error(), RX, RY, and RZ. Referenced by EvaluateTransSeq(), GetJointBasicTransform(), GetJointTransform(), HTransformAcumRot2(), and HTransformYawPitchRoll(). ◆ HTransformAcumRot2()
Computes the result of multiplying a homogeneous transform by a rotation matrix.
Definition at line 777 of file htransform.c. References HTransformAcumRot(), and MATRIX_INT_COPY. ◆ HTransformApply()
Multiply a homogeneous transform and a vector.
Definition at line 789 of file htransform.c. References AXIS_H, and DIM_SP. Referenced by ApplyLinkRotFLinks(), ApplyLinkRotLinks(), BioWordGetAtomPositionsFromConformation(), EvaluateMEquationXVectors(), GenerateCylinderOFF(), GenerateSphereOFF(), GetConnectionLinkPotentialEnergy(), GetConnectionLinkWrench(), GetTransform2ConnectionLink(), InitWorldFromMolecule(), main(), NewRevoluteJoint(), NewUniversalJoint(), PolyhedronPrintCenter(), PolyhedronPrintCenterAndRadius(), PrintCollisionInfoInt(), PrintJointAxes(), and TransformPolyhedron(). ◆ HTransformApplyRot()
Applies the rotation encoded in a homogeneous transform to a vector (i.e., rotates the vector).
Definition at line 808 of file htransform.c. References DIM_SP. Referenced by EvaluateTrans(), GenerateJointSolution(), HTransformXSAV(), main(), and PrintJointAxes(). ◆ HTransformPrint()
Prints the a homogeneous transform to a stream that can be stdtout.
Definition at line 851 of file htransform.c. References DIM_SP. Referenced by ApplyExternalForces(), Atoms2Transforms(), InitHandC(), PrintTransSeq(), and StoreCollisionInfoInt(). ◆ HTransformPrintT()
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 877 of file htransform.c. References DIM_SP. Referenced by Move3dObject(), and PlotCylinder(). ◆ HTransformPrettyPrint()
Prints a homogenoeus transform compactly using basic transforms, whenever possible.
Definition at line 892 of file htransform.c. References AXIS_H, AXIS_X, AXIS_Y, AXIS_Z, FALSE, GetYawPitchRoll(), HTransformIsIdentity(), HTransformIsTranslation(), and TRUE. Referenced by PrintJoint(), and PrintLink(). ◆ HTransformDelete()
Deletes the information stored in the THTransform and frees the allocated memory space.
Definition at line 926 of file htransform.c. Referenced by AddTrans2TransSeq(), BioWordConformationFromAtomPositions(), CheckCollisionSolid(), DeleteBioWorld(), DeleteJoint(), DeleteLink(), DeleteLinkTransforms(), DeleteMEquation(), DeleteSolidCD(), DeleteTrans(), DeriveTransSeq(), EvaluateMEquation(), EvaluateMEquationXVectors(), EvaluateTransSeq(), FixVarInMEquation(), FixVarInTransSeq(), GenerateCylinderOFF(), GenerateLinkSolutionFLinks(), GenerateLinkSolutionLinks(), GenerateSphereOFF(), GetJointBasicTransform(), GetJointDOFValues(), GetJointTransform(), GetLinkTransformsFromDOF(), GetMechanismDOFsFromTransforms(), InitWorldFromMolecule(), main(), MoveLinkFromTransform(), NewRevoluteJoint(), NewUniversalJoint(), PlotCylinder(), and PrintCollisionInfoInt(). Variable Documentation◆ matrix_identity
Initial value:
={{1.0, 0.0, 0.0, 0.0},
{0.0, 1.0, 0.0, 0.0},
{0.0, 0.0, 1.0, 0.0},
{0.0, 0.0, 0.0, 1.0}}
A global constant that defines the identity matrix. Definition at line 28 of file htransform.c. Referenced by HTransformIdentity(), HTransformInverse(), HTransformIsIdentity(), HTransformOrthonormalize(), HTransformRx(), HTransformRx2(), HTransformRy(), HTransformRy2(), HTransformRz(), HTransformRz2(), HTransformScale(), HTransformScaleX(), HTransformScaleY(), HTransformScaleZ(), HTransformTx(), HTransformTxyz(), HTransformTy(), and HTransformTz(). ◆ matrix_zero
Initial value:
={{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0},
{0.0, 0.0, 0.0, 0.0}}
A global constant that defines the zero matrix. Definition at line 38 of file htransform.c. Referenced by HTransformIsZero(), and HTransformZero(). |
Follow us!