libalmath  2.4.3.28-r2
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
altransformhelpers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
7 
8 #pragma once
9 #ifndef _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_
10 #define _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_
11 
20 #include <almath/types/alpose2d.h>
23 
24 namespace AL {
25  namespace Math {
26 
27 
31 
48  const Transform& pT,
49  Velocity6D& pVel);
50 
51 
55 
64  Velocity6D transformLogarithm(const Transform& pT);
71 
72 
76 
80  Transform velocityExponential(const Velocity6D& pVel);
87 
88  // TODO: Add to doc or set private.
90  const Velocity6D& pVel,
91  Transform& pT);
92 
94 
131  const Transform& pT,
132  const Velocity6D& pVelIn,
133  Velocity6D& pVelOut);
134 
136 
173  const Transform& pT,
174  const Position6D& pPosIn,
175  Position6D& pPosOut);
176 
177  // TODO: rename argument.
179  const Transform& pT,
180  Position3D& pPosOut);
181 
182  // TODO: rename argument.
184  const Transform& pT,
185  Position3D& pPosOut);
186 
188 
216  const Transform& pT,
217  const Position3D& pPosIn,
218  Position3D& pPosOut);
219 
221 
241  const Transform& pT,
242  const Position3D& pPosIn,
243  Position3D& pPosOut);
244 
246 
266  const Transform& pT,
267  const Transform& pTIn,
268  Transform& pTOut);
269 
271 
291  const Transform& pT,
292  const Transform& pTIn,
293  Transform& pTOut);
294 
295 
297 
334  const Transform& pT,
335  const Velocity6D& pVelIn,
336  Velocity6D& pVelOut);
337 
339 
376  const Transform& pT,
377  const Position6D& pPosIn,
378  Position6D& pPosOut);
379 
391  const Transform& pTIn1,
392  const Transform& pTIn2,
393  const float& pVal,
394  Transform& pTOut);
395 
407  Transform transformMean(
408  const Transform& pTIn1,
409  const Transform& pTIn2,
410  const float& pVal = 0.5f);
411 
414 
431  const Rotation& pRot,
432  const float& pX,
433  const float& pY,
434  const float& pZ);
435 
438 
452  const Rotation& pRot,
453  const Position3D& pPos);
454 
457 
473  const Position3D& pPosition,
474  Transform& pTransform);
475 
479 
490  Transform transformFromPosition3D(const Position3D& pPosition);
498 
502 
518  const Rotation& pRotation,
519  Transform& pTransform);
520 
522 
533  Transform transformFromRotation(const Rotation& pRotation);
540 
548  const Transform& pTransform,
549  Rotation& pRotation);
550 
559  Rotation rotationFromTransform(const Transform& pTransform);
560 
570  Rotation3D rotation3DFromRotation(const Rotation& pRotation);
571 
585  Rotation rotationFromAxesXY(const Position3D& pX, const Position3D& pY);
586 
600  Rotation rotationFromAxesXZ(const Position3D& pX, const Position3D& pZ);
601 
615  Rotation rotationFromAxesYZ(const Position3D& pY, const Position3D& pZ);
616 
630  Rotation rotationFromAxesXYZ(const Position3D& pX, const Position3D& pY, const Position3D& pZ);
631 
632 
640  const Transform& pT,
641  Position6D& pPos);
642 
649  Position6D position6DFromTransform(const Transform& pT);
650 
658  const Pose2D& pPose,
659  Transform& pT);
660 
667  Transform transformFromPose2D(const Pose2D& pPose);
668 
676  const Transform& pT,
677  Pose2D& pPos);
678 
685  Pose2D pose2DFromTransform(const Transform& pT);
686 
694  const Transform& pT,
695  Position2D& pPos);
696 
703  Position2D position2DFromTransform(const Transform& pT);
704 
713  Transform transformFromRotation3D(const Rotation3D& pRotation);
714 
721  Transform transformFromPosition6D(const Position6D& pPosition6D);
722 
742  const Transform& pCurrent,
743  const Transform& pTarget,
744  Position6D& result);
745 
755  Position6D position6DFromTransformDiff(
756  const Transform& pCurrent,
757  const Transform& pTarget);
758 
762 
781  const Transform& pT,
782  Position3D& pPos);
783 
787 
801  Position3D position3DFromTransform(const Transform& pT);
806 
807 
816  Rotation3D rotation3DFromTransform(const Transform& pT);
817 
827  const int pAxis,
828  const float pTheta,
829  const Position3D& pPos,
830  Transform& pT);
831 
839  Transform transformFromRotVec(
840  const int pAxis,
841  const float pTheta,
842  const Position3D& pPos);
843 
844 
851  const Position3D& pPos,
852  Transform& pT);
853 
859  Transform transformFromRotVec(const Position3D& pPos);
860 
865 
868  Transform transformFromRotVec(
869  const int& pAxis,
870  const float& pTheta);
871 
872  Position3D operator*(
873  const Transform& pT,
874  const Position2D& pPos);
875 
876  Position3D operator*(
877  const Transform& pT,
878  const Position3D& pPos);
879 
887  Transform axisRotationProjection(
888  const Position3D& pAxis,
889  const Transform& pT);
890 
898  Rotation axisRotationProjection(
899  const Position3D& pAxis,
900  const Rotation& pRot);
901 
902 
910  const Position3D& pAxis,
911  Transform& pT);
912 
920  const Position3D& pAxis,
921  Rotation& pRot);
922 
929  void orthogonalSpace(
930  const Position3D& pPos,
931  Transform& pTf);
932 
933  Transform orthogonalSpace(const Position3D& pPos);
934 
935  Transform transformFromQuaternion(
936  const Quaternion& pQua);
937 
938  Quaternion quaternionFromTransform(
939  const Transform& pT);
940 
947  Transform transformFromDisplacement(const Displacement& pDisp);
948 
955  Displacement displacementFromTransform(const Transform& pTrans);
956 
957  } // namespace Math
958 } // namespace AL
959 #endif // _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_
Transform velocityExponential(const Velocity6D &pVel)
Compute the logarithme of a transform. Angle must be between
void changeReferenceTransposePosition3DInPlace(const Transform &pT, Position3D &pPosOut)
void position2DFromTransformInPlace(const Transform &pT, Position2D &pPos)
Compute a Position2D from a Transform.
Position2D position2DFromTransform(const Transform &pT)
Create a Position2D from a Transform.
void position6DFromTransformDiffInPlace(const Transform &pCurrent, const Transform &pTarget, Position6D &result)
Computes a 6 differential motion required to move from a 4*4 Homogenous transform matrix Current to a...
void transformMeanInPlace(const Transform &pTIn1, const Transform &pTIn2, const float &pVal, Transform &pTOut)
Preform a logarithmic mean of pTIn1 and pTIn2 and put it in pTout.
void changeReferenceTransform(const Transform &pT, const Transform &pTIn, Transform &pTOut)
Rotation rotationFromAxesYZ(const Position3D &pY, const Position3D &pZ)
return a Rotation Matrix initialized with its direction vectors X and Y in world coordinates. These vectors represent, respectively, the second and third columns of the Rotation matrix. The vectors must be unitary and orthogonal.
void transformFromRotationInPlace(const Rotation &pRotation, Transform &pTransform)
Modify the rotation part of the transform. The translation part of the transform is not modified...
void position6DFromTransformInPlace(const Transform &pT, Position6D &pPos)
Compute Position6D corresponding to the Transform.
void transformFromPose2DInPlace(const Pose2D &pPose, Transform &pT)
Compute a Transform from a Pose2D.
Transform transformFromRotation(const Rotation &pRotation)
Displacement displacementFromTransform(const Transform &pTrans)
void changeReferencePosition3D(const Transform &pT, const Position3D &pPosIn, Position3D &pPosOut)
void velocityExponentialInPlace(const Velocity6D &pVel, Transform &pT)
void changeReferencePosition6D(const Transform &pT, const Position6D &pPosIn, Position6D &pPosOut)
Rotation rotationFromTransform(const Transform &pTransform)
Rotation3D rotation3DFromRotation(const Rotation &pRotation)
return 3 angles which result in the equivalent rotation when composed in the following order: Rz(wz) ...
Transform transformFromPosition3D(const Position3D &pPosition)
Create a 4*4 transform matrix from cartesian coordinates given in pPosition.
Transform transformMean(const Transform &pTIn1, const Transform &pTIn2, const float &pVal=0.5f)
Preform a logarithmic mean of pTIn1 and pTIn2.
Rotation3D rotation3DFromTransform(const Transform &pT)
Create a Rotation3D (Roll, Pitch, Yaw) corresponding to the rotational part of the Transform...
void changeReferenceTransposeTransform(const Transform &pT, const Transform &pTIn, Transform &pTOut)
void transformFromPosition3DInPlace(const Position3D &pPosition, Transform &pTransform)
Modify pTransform to set the translation part to pPosition.
Transform transformFromPosition6D(const Position6D &pPosition6D)
Create a Transform from a Position6D.
void axisRotationProjectionInPlace(const Position3D &pAxis, Transform &pT)
void position3DFromTransformInPlace(const Transform &pT, Position3D &pPos)
Compute a Position3D from a Transform.
void transformLogarithmInPlace(const Transform &pT, Velocity6D &pVel)
Compute the logarithme of a transform. Angle must be between
Transform transformFromRotation3D(const Rotation3D &pRotation)
Create a Transform from the 3 angles stored in a Rotation3D. The angles are composed in the following...
Transform axisRotationProjection(const Position3D &pAxis, const Transform &pT)
void changeReferenceTransposePosition6D(const Transform &pT, const Position6D &pPosIn, Position6D &pPosOut)
void changeReferenceTransposeVelocity6D(const Transform &pT, const Velocity6D &pVelIn, Velocity6D &pVelOut)
Transform transformFromDisplacement(const Displacement &pDisp)
Transform transformFromPose2D(const Pose2D &pPose)
Create a Transform from a Pose2D.
void changeReferencePosition3DInPlace(const Transform &pT, Position3D &pPosOut)
void rotationFromTransformInPlace(const Transform &pTransform, Rotation &pRotation)
Extract the position coordinates from a Transform.
Quaternion quaternionFromTransform(const Transform &pT)
void changeReferenceVelocity6D(const Transform &pT, const Velocity6D &pVelIn, Velocity6D &pVelOut)
Velocity6D transformLogarithm(const Transform &pT)
Compute the logarithme of a transform. Angle must be between
Pose2D pose2DFromTransform(const Transform &pT)
Create a Pose2D from a Transform.
Transform transformFromRotationPosition3D(const Rotation &pRot, const float &pX, const float &pY, const float &pZ)
Create a Transform from 3D cartesian coordiantes and a Rotation.
Position3D position3DFromTransform(const Transform &pT)
Create a Position3D from a Transform.
Position6D position6DFromTransformDiff(const Transform &pCurrent, const Transform &pTarget)
Computes a 6 differential motion require to move from a 4*4 Homogenous transform matrix Current to a ...
Position6D position6DFromTransform(const Transform &pT)
Compute Position6D corresponding to 4*4 Homogenous Transform.
void changeReferenceTransposePosition3D(const Transform &pT, const Position3D &pPosIn, Position3D &pPosOut)
Transform transformFromQuaternion(const Quaternion &pQua)
Transform transformFromRotVec(const int pAxis, const float pTheta, const Position3D &pPos)
Rotation rotationFromAxesXY(const Position3D &pX, const Position3D &pY)
return a Rotation Matrix initialized with its direction vectors X and Y in world coordinates. These vectors represent, respectively, the first and second columns of the Rotation matrix. The vectors must be unitary and orthogonal.
Rotation rotationFromAxesXZ(const Position3D &pX, const Position3D &pZ)
return a Rotation Matrix initialized with its direction vectors X and Z in world coordinates. These vectors represent, respectively, the first and third columns of the Rotation matrix. The vectors must be unitary and orthogonal.
void orthogonalSpace(const Position3D &pPos, Transform &pTf)
Position3D operator*(const Rotation &pRot, const Position3D &pPos)
Overloading of operator * between Rotation and Position3D:
void transformFromRotVecInPlace(const int pAxis, const float pTheta, const Position3D &pPos, Transform &pT)
Compute a Transform from
void pose2DFromTransformInPlace(const Transform &pT, Pose2D &pPos)
Compute a Pose2D from a Transform.
Rotation rotationFromAxesXYZ(const Position3D &pX, const Position3D &pY, const Position3D &pZ)
return a Rotation Matrix initialized with its direction vectors in world coordinates. The vectors represent the columns of the Rotation matrix. The vectors must be unitary and orthogonal.