00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) University of Illinois and Steven M. LaValle. 00006 // All Rights Reserved. 00007 // 00008 // Permission to use, copy, and distribute this software and its 00009 // documentation is hereby granted free of charge, provided that 00010 // (1) it is not a component of a commercial product, and 00011 // (2) this notice appears in all copies of the software and 00012 // related documentation. 00013 // 00014 // The University of Illinois and the author make no representations 00015 // about the suitability or fitness of this software for any purpose. 00016 // It is provided "as is" without express or implied warranty. 00017 //---------------------------------------------------------------------- 00018 00019 #ifndef MSL_MODEL3D_H 00020 #define MSL_MODEL3D_H 00021 00022 #include <vector.h> 00023 00024 #include "model.h" 00025 #include "matrix.h" 00026 00028 class Model3D: public Model { 00029 public: 00030 Model3D(string path); 00031 virtual ~Model3D() {} 00032 }; 00033 00034 00035 00037 class Model3DRigid: public Model3D { 00038 public: 00039 Model3DRigid(string path); 00040 virtual ~Model3DRigid() {} 00041 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00042 MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00043 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00044 virtual MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00045 const double &a); // Depends on topology 00046 }; 00047 00048 00050 class Model3DRigidMulti: public Model3DRigid { 00051 public: 00052 int NumBodies; 00053 Model3DRigidMulti(string path); 00054 virtual ~Model3DRigidMulti() {} 00055 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00056 virtual MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00057 const double &a); // Depends on topology 00058 }; 00059 00060 00072 00073 class Model3DRigidChain: public Model3DRigid { 00074 public: 00076 int NumBodies; 00077 00079 MSLVector DH; 00080 00081 vector<int> StateIndices; 00082 00083 Model3DRigidChain(string path); 00084 virtual ~Model3DRigidChain() {}; 00085 virtual MSLVector StateTransitionEquation(const MSLVector &x, 00086 const MSLVector &u); 00087 virtual MSLVector StateToConfiguration(const MSLVector &x); 00088 virtual MSLVector LinearInterpolate(const MSLVector &x1, 00089 const MSLVector &x2, 00090 const double &a); 00091 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00092 virtual bool Satisfied(const MSLVector &x); 00093 }; 00094 00095 00111 00112 class Model3DRigidTree: public Model3DRigid { 00113 public: 00115 int NumBodies; 00116 00118 MSLVector DH; 00119 00120 vector<int> StateIndices; 00121 00122 vector<int> Parents; 00123 00124 Model3DRigidTree(string path); 00125 virtual ~Model3DRigidTree() {}; 00126 virtual MSLVector StateTransitionEquation(const MSLVector &x, 00127 const MSLVector &u); 00128 virtual MSLVector StateToConfiguration(const MSLVector &x); 00129 virtual MSLVector LinearInterpolate(const MSLVector &x1, 00130 const MSLVector &x2, 00131 const double &a); 00132 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00133 virtual bool Satisfied(const MSLVector &x); 00134 }; 00135 00136 00137 #endif