00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) 1998-2001 Iowa State University and Steve 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 // Iowa State University 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 <math.h> 00020 #include <stdlib.h> 00021 00022 // This includes the core header files of the Motion Strategy Library 00023 #include <MSL/MSL.h> 00024 #include <MSL/rendergl.h> 00025 00026 // This includes the new model called Model3DRigidHelical 00027 #include "modelnew.h" 00028 00029 // The next include should appear before the actual code in a file using LEDA. 00030 // It locally uses short names like vector, list, etc., but does not cause 00031 // name conflicts globally, assuming the last line UNDEFINE's the names. 00032 #include <LEDA/REDEFINE_NAMES.h> 00033 00034 int main(int argc, char *argv[]) 00035 { 00036 string path; 00037 GuiPlanner *gui; 00038 Model *m = NULL; 00039 Geom *g = NULL; 00040 Problem *prob; 00041 00042 if (argc < 2) { 00043 cout << "Try this: helical data\n"; 00044 exit(-1); 00045 } 00046 00047 path = string(argv[1])+"/"; 00048 00049 if (!is_directory(path)) { 00050 cout << "Error: Directory does not exist\n"; 00051 exit(-1); 00052 } 00053 00054 m = new Model3DRigidHelical(path); // Define the differential model 00055 g = new GeomPQP3DRigid(path); // Use PQP and 3D triangle representations 00056 prob = new Problem(g,m,path); // This is the input to a planner 00057 00058 // Initialize everything: Gui, Scene, Render, and RRT 00059 // All of them will use the same file path 00060 gui = new GuiPlanner(new RenderGL(new Scene(prob, path), path), 00061 new RRTConCon(prob)); 00062 00063 // Activate the GUI 00064 gui->Start(); 00065 00066 return 0; 00067 } 00068 00069 00070 // Undefine the short leda names (e.g., vector now becomes leda_vector) 00071 00072 #include <LEDA/UNDEFINE_NAMES.h>