libalmath
1.14.5
|
00001 /* 00002 * Copyright (c) 2012 Aldebaran Robotics. All rights reserved. 00003 * Use of this source code is governed by a BSD-style license that can be 00004 * found in the COPYING file. 00005 */ 00006 00007 00008 #pragma once 00009 #ifndef _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_ 00010 #define _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_ 00011 00012 #include <almath/types/alposition3d.h> 00013 #include <almath/types/alposition6d.h> 00014 #include <almath/types/alrotation.h> 00015 #include <almath/types/alrotation3d.h> 00016 #include <almath/types/alvelocity6d.h> 00017 #include <almath/types/altransform.h> 00018 #include <almath/types/alaxismask.h> 00019 #include <almath/types/alpose2d.h> 00020 #include <almath/types/alquaternion.h> 00021 00022 namespace AL { 00023 namespace Math { 00024 00025 00029 00038 00039 00040 00041 00042 00043 00044 00045 void transformLogarithmInPlace( 00046 const Transform& pT, 00047 Velocity6D& pVel); 00048 00049 00053 00062 00063 00064 00065 00066 00067 00068 Velocity6D transformLogarithm(const Transform& pT); 00069 00070 00074 00078 00079 00080 00081 00082 00083 00084 Transform velocityExponential(const Velocity6D& pVel); 00085 00086 // TODO: Add to doc or set private. 00087 void velocityExponentialInPlace( 00088 const Velocity6D& pVel, 00089 Transform& pT); 00090 00092 00120 00121 00122 00123 00124 00125 00126 00127 00128 void changeReferenceVelocity6D( 00129 const Transform& pT, 00130 const Velocity6D& pVelIn, 00131 Velocity6D& pVelOut); 00132 00134 00162 00163 00164 00165 00166 00167 00168 00169 00170 void changeReferencePosition6D( 00171 const Transform& pT, 00172 const Position6D& pPosIn, 00173 Position6D& pPosOut); 00174 00175 // TODO: rename argument. 00176 void changeReferencePosition3DInPlace( 00177 const Transform& pT, 00178 Position3D& pPosOut); 00179 00180 // TODO: rename argument. 00181 void changeReferenceTransposePosition3DInPlace( 00182 const Transform& pT, 00183 Position3D& pPosOut); 00184 00186 00205 00206 00207 00208 00209 00210 00211 00212 00213 void changeReferencePosition3D( 00214 const Transform& pT, 00215 const Position3D& pPosIn, 00216 Position3D& pPosOut); 00217 00219 00231 00232 00233 00234 00235 00236 00237 00238 void changeReferenceTransposePosition3D( 00239 const Transform& pT, 00240 const Position3D& pPosIn, 00241 Position3D& pPosOut); 00242 00244 00256 00257 00258 00259 00260 00261 00262 00263 void changeReferenceTransform( 00264 const Transform& pT, 00265 const Transform& pTIn, 00266 Transform& pTOut); 00267 00269 00281 00282 00283 00284 00285 00286 00287 00288 void changeReferenceTransposeTransform( 00289 const Transform& pT, 00290 const Transform& pTIn, 00291 Transform& pTOut); 00292 00293 00295 00323 00324 00325 00326 00327 00328 00329 00330 00331 void changeReferenceTransposeVelocity6D( 00332 const Transform& pT, 00333 const Velocity6D& pVelIn, 00334 Velocity6D& pVelOut); 00335 00337 00365 00366 00367 00368 00369 00370 00371 00372 00373 void changeReferenceTransposePosition6D( 00374 const Transform& pT, 00375 const Position6D& pPosIn, 00376 Position6D& pPosOut); 00377 00388 void transformMeanInPlace( 00389 const Transform& pTIn1, 00390 const Transform& pTIn2, 00391 const float& pVal, 00392 Transform& pTOut); 00393 00405 Transform transformMean( 00406 const Transform& pTIn1, 00407 const Transform& pTIn2, 00408 const float& pVal = 0.5f); 00409 00412 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 Transform transformFromRotationPosition3D( 00429 const Rotation& pRot, 00430 const float& pX, 00431 const float& pY, 00432 const float& pZ); 00433 00436 00442 00443 00444 00445 00446 00447 00448 00449 Transform transformFromRotationPosition3D( 00450 const Rotation& pRot, 00451 const Position3D& pPos); 00452 00455 00466 00467 00468 00469 00470 void transformFromPosition3DInPlace( 00471 const Position3D& pPosition, 00472 Transform& pTransform); 00473 00477 00488 00489 00490 00491 00492 00493 00494 00495 Transform transformFromPosition3D(const Position3D& pPosition); 00496 00500 00511 00512 00513 00514 00515 void transformFromRotationInPlace( 00516 const Rotation& pRotation, 00517 Transform& pTransform); 00518 00520 00531 00532 00533 00534 00535 00536 00537 Transform transformFromRotation(const Rotation& pRotation); 00538 00545 void rotationFromTransformInPlace( 00546 const Transform& pTransform, 00547 Rotation& pRotation); 00548 00557 Rotation rotationFromTransform(const Transform& pTransform); 00558 00567 Rotation3D rotation3DFromRotation(const Rotation& pRotation); 00568 00575 void position6DFromTransformInPlace( 00576 const Transform& pT, 00577 Position6D& pPos); 00578 00585 Position6D position6DFromTransform(const Transform& pT); 00586 00593 void transformFromPose2DInPlace( 00594 const Pose2D& pPose, 00595 Transform& pT); 00596 00603 Transform transformFromPose2D(const Pose2D& pPose); 00604 00611 void pose2DFromTransformInPlace( 00612 const Transform& pT, 00613 Pose2D& pPos); 00614 00621 Pose2D pose2DFromTransform(const Transform& pT); 00622 00629 Transform transformFromRotation3D(const Rotation3D& pRotation); 00630 00637 Transform transformFromPosition6D(const Position6D& pPosition6D); 00638 00648 void position6DFromTransformDiffInPlace( 00649 const Transform& pCurrent, 00650 const Transform& pTarget, 00651 Position6D& result); 00652 00662 Position6D position6DFromTransformDiff( 00663 const Transform& pCurrent, 00664 const Transform& pTarget); 00665 00669 00683 00684 00685 00686 00687 void position3DFromTransformInPlace( 00688 const Transform& pT, 00689 Position3D& pPos); 00690 00694 00708 00709 00710 00711 00712 Position3D position3DFromTransform(const Transform& pT); 00713 00714 00722 Rotation3D rotation3DFromTransform(const Transform& pT); 00723 00732 void transformFromRotVecInPlace( 00733 const int pAxis, 00734 const float pTheta, 00735 const Position3D& pPos, 00736 Transform& pT); 00737 00746 Transform transformFromRotVec( 00747 const int pAxis, 00748 const float pTheta, 00749 const Position3D& pPos); 00750 00751 00758 void transformFromRotVecInPlace( 00759 const Position3D& pPos, 00760 Transform& pT); 00761 00768 Transform transformFromRotVec(const Position3D& pPos); 00769 00775 00778 Transform transformFromRotVec( 00779 const int& pAxis, 00780 const float& pTheta); 00781 00782 Position3D operator*( 00783 const Transform& pT, 00784 const Position3D& pPos); 00785 00792 Transform axisRotationProjection( 00793 const Position3D& pPos, 00794 const Transform& pT); 00795 00803 Rotation axisRotationProjection( 00804 const Position3D& pAxis, 00805 const Rotation& pRot); 00806 00807 00814 void axisRotationProjectionInPlace( 00815 const Position3D& pPos, 00816 Transform& pT); 00817 00824 void axisRotationProjectionInPlace( 00825 const Position3D& pPos, 00826 Rotation& pRot); 00827 00828 00829 void orthogonalSpace( 00830 const Position3D& pPos, 00831 Transform& pTOut); 00832 00833 Transform orthogonalSpace(const Position3D& pPos); 00834 00835 Transform transformFromQuaternion( 00836 const Quaternion& pQua); 00837 00838 Quaternion quaternionFromTransform( 00839 const Transform& pT); 00840 00841 } // namespace Math 00842 } // namespace AL 00843 #endif // _LIBALMATH_ALMATH_TOOLS_ALTRANSFORMHELPERS_H_