00001 00002 // 00003 // Title : Xform.h 00004 // Project : OSCAR Version 2.0 00005 // Created : 1/12/1996 00006 // Author : Chetan Kapoor 00007 // Platforms : All 00008 // Copyright : Copyright The University of Texas at Austin, 2002. All rights reserved. 00009 // 00010 // This software and documentation constitute an unpublished work 00011 // and contain valuable trade secrets and proprietary information 00012 // belonging to the University. None of the foregoing material may be 00013 // copied or duplicated or disclosed without the express, written 00014 // permission of University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY 00015 // AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION, 00016 // INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 00017 // PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY 00018 // THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. 00019 // NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF 00020 // THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the 00021 // University be liable for incidental, special, indirect, direct or 00022 // consequential damages or loss of profits, interruption of business, 00023 // or related expenses which may arise from use of software or documentation, 00024 // including but not limited to those resulting from defects in software 00025 // and/or documentation, or loss or inaccuracy of data of any kind. 00026 // 00027 // Purpose : Definition of a 4 by 4 homogeneous transformation matrix. 00028 // 00029 //----------------------------------------------------------------------------- 00030 // 00031 // 00032 // $Revisions$ 00033 // Troy Harden 6-19-98 added XformToForceXform(Matrix& _forceXform) function 00034 // Troy Harden 7-1-98 added HandPose ToHandPose() function 00035 // 00036 // $Log: Xform.h,v $ 00037 // Revision 1.15 2006/08/29 02:00:34 chetan 00038 // Added Normalize method 00039 // 00040 // Revision 1.14 2005/05/10 14:54:33 josh 00041 // Added method to check validity of rotation matrices. Also added invalidRotationMatrix error. 00042 // 00043 // Revision 1.13 2005/03/14 22:04:31 pmarch 00044 // Added to namespace OSCAR and removed "RR" from front of class names. 00045 // 00046 // Revision 1.12 2005/01/21 20:24:28 chetan 00047 // Made Xform(bool , String) constructor explicit 00048 // 00049 // Revision 1.11 2005/01/06 20:46:49 chetan 00050 // Added Thread Local Storage to static variables 00051 // 00052 // Revision 1.10 2004/07/19 20:03:19 djung 00053 // DUMMY_ERROR fix fix 00054 // 00055 // Revision 1.9 2004/07/19 16:37:00 edjung 00056 // -made fix to constructors for ANSI C++ compliance with temporary OSCARError objects 00057 // -added DUMMY_ERROR class 00058 // 00059 // Revision 1.8 2004/05/26 20:01:52 pmarch 00060 // Added /defgroup and /ingroup tags. 00061 // 00062 // Revision 1.7 2004/01/26 20:54:31 pmarch 00063 // Fixed documentation errors as reported by Doxygen. 00064 // 00065 // Revision 1.6 2003/10/06 09:18:03 edjung 00066 // -Changed constructor to String() from String("") 00067 // 00068 // Revision 1.5 2003/09/09 17:13:02 eswint 00069 // - Changed #include "Math/..." to #include "..." 00070 // 00071 // Revision 1.4 2003/09/04 22:48:49 eswint 00072 // - Changed default arguments: OSCARError(0,"No Error"...) to OSCARError(noError) and String(" ") to String("") 00073 // 00074 // Revision 1.3 2003/09/02 20:50:32 eswint 00075 // no message 00076 // 00077 // Revision 1.2 2003/08/28 20:40:04 eswint 00078 // - Added default constructor argument bool initMtx = true 00079 // 00080 // Revision 1.1 2003/08/18 15:23:18 eswint 00081 // Initial Commit 00082 // 00083 // 00085 #ifndef Xform_hpp 00086 #define Xform_hpp 00087 00088 #include "HandPose.h" 00089 #include "FixedSizeMatrix.h" 00090 #include "Orientation.h" 00091 #include "Rot3by3.h" 00092 #include "SpatialXform.h" 00093 #include "Vector3.h" 00094 00096 namespace OSCAR { 00097 00106 class Xform : public FixedSizeMatrix<4,4> 00107 { 00108 public: 00109 00113 Xform(); 00114 00120 explicit Xform(bool identityMtx, const String& name=String()); 00121 00130 explicit Xform(const double* f, const String& name=String()); 00131 00147 explicit Xform(const Vector& v,OSCARError &err = DUMMY_ERROR(noError), const String& name = String()); 00148 00155 Xform(const Xform& rhs); 00156 00164 Xform(const Matrix& rhs); 00165 00171 virtual ~Xform(); 00172 00180 bool Get(Vector3& position) const; 00181 00190 bool Get(Orientation& orientation) const; 00191 00200 bool Get(Rot3by3& rotation) const; 00201 00210 bool Get(SpatialXform& spatial) const; 00211 00219 bool Get(HandPose& hp) const; 00220 00231 bool Get(Vector3& axis, double& angle, AngleUnits angUnits = Radians) const; 00232 00240 bool Get(Quaternion& quat) const; 00241 00249 bool Set(const Vector3& position); 00250 00258 bool Set(const Orientation& orientation); 00259 00268 bool Set(const Rot3by3& rotation); 00269 00277 bool Set(const SpatialXform& spatial); 00278 00286 bool Set(const HandPose& hp); 00287 00299 bool Set(const Vector3& axis, double angle, AngleUnits angUnits = Radians); 00300 00308 bool Set(const Quaternion& quat); 00309 00318 bool ToPumaOAT(HandPose& endLocation) const; 00319 00327 Xform& operator=(const Xform& rhs); 00328 00336 Xform& operator=(const Matrix& rhs); 00337 00346 Xform operator*(const Xform& m) const; 00347 00357 void Multiply(const Xform& m, Xform& result) const; 00358 00366 virtual bool Inverse(Xform& inverse) const; 00367 00374 Xform Inverse(void) const; 00375 00383 bool XformToForceXform(Matrix& forceXform); 00384 00391 Matrix XformToForceXform(); 00392 00393 bool Identity(); 00394 00399 bool IsValid() const; 00400 00409 bool Normalize(); 00410 00411 }; 00412 00413 #include "Xform.ipp" 00414 00415 } 00416 00417 #endif /* Xform_hpp */ 00418 00419
| RRG Homepage | OSCAR Overview | OSCAR Tutorials | Simulations |