planners/sandros/PL_Sandros.h

Go to the documentation of this file.
00001 //Sandros Planner Implemetation header file,
00002 //Start at April 20
00003 //By Huang Yifeng 
00004 
00005 #ifndef PL_Sandros_h
00006 #define PL_Sandros_h 1
00007 
00008 #pragma warning ( disable : 4250 )
00009 
00010 //#include "Planners\PL_Boolean_Output.h"
00011 //#include "Planners\PL_OpenGL.h"
00012 #include "Planners\PL_GraphBase.h"
00013 
00014 // Additional LEDA Classes
00015 #include <LEDA/node_map.h>
00016 #include <LEDA/node_pq.h>
00017 #include <LEDA/node_set.h>
00018 #include <LEDA/queue.h>
00019 
00020 #define NODEINU true
00021 #define NODEINV false
00022 #define LEDA_CHECKING_OFF
00023 //-----------------------------------------------------------------------------
00024 //
00025 // PL_Sandros
00026 //
00027 // this class represents a SANDROS style planner
00028 //
00029 //-----------------------------------------------------------------------------
00030 
00031 enum NodeInUVorPsPt{
00032         NodeInU,
00033         NodeInV,
00034         NodeInPs,
00035         NodeInPt,
00036         Nothing
00037 };
00038 
00039 class PL_Sandros
00040 : 
00041 //      public PL_Boolean_Output, //## Inherits: <unnamed>%376A93290334
00042 //  virtual public PL_OpenGL  //## Inherits: <unnamed>%3980C6E702E4
00043 //      Change the base class here
00044         public PL_GraphBase
00045 {
00046 public:
00047 
00048         PL_Sandros();
00049         //## Destructor (generated)
00050         virtual ~PL_Sandros();
00051 
00052         //Plan - this function is called when the user presses the plan button
00053         virtual bool Plan ();
00054 
00055         //Save - this function is called when the MPK tries to save the planner's state
00056         virtual bool Save (const char *filename) const;
00057         //Load - this function loads up a file that was previously saved with "Save"
00058         virtual bool Load (const char *filename);
00059 
00060         //DrawExplicit - this function contains the GL calls to draw the planner 
00061         virtual bool DrawExplicit () const;
00062 
00063         virtual void SetStartConfig( const Configuration& config );
00064         virtual void SetGoalConfig ( const Configuration& config );
00065 
00066         virtual void SetCollisionDetector (CD_BasicStyle* collisionDetector);
00067 
00068         virtual void ClearGraph();
00069         
00070         int GetRefinedNode (int i);
00071         void SetValue(int m_Grid,int m_Neighbor,int m_Tolerance);
00072 
00073 protected:
00074         //statue indicator
00075         SuccessResultType plan_success;         // Indicates if the planner has been successful in finding a path
00076         BOOL m_bNoOtherSequence;                        //if true then go to the node refinement
00077         BOOL m_bResolutionLimit;                        //if true, means that all the nodes in Q have been refined
00078         
00079         //Date structer used in Sandros
00080         node_pq<int>*   m_quenQ;        // pointer to open priority queue, store the nodes that need to be refined
00081         
00082 
00083         node_map<node>  m_nodePs;
00084         queue<node>* m_quenQ1;          //addtional queue to store nodes to be refined
00085 
00086         node_map<node>  m_nodePt;
00087         node_map<int>   m_refine_level;         //
00088         node_map<bool>  m_nodeInPsIsland;
00089 
00090         node_map<Configuration> m_nodeInUPs;
00091 
00092         node_map<NodeInUVorPsPt>        m_nodeUVPsPt;
00093         edge_map<bool> m_bEdgeHiden;
00094 
00095         edge_array<double>      m_c;
00096 
00097         //local copy of sandros environment
00098         int Tolerance;
00099         int seedofa;
00100         int dof;
00101         int current_res;
00102         double ThreshHold;
00103         double stride;
00104         int nextNo;
00105         Configuration NodeRefinedc;
00106         node NodeRefined;
00107 
00108 protected:
00109         //imeplemtation
00110         void ConstructGraph();
00111         bool SearchForSequence(node_list& L);
00112         double DistanceSandros(const node& n1,const node& n2);
00113         void InitailizeGraph();
00114         void DealwithSequence(const node_list& L);
00115         edge FindEdgeBetweenTwoNodes(const node& n1,const node& n2);
00116         void SaveSandrosPath(const node_list& L);
00117         node GenerateNewNode(int res,const node n1);
00118         bool IsInterferingSan(const Configuration& n1,const node& n2,Configuration& p);         //here use a linear path use as local planner
00119         bool IsNeighber(const node& n3,const node& n2);
00120         node GenerateNewNodeGrid(int res,const node n1,int no);
00121         node FindNextNodeToRefined();
00122         bool IsNeighberSan(const Configuration& c1,const node& n2);
00123 
00124 };
00125 
00126 #endif

Generated on Sat Apr 1 21:30:46 2006 for Motion Planning Kernel by  doxygen 1.4.6-NO