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 #include <fstream> 00020 #include <math.h> 00021 #include <vector> 00022 using namespace std; 00023 00024 #include <MSL/vector.h> 00025 #include <MSL/tree.h> 00026 #include <MSL/rrt.h> 00027 #include <MSL/defs.h> 00028 00030 class RRTSlide: public RRTCon { 00031 public: 00032 RRTSlide(Problem *p); 00033 virtual ~RRTSlide() {}; 00034 00035 int RandomTrials; 00036 int NumDirections; 00037 vector<MSLVector> RandomDirections; 00038 00040 virtual MSLVector SelectInput(const MSLVector &x1, const MSLVector &x2, 00041 MSLVector &nx_best, 00042 bool &success, bool forward); 00043 00045 virtual bool Connect(const MSLVector &x, MSLTree *t, MSLNode *&nn, 00046 bool forward); 00047 00048 MSLVector RandomDirection(); 00049 }; 00050 00051 00052 00053 00054 00055