planners/sequential/PL_Sequential.h

Go to the documentation of this file.
00001 //## begin module%3752D78501D0.cm preserve=no
00002 //        %X% %Q% %Z% %W%
00003 //## end module%3752D78501D0.cm
00004 
00005 //## begin module%3752D78501D0.cp preserve=no
00006 //## end module%3752D78501D0.cp
00007 
00008 //## Module: PL_Sequential%3752D78501D0; Pseudo Package specification
00009 //## Source file: E:\mpk\code\Planners\PL_Sequential.h
00010 
00011 #ifndef PL_Sequential_h
00012 #define PL_Sequential_h 1
00013 
00014 //## begin module%3752D78501D0.additionalIncludes preserve=no
00015 //## end module%3752D78501D0.additionalIncludes
00016 
00017 #pragma warning( push )
00018 #pragma warning( disable : 4250 )
00019 
00020 //## begin module%3752D78501D0.includes preserve=yes
00021 //#include <stdafx.h>   //IMPROVE: this makes MFC happy, and now the order of includes is unimportant
00022 #include <stdio.h>
00023 #include <math.h>
00024 #include "Planners\sequential\sp3dstct.h"
00025 #include "Planners\sequential\spfiles.h"
00026 
00027 #ifdef PC_PROTO
00028 #include <planners\output\o_bitmap.h>
00029 #endif
00030 //## end module%3752D78501D0.includes
00031 
00032 // PL_Boolean_Output
00033 #include "Planners\PL_Boolean_Output.h"
00034 #include "Planners\PL_OpenGL.h"
00035 //## begin module%3752D78501D0.additionalDeclarations preserve=yes
00036 //## end module%3752D78501D0.additionalDeclarations
00037 
00038 
00039 //## begin PL_Sequential%3752D78501D0.preface preserve=yes
00040 //## end PL_Sequential%3752D78501D0.preface
00041 
00042 //## Class: PL_Sequential%3752D78501D0
00043 //      improve: both this and PL_Linear should derive from an
00044 //      intermediate class
00045 //## Category: Planners%36FB140B003C
00046 //## Persistence: Transient
00047 //## Cardinality/Multiplicity: n
00048 
00049 class PL_Sequential 
00050 : 
00051         public PL_Boolean_Output,  //## Inherits: <unnamed>%376A932700BA
00052         public PL_OpenGL
00053 {
00054   //## begin PL_Sequential%3752D78501D0.initialDeclarations preserve=yes
00055   //## end PL_Sequential%3752D78501D0.initialDeclarations
00056 
00057   public:
00058     //## Destructor (generated)
00059       virtual ~PL_Sequential();
00060 
00061           //draws the planner to the output window
00062           virtual bool DrawExplicit () const;
00063 
00064       //## Operation: Plan%928173143
00065       virtual bool Plan ();
00066 
00067       //## Operation: initialize_parameters%930592279
00068       void initialize_parameters ();
00069 
00070       //## Operation: SetCollisionDetector%933360621
00071       virtual void SetCollisionDetector (CD_BasicStyle* collisionDetector);
00072 
00073     // Additional Public Declarations
00074       //## begin PL_Sequential%3752D78501D0.public preserve=yes
00075       //## end PL_Sequential%3752D78501D0.public
00076   protected:
00077     // Additional Protected Declarations
00078       //## begin PL_Sequential%3752D78501D0.protected preserve=yes
00079       //## end PL_Sequential%3752D78501D0.protected
00080 
00081   private:
00082     // Additional Private Declarations
00083       //## begin PL_Sequential%3752D78501D0.private preserve=yes
00084           //FUNCTIONS
00085         void convert_angle_to_index() ;
00086         int rad_to_index(double angle) ;
00087         double index_to_rad( int index ) ;
00088         void allocate_space_for_link_cs(int L) ;
00089         void allocate_space_for_working_tq_path() ;
00090         void allocate_space_for_Link_tq_path(int link1, int length);
00091         void free_space_for_link_cs(int L);
00092         int plan_path_for_first_link() ;
00093         int plan_path_for_nth_link(     int lnkno, 
00094                                 TQLinkCSpace *ptqlink, 
00095                                 TQConfig *pblock,
00096                                 TQConfig *pblock_last, 
00097                                 int *bl, 
00098                                 int *BT_Flag, 
00099                                 int *block_flag,
00100                                 int *narrow_flag);
00101         char **malloc2D ( int dy , int dz , int oc );
00102         void retrieve_global_path(double **globalpath, int pathlen,
00103                            double *startdof, double *goaldof);
00104         void write_map(char *flnm, FileType filetype,
00105                 char **map, int dimx, int dimy, int bitsize);
00106         void write_global_path(char *flnm, int length, int degree, double **gpath);
00107         int smoothpath(int nb_degree, int intervals, double **dofpath, int *pathlen);
00108         int compute_a_column_for_link_cspace(TQLinkCSpace       *tqlcs,
00109                                                                                  int                    lnkno, 
00110                                                                                  int                    col, 
00111                                                                                  TQConfig               *para);
00112         void write_linkpath(char *flnm, FileType filetype,
00113                     char *map, int dim, int bitsize);
00114         void write_linkpathtxt(char *flnm,
00115                     TQConfig *map, int dim);
00116         void write_tqif(char *flnm, TQConfig tqi, TQConfig tqf);
00117         int compute_cspace_obstacle_map(int lnkno);
00118         void modify_cspace_obstacle_map(TQLinkCSpace    *ptqlink, 
00119                                 TQConfig        *tqi,
00120                                 TQConfig        *tqf, 
00121                                 TQConfig        *pblock,
00122                 int             len, 
00123                                 int             L1, 
00124                                 int             *BT_FLAG, 
00125                                 int             *narrow_flag);
00126         int find_main_path(     
00127                         int                             lnkno, 
00128                                                 IntPoint                *tqinitial, 
00129                                                 IntPoint                *tqfinal, 
00130                                                 TQLinkCSpace    *ptqlink, 
00131                                                 LinkPath                *result, 
00132                                                 int                             *narrow_flag);
00133         void find_forward_extension(    int             lnkno, 
00134                                                                 IntPoint        *tqinitial, 
00135                                                                 IntPoint        *tqfinal, 
00136                                                                 TQLinkCSpace    *ptqlink, 
00137                                                                 LinkPath        *result);
00138         void find_backward_extension(   int                     lnkno, 
00139                                                                 IntPoint        *tqinitial, 
00140                                                                 IntPoint        *tqfinal, 
00141                                                                 TQLinkCSpace    *ptqlink, 
00142                                                                 LinkPath        *result);
00143         void combine_three_paths(       LinkPath                *combpath, 
00144                                                         LinkPath                *mainpath, 
00145                                                         LinkPath                *frwdpath, 
00146                                                         LinkPath                *bkwdpath,
00147                                                         int                             *iposition, 
00148                                                         int                             *fposition);
00149         void reparameterize_path(       int             bound,
00150                                                                         LinkPath        *whole_path, 
00151                                                                         LinkPath        *result, 
00152                                                                         int             *ipos, 
00153                                                                         int             *fpos, 
00154                                                                         int             L1);
00155         int line_free(double **dofpath, int intervals, int start, int end,
00156                 double  **tmppath, int *path_len);
00157         int     shift_dofpath(double            **dofpath, 
00158                                   int                   pathlen, 
00159                                   double                **gpath, 
00160                                   int                   npathlen, 
00161                                   int                   pt1, 
00162                                   int                   pt2);
00163         void free2D(void **pp);
00164         void distance2d( unsigned char **in, int dimx, int dimy, short int **V, unsigned char **voro);
00165         void voro_heuristic2d(unsigned char             **in, 
00166                                           int                           dimx, 
00167                                           int                           dimy, 
00168                                           IntPoint                      goal, 
00169                                           short int                     **V, 
00170                                           unsigned char         **voro, 
00171                                           short int                     **heurpot, 
00172                                           int                           *flag);
00173         void find_path_by_heuristic(    LinkPath                *result, 
00174                                                                 short int       **heurpot, 
00175                                                                 int                     dimx, 
00176                                                                 int                     dimy, 
00177                                                                 IntPoint                *start, 
00178                                                                 IntPoint                *goal);
00179         double qdist(double     *q1, double     *q2);
00180         int insert (int xx, int yy, IntPoint **FRONT, IntPoint *PFRONT, int nbfront, short int **V);
00181         int deletemin (int xx, int yy, IntPoint **FRONT, int nbfront, short int **V);
00182 
00183         //DATA VARIABLES
00184         int     debug,                  // debug level  
00185         arm_degree,                             // Arm real degree              
00186         //dimx, dimy, dimz,             // Workspace working dimension  
00187         dimt[MAX_DEGREE],
00188         dimq[MAX_DEGREE];               // TxQ space working dimension  
00189 
00190         unsigned char   *wall;
00191 
00192         //double   COEFX, COEFY, COEFZ; // Coefficients converting real space to working space  
00193         double   COEFD_Q, COEFQ_D;              // Coefficients between angle to look-up table index    
00194 
00195         //double   *TCOS, *TSIN; (?)
00196 
00197         //Arm original_arm,     // First readed in arm          
00198         //      converted_arm,  /* arm converted into working space     */
00199         //      working_arm;    /* converted for working                */
00200 
00201         double     *orig_initial_config, *orig_final_config;  // Initial and final configurations       
00202         IntConfig       initial_config, final_config;  // Converted configuration in look-up space
00203         JointLimit      original_joint_limit[MAX_DEGREE];
00204         IntJointLimit   joint_limit[MAX_DEGREE];   // Joint limits              
00205 
00206         //unsigned char   **ws_map;     /* bitmap for obstacles         */
00207         //short int       **ws_dist;      /* distance map for the work space  */ 
00208         //unsigned char   **ws_voro;      /* voronoi diagram for the work space*/ 
00209         //short int     **link_map;
00210                         /* bitmap for links to check selfcollision */
00211         //short int     linkfill[MAX_DEGREE],   /* Fill selfcollision data */
00212         //      linkmask[MAX_DEGREE];   /* Selfcollision mask           */
00213 
00214         //FloatPoint    base;           /* converted base in working space */
00215         
00216         TQCSpace        tqcs;           // The Whole TxQ Cspace struct  
00217 
00218         LinkPath        *lnkcps, bkwdpath, frwdpath, mainpath, combpath; // Link Pathes in TxQ                  
00219 
00220         // Record t, q parameters in linkpath corresponding to
00221         // initial and final positions                          
00222         TQConfig        initial_tq[MAX_DEGREE], final_tq[MAX_DEGREE];
00223 
00224         double          **globalpath;
00225         int     globaldim;
00226 
00227         char            datadir[40];
00228 
00229         int             max_level, max_bt_no;  // Planner control parameters    
00230 
00231         int     sp_debug_level;  // Debug Control 
00232         double distance_detect_range;
00233         //double link_radius[MAX_DEGREE+1];
00234 
00235         int BT_level, BT_level_test, BT_number[MAX_BACKTRACKING_LEVEL+2]; //in plannr3d.cpp
00236 
00237       //## end PL_Sequential%3752D78501D0.private
00238   private: //## implementation
00239     // Additional Implementation Declarations
00240       //## begin PL_Sequential%3752D78501D0.implementation preserve=yes
00241       //## end PL_Sequential%3752D78501D0.implementation
00242 
00243 };
00244 
00245 //## begin PL_Sequential%3752D78501D0.postscript preserve=yes
00246 //## end PL_Sequential%3752D78501D0.postscript
00247 
00248 // Class PL_Sequential 
00249 
00250 //## begin module%3752D78501D0.epilog preserve=yes
00251 //## end module%3752D78501D0.epilog
00252 
00253 #pragma warning( pop )
00254 #endif

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