Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ManipulatorData.h

Go to the documentation of this file.
00001 
00002 //
00003 //      Title           : ManipulatorData.h
00004 //      Project         : OSCAR
00005 //      Created         : November 3, 2004. 4:00 PM
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 related data for a manipulator
00028 //                         specified in XML format
00029 //
00030 //----------------------------------------------------------------------------
00031 //       $Log: ManipulatorData.h,v $
00032 //       Revision 1.14  2006/05/26 20:46:58  chetan
00033 //       Added SpecificationData
00034 //
00035 //       Revision 1.13  2006/03/29 23:21:48  chetan
00036 //       Added method   void  ManipulatorData::SetConfigurationsOfInterestAngleUnits(AngleUnits configAngleUnits)
00037 //
00038 //       Revision 1.12  2005/11/21 22:46:11  chetan
00039 //       Added Get/SetConfigurationsOfInterest methods
00040 //
00041 //       Revision 1.11  2005/09/30 01:57:54  chetan
00042 //       Added FramesOfInterest
00043 //
00044 //       Revision 1.10  2005/07/01 18:57:14  chetan
00045 //       Changed documentation
00046 //
00047 //       Revision 1.9  2005/06/29 04:30:35  chetan
00048 //       Quite a few changes to improve Output of XML and addition of custom root element names, addition of manipulator obstacle model, etc.
00049 //
00050 //       Revision 1.8  2005/06/22 02:25:51  chetan
00051 //       minor edits. documentation
00052 //
00053 //       Revision 1.7  2005/03/15 19:15:27  chetan
00054 //       Fixed Documentation
00055 //
00056 //       Revision 1.6  2005/03/15 19:10:44  chetan
00057 //       Added LimitsData member and associated methods
00058 //
00059 //       Revision 1.5  2005/03/14 21:52:31  pmarch
00060 //       Added to namespace OSCAR and removed "RR" from front of class names.
00061 //
00062 //       Revision 1.4  2005/01/13 01:23:10  chetan
00063 //       Fixed documentation
00064 //
00065 //       Revision 1.3  2004/11/09 16:42:27  chetan
00066 //       Added $Log in the file header to enable CVS version text
00067 //
00068 //
00070 #ifndef ManipulatorData_h
00071 #define ManipulatorData_h
00072 
00073 #include "FileData/XMLData.h"
00074 #include "FileData/XMLDHData.h"
00075 #include "Math/Xform.h"
00076 #include "FileData/LimitsData.h"
00077 #include "FileData/SpecificationsData.h"
00078 #include "ObstacleAvoidance/Node.hpp"
00079 
00080 XERCES_CPP_NAMESPACE_USE
00081 
00082 
00083 namespace OSCAR {
00084 
00092 class ManipulatorData : public XMLData
00093 {
00094   public:
00095   
00259     ManipulatorData(const String& inputFileName, OSCARError &err = DUMMY_ERROR(noError), const String& rootElementName = String("Manipulator"), const String name = String(" "));
00260 
00280   ManipulatorData(const char* xmlDataString, OSCARError &err = DUMMY_ERROR(noError), const String& rootElementName = String("Manipulator"), const String name = String(" "));
00281 
00298   ManipulatorData(const DOMElement* manipulatorNode, OSCARError &err = DUMMY_ERROR(noError), const String& rootElementName = String("Manipulator"), const String name = String(" "));
00299 
00300 
00308         ManipulatorData(const ManipulatorData& rhs);
00309 
00315         virtual ~ManipulatorData();
00316 
00324         ManipulatorData& operator=(const ManipulatorData& rhs);
00325 
00335         const XMLDHData* GetDHParameters() const;
00336 
00346   void  SetDHParameters(const XMLDHData& dhParameters);
00347 
00357         const LimitsData* GetLimits() const;
00358 
00368   void  SetLimits(const LimitsData& limits);
00369 
00370 
00379         const Xform* GetBasePose() const;
00380 
00390   void  SetBasePose(const Xform& basePose);
00391 
00400         const Xform* GetToolPlatePose() const;
00401 
00411   void  SetToolPlatePose(const Xform& toolPlatePose);  
00412 
00419   void  SetFramesOfInterest(const std::vector<Xform>& framesOfInterest);
00420 
00427   const std::vector<Xform>* GetFramesOfInterest() const;
00428 
00429 
00435   void  SetSpecifications(const SpecificationsData& specs);
00436 
00442   const SpecificationsData* GetSpecifications() const;
00443 
00444   
00450   class Configuration
00451   {
00452   public:
00453     Configuration() : jointValue(0)
00454     {}
00455 
00456           Configuration& operator=(const Configuration& rhs)
00457     {
00458       if(this != &rhs){
00459         if(jointValue){
00460           delete jointValue;
00461           jointValue = 0;
00462         }
00463         if(rhs.jointValue)
00464           jointValue = new Vector(*rhs.jointValue);
00465         configName = rhs.configName;
00466        }
00467       return *this;
00468     }
00469     Configuration(const Configuration& rhs) : jointValue(0)
00470     {
00471       if(rhs.jointValue)
00472         jointValue = new Vector(*rhs.jointValue);
00473       configName = rhs.configName;
00474     }
00475 
00476     ~Configuration()
00477     {
00478       if(jointValue)
00479         delete jointValue;
00480     }
00481     Vector* jointValue;
00482     String  configName;
00483   };
00484 
00491   void  SetConfigurationsOfInterest(const std::vector<Configuration>& configurationsOfInterest, AngleUnits angUnits = Degrees);
00492 
00499   const std::vector<Configuration>* GetConfigurationsOfInterest() const;
00500   AngleUnits GetConfigurationsOfInterestAngleUnits() const;
00501   void  SetConfigurationsOfInterestAngleUnits(AngleUnits angUnits);
00502 
00508         const Node* GetObstacleModel() const;
00509 
00516   void  SetObstacleModel(const Node& obstacleModel);
00517 
00518 
00530   bool  Output(std::ostream& out, bool nameSpaceHeader = false) const;
00531 
00532   protected:
00533    Xform    basePose;
00534    Xform    toolPlatePose;
00535    XMLDHData  *dhParameters;
00536    LimitsData *limitsData;
00537    Node* obstacleModel;
00538    std::vector< Xform >   framesOfInterest;   
00539    std::vector< Configuration > configurationsOfInterest;
00540    AngleUnits configurationOfInterestAngleUnits;
00541    SpecificationsData* specs;
00542 
00548    virtual bool parseParameters(const DOMElement* manipulatorNode);
00549    void  clearConfigurationsOfInterest();
00550 
00551 };
00552 
00553 }
00554 #endif  // ManipulatorData_h
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations