libalmath  2.1.4.13
 All Classes Namespaces Functions Variables Typedefs Groups Pages
altransformhelpers.h
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 
12 #include <almath/types/alposition2d.h>
13 #include <almath/types/alposition3d.h>
14 #include <almath/types/alposition6d.h>
15 #include <almath/types/alrotation.h>
16 #include <almath/types/alrotation3d.h>
17 #include <almath/types/alvelocity6d.h>
18 #include <almath/types/altransform.h>
19 #include <almath/types/alaxismask.h>
20 #include <almath/types/alpose2d.h>
21 #include <almath/types/alquaternion.h>
22 #include <almath/types/aldisplacement.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.
89  void velocityExponentialInPlace(
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.
178  void changeReferencePosition3DInPlace(
179  const Transform& pT,
180  Position3D& pPosOut);
181 
182  // TODO: rename argument.
183  void changeReferenceTransposePosition3DInPlace(
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 
579  const Transform& pT,
580  Position6D& pPos);
581 
588  Position6D position6DFromTransform(const Transform& pT);
589 
597  const Pose2D& pPose,
598  Transform& pT);
599 
606  Transform transformFromPose2D(const Pose2D& pPose);
607 
615  const Transform& pT,
616  Pose2D& pPos);
617 
624  Pose2D pose2DFromTransform(const Transform& pT);
625 
633  const Transform& pT,
634  Position2D& pPos);
635 
642  Position2D position2DFromTransform(const Transform& pT);
643 
652  Transform transformFromRotation3D(const Rotation3D& pRotation);
653 
660  Transform transformFromPosition6D(const Position6D& pPosition6D);
661 
681  const Transform& pCurrent,
682  const Transform& pTarget,
683  Position6D& result);
684 
694  Position6D position6DFromTransformDiff(
695  const Transform& pCurrent,
696  const Transform& pTarget);
697 
701 
720  const Transform& pT,
721  Position3D& pPos);
722 
726 
740  Position3D position3DFromTransform(const Transform& pT);
745 
746 
755  Rotation3D rotation3DFromTransform(const Transform& pT);
756 
766  const int pAxis,
767  const float pTheta,
768  const Position3D& pPos,
769  Transform& pT);
770 
778  Transform transformFromRotVec(
779  const int pAxis,
780  const float pTheta,
781  const Position3D& pPos);
782 
783 
790  const Position3D& pPos,
791  Transform& pT);
792 
798  Transform transformFromRotVec(const Position3D& pPos);
799 
804 
807  Transform transformFromRotVec(
808  const int& pAxis,
809  const float& pTheta);
810 
811  Position3D operator*(
812  const Transform& pT,
813  const Position2D& pPos);
814 
815  Position3D operator*(
816  const Transform& pT,
817  const Position3D& pPos);
818 
826  Transform axisRotationProjection(
827  const Position3D& pAxis,
828  const Transform& pT);
829 
837  Rotation axisRotationProjection(
838  const Position3D& pAxis,
839  const Rotation& pRot);
840 
841 
848  void axisRotationProjectionInPlace(
849  const Position3D& pAxis,
850  Transform& pT);
851 
858  void axisRotationProjectionInPlace(
859  const Position3D& pAxis,
860  Rotation& pRot);
861 
868  void orthogonalSpace(
869  const Position3D& pPos,
870  Transform& pTf);
871 
872  Transform orthogonalSpace(const Position3D& pPos);
873 
874  Transform transformFromQuaternion(
875  const Quaternion& pQua);
876 
877  Quaternion quaternionFromTransform(
878  const Transform& pT);
879 
886  Transform transformFromDisplacement(const Displacement& pDisp);
887 
894  Displacement displacementFromTransform(const Transform& pTrans);
895 
896  } // namespace Math
897 } // namespace AL
898 #endif // _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_
Transform velocityExponential(const Velocity6D &pVel)
Compute the logarithme of a transform. Angle must be between
Transform transformFromRotVec(const int &pAxis, const float &pTheta)
void position6DFromTransformInPlace(const Transform &pT, Position6D &pPos)
Compute Position6D corresponding to the Transform.
Rotation rotationFromTransform(const Transform &pTransform)
void changeReferenceVelocity6D(const Transform &pT, const Velocity6D &pVelIn, Velocity6D &pVelOut)
Rotation3D rotation3DFromTransform(const Transform &pT)
Create a Rotation3D (Roll, Pitch, Yaw) corresponding to the rotational part of the Transform...
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.
Pose2D pose2DFromTransform(const Transform &pT)
Create a Pose2D from a Transform.
void transformLogarithmInPlace(const Transform &pT, Velocity6D &pVel)
Compute the logarithme of a transform. Angle must be between
void transformFromPose2DInPlace(const Pose2D &pPose, Transform &pT)
Compute a Transform from a Pose2D.
void transformFromRotVecInPlace(const Position3D &pPos, Transform &pT)
void changeReferenceTransposePosition3D(const Transform &pT, const Position3D &pPosIn, Position3D &pPosOut)
Position2D position2DFromTransform(const Transform &pT)
Create a Position2D from a Transform.
Velocity6D transformLogarithm(const Transform &pT)
Compute the logarithme of a transform. Angle must be between
Transform transformFromPosition3D(const Position3D &pPosition)
Create a 4*4 transform matrix from cartesian coordinates given in pPosition.
Transform transformFromPose2D(const Pose2D &pPose)
Create a Transform from a Pose2D.
Position3D operator*(const Rotation &pRot, const Position3D &pPos)
Overloading of operator * between Rotation and Position3D:
void transformFromRotationInPlace(const Rotation &pRotation, Transform &pTransform)
Modify the rotation part of the transform. The translation part of the transform is not modified...
void rotationFromTransformInPlace(const Transform &pTransform, Rotation &pRotation)
Extract the position coordinates from a Transform.
Transform transformFromRotation(const Rotation &pRotation)
Position6D position6DFromTransform(const Transform &pT)
Compute Position6D corresponding to 4*4 Homogenous Transform.
void position2DFromTransformInPlace(const Transform &pT, Position2D &pPos)
Compute a Position2D from a Transform.
Transform transformFromPosition6D(const Position6D &pPosition6D)
Create a Transform from a Position6D.
Transform transformFromRotation3D(const Rotation3D &pRotation)
Create a Transform from the 3 angles stored in a Rotation3D. The angles are composed in the following...
Transform transformFromRotationPosition3D(const Rotation &pRot, const Position3D &pPos)
Create a Transform from a Position3D and a Rotation.
void changeReferenceTransform(const Transform &pT, const Transform &pTIn, Transform &pTOut)
Position3D position3DFromTransform(const Transform &pT)
Create a Position3D from a Transform.
void transformFromPosition3DInPlace(const Position3D &pPosition, Transform &pTransform)
Modify pTransform to set the translation part to pPosition.
void pose2DFromTransformInPlace(const Transform &pT, Pose2D &pPos)
Compute a Pose2D from a Transform.
void changeReferencePosition3D(const Transform &pT, const Position3D &pPosIn, Position3D &pPosOut)
void changeReferenceTransposeVelocity6D(const Transform &pT, const Velocity6D &pVelIn, Velocity6D &pVelOut)
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 ...
void changeReferenceTransposeTransform(const Transform &pT, const Transform &pTIn, Transform &pTOut)
void position6DFromTransformDiffInPlace(const Transform &pCurrent, const Transform &pTarget, Position6D &result)
Computes a 6 differential motion require to move from a 4*4 Homogenous transform matrix Current to a ...
void changeReferenceTransposePosition6D(const Transform &pT, const Position6D &pPosIn, Position6D &pPosOut)
Rotation3D rotation3DFromRotation(const Rotation &pRotation)
return 3 angles which result in the equivalent rotation when composed in the following order: Rz(wz) ...
void position3DFromTransformInPlace(const Transform &pT, Position3D &pPos)
Compute a Position3D from a Transform.
void changeReferencePosition6D(const Transform &pT, const Position6D &pPosIn, Position6D &pPosOut)
Transform transformMean(const Transform &pTIn1, const Transform &pTIn2, const float &pVal=0.5f)
Preform a logarithmic mean of pTIn1 and pTIn2.