00001 00002 // 00003 // Title : DHData.h 00004 // Project : OSCAR 00005 // Created : 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 : Class for loading DH Parameters from file 00028 // 00029 //---------------------------------------------------------------------------- 00030 // 00031 // $Revisions$ 00032 // - 2/26/97 Mitch Pryor modified for SG compilation 00033 // - 3/10/01 Added Additional constructor 00034 // 00035 // $Log: DHData.h,v $ 00036 // Revision 1.13 2006/03/30 19:15:56 chetan 00037 // GetAngleUnits added 00038 // 00039 // Revision 1.12 2005/04/06 20:45:20 chetan 00040 // Re-added virtual inheritance from RobotData 00041 // 00042 // Revision 1.11 2005/03/18 23:28:05 chetan 00043 // Removed virtual inheritance and fixed ambiguity in base class method calls 00044 // 00045 // Revision 1.10 2005/03/18 20:55:23 chetan 00046 // Enabled W4 level warnings and fixed warnings 00047 // 00048 // Revision 1.9 2005/03/14 21:52:28 pmarch 00049 // Added to namespace OSCAR and removed "RR" from front of class names. 00050 // 00051 // Revision 1.8 2005/01/13 01:23:09 chetan 00052 // Fixed documentation 00053 // 00054 // Revision 1.7 2004/11/15 21:04:37 chetan 00055 // Added addition Set and Get method. Added Update method 00056 // 00057 // Revision 1.6 2004/11/11 23:19:50 chetan 00058 // Fixed documentation, operator=, anc const ref constructors 00059 // 00060 // Revision 1.5 2004/11/05 17:33:03 chetan 00061 // Added a constructor that allows the creation of a DHData object that does not hold any DH parameters. Added methods to modify the stored DH parameters. 00062 // 00063 // Revision 1.4 2004/07/23 20:13:41 chetan 00064 // Changes to Conform with Warning Level 4 and latest g++ and .NET compilation 00065 // 00066 // Revision 1.3 2004/06/04 20:23:25 chetan 00067 // Changed cout, cin, *stream to std::cout, std::cin, std::*stream 00068 // 00069 // Revision 1.2 2004/05/26 19:51:34 pmarch 00070 // Added /defgroup and /ingroup tags. 00071 // 00072 // Revision 1.1 2003/08/18 20:26:39 eswint 00073 // Initial Commit 00074 // 00075 // 00077 #ifndef DHData_h 00078 #define DHData_h 00079 00080 #include "FileData/RobotData.h" 00081 #include "Math/Matrix.h" 00082 00084 namespace OSCAR { 00085 00098 class DHData : public virtual RobotData 00099 { 00100 public: 00101 00108 enum DHDataFormat 00109 { 00110 Craig, 00111 Paul 00112 }; 00113 00114 00115 //Either of these variables should be used to specify whether a particular joint is 00116 //prismatic or revolute. This is done while creating an Matrix which is used to create 00117 //an DHData object. 00118 static const double var, VAR; 00119 00166 DHData(const String& filename, 00167 OSCARError &err = DUMMY_ERROR(noError), 00168 char commentMarker = '#', const String name = String(" ")); 00169 00193 DHData(const Matrix& dhParams, AngleUnits angUnits = Degrees, DHDataFormat dhFormat = Craig, 00194 OSCARError &err = DUMMY_ERROR(noError), 00195 const String name = String(" ")); 00205 DHData(OSCARError &err = DUMMY_ERROR(noError), const String name = String(" ")); 00206 00207 00215 DHData(const DHData& rhs); 00216 00222 virtual ~DHData(); 00223 00231 DHData& operator=(const DHData& rhs); 00232 00244 unsigned int GetDOF(void) const; 00245 00262 const Matrix* GetParameters() const; 00263 00289 bool SetParameters(const Matrix& dhParams, AngleUnits angUnits = Degrees, DHDataFormat dhFormat = Craig); 00290 00291 AngleUnits GetAngleUnits() const {return angleUnits; } 00292 void SetAngleUnits(AngleUnits angUnits) {angleUnits = angUnits;} 00293 00310 double operator()(unsigned int jointNumber, unsigned int col) const; 00311 00324 char GetJointType(unsigned int jointNumber) const; 00325 00337 DHDataFormat GetDHDataFormat() const; 00338 00349 void SetDHDataFormat(DHDataFormat dhFormat); 00350 00351 protected: 00352 Matrix *dhparameters; //a matrix of DH paramateres 00353 char *joint_type; //holds data about joint type (P or R) 00354 unsigned int DOF; //number of DOF 00355 DHDataFormat dhFormat; //format of data 00356 AngleUnits angleUnits; // degree or radian to express DH angles 00357 00358 private: 00359 00360 00369 void loadparameters(std::ifstream& fileStream, const char commentMarker); 00370 00378 void toLowerCase(char* inputString, char* outputString); 00379 00380 }; 00381 00391 extern std::ostream& operator<<(std::ostream& out,const DHData& D); 00392 00393 #include "FileData/DHData.ipp" 00394 00395 } 00396 00397 #endif // DHData_h
| RRG Homepage | OSCAR Overview | OSCAR Tutorials | Simulations |