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_MODEL2D_H 00020 #define MSL_MODEL2D_H 00021 00022 #include "model.h" 00023 00025 class Model2D: public Model { 00026 public: 00027 Model2D(string path); 00028 virtual ~Model2D() {}; 00029 virtual MSLVector StateToConfiguration(const MSLVector &x); 00030 }; 00031 00032 00034 class Model2DPoint: public Model2D { 00035 public: 00036 Model2DPoint(string path); 00037 virtual ~Model2DPoint() {}; 00038 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00039 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00040 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00041 }; 00042 00043 00045 class Model2DPointCar: public Model2DPoint { 00046 public: 00047 double MaxSteeringAngle; 00048 double CarLength; 00049 Model2DPointCar(string path); 00050 virtual ~Model2DPointCar() {}; 00051 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00052 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00053 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00054 }; 00055 00056 00058 class Model2DRigid: public Model2D { 00059 public: 00060 Model2DRigid(string path); 00061 virtual ~Model2DRigid() {}; 00062 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00063 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00064 MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00065 const double &a); 00066 virtual MSLVector StateDifference(const MSLVector &x1, const MSLVector &x2); 00067 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00068 virtual MSLVector StateToConfiguration(const MSLVector &x); 00069 }; 00070 00071 00073 class Model2DRigidCar: public Model2DRigid { 00074 public: 00075 double MaxSteeringAngle; 00076 double CarLength; 00077 Model2DRigidCar(string path); 00078 virtual ~Model2DRigidCar() {}; 00079 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00080 }; 00081 00082 00084 class Model2DRigidCarForward: public Model2DRigidCar { 00085 public: 00086 Model2DRigidCarForward(string path); 00087 virtual ~Model2DRigidCarForward() {}; 00088 }; 00089 00090 00093 class Model2DRigidCarSmooth: public Model2DRigidCar { 00094 public: 00095 double SteeringSpeed; 00096 Model2DRigidCarSmooth(string path); 00097 virtual ~Model2DRigidCarSmooth() {}; 00098 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00099 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00100 virtual MSLVector StateToConfiguration(const MSLVector &x); 00101 virtual bool Satisfied(const MSLVector &x); 00102 }; 00103 00107 class Model2DRigidCarSmoothTrailer: public Model2DRigidCarSmooth { 00108 public: 00109 double HitchLength; 00110 double HitchMaxAngle; 00111 Model2DRigidCarSmoothTrailer(string path); 00112 virtual ~Model2DRigidCarSmoothTrailer() {}; 00113 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00114 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00115 virtual MSLVector StateToConfiguration(const MSLVector &x); 00116 virtual bool Satisfied(const MSLVector &x); 00117 }; 00118 00119 00121 class Model2DRigidCarSmooth2Trailers: public Model2DRigidCarSmoothTrailer { 00122 public: 00123 double Hitch2Length; 00124 double Hitch2MaxAngle; 00125 Model2DRigidCarSmooth2Trailers(string path); 00126 virtual ~Model2DRigidCarSmooth2Trailers() {}; 00127 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00128 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00129 virtual MSLVector StateToConfiguration(const MSLVector &x); 00130 virtual bool Satisfied(const MSLVector &x); 00131 }; 00132 00133 00135 class Model2DRigidCarSmooth3Trailers: public Model2DRigidCarSmooth2Trailers { 00136 public: 00137 double Hitch3Length; 00138 double Hitch3MaxAngle; 00139 Model2DRigidCarSmooth3Trailers(string path); 00140 virtual ~Model2DRigidCarSmooth3Trailers() {}; 00141 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00142 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00143 virtual MSLVector StateToConfiguration(const MSLVector &x); 00144 virtual bool Satisfied(const MSLVector &x); 00145 }; 00146 00147 00148 00152 class Model2DRigidDyncar: public Model2DRigid { 00153 public: 00155 double Mass; 00156 00158 double CAF; 00159 00161 double CAR; 00162 00164 double Adist; 00165 00167 double Bdist; 00168 00170 double Izz; 00171 00173 double WorldScale; 00174 00176 double MaxSteeringAngle; 00177 00179 double Speed; 00180 00181 Model2DRigidDyncar(string path); 00182 virtual ~Model2DRigidDyncar() {}; 00183 MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00184 virtual MSLVector StateToConfiguration(const MSLVector &x); 00185 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00186 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00187 virtual MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00188 const double &a); 00189 virtual MSLVector StateDifference(const MSLVector &x1, const MSLVector &x2); 00190 }; 00191 00192 00195 class Model2DRigidDyncarNtire: public Model2DRigidDyncar { 00196 public: 00197 00199 double Mu; 00200 00202 double Nf; 00203 00205 double Nr; 00206 00207 Model2DRigidDyncarNtire(string path); 00208 virtual ~Model2DRigidDyncarNtire() {}; 00209 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00210 }; 00211 00212 00216 class Model2DRigidLander: public Model2DRigid { 00217 public: 00219 double Mass; 00220 00222 double G; 00223 00225 double Fs; 00226 00228 double Fu; 00229 00230 Model2DRigidLander(string path); 00231 virtual ~Model2DRigidLander() {}; 00232 virtual MSLVector StateToConfiguration(const MSLVector &x); 00233 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00234 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00235 MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00236 const double &a); 00237 virtual MSLVector StateDifference(const MSLVector &x1, const MSLVector &x2); 00238 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00239 }; 00240 00241 00242 00244 class Model2DRigidMulti: public Model2DRigid { 00245 public: 00247 int NumBodies; 00248 00249 Model2DRigidMulti(string path); 00250 virtual ~Model2DRigidMulti() {} 00251 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00252 virtual MSLVector StateToConfiguration(const MSLVector &x); 00253 virtual MSLVector LinearInterpolate(const MSLVector &x1, const MSLVector &x2, 00254 const double &a); // Depends on topology 00255 virtual MSLVector StateDifference(const MSLVector &x1, const MSLVector &x2); 00256 virtual MSLVector Integrate(const MSLVector &x, const MSLVector &u, const double &h); 00257 }; 00258 00259 00261 class Model2DRigidChain: public Model2DRigid { 00262 public: 00264 int NumBodies; 00265 00267 MSLVector A; 00268 00270 double StopAngle; 00271 00272 Model2DRigidChain(string path); 00273 virtual ~Model2DRigidChain() {}; 00274 virtual MSLVector StateToConfiguration(const MSLVector &x); 00275 virtual MSLVector StateTransitionEquation(const MSLVector &x, const MSLVector &u); 00276 virtual double Metric(const MSLVector &x1, const MSLVector &x2); 00277 virtual bool Satisfied(const MSLVector &x); 00278 }; 00279 00280 00281 #endif 00282 00283