/** * planrpf.C * * Planner using Random Potential Field * Com Sci 476 * Nick Mayer & Shaun Jurgemeyer */ #include #include // This includes the core header files of the Motion Strategy Library #include #include #include "randpfield.h" // The next include should appear before the actual code in a file using LEDA. // It locally uses short names like vector, list, etc., but does not cause // name conflicts globally, assuming the last line UNDEFINE's the names. #include /* * Lanuches the GUI for the planner with our RPF as the default planner */ int main(int argc, char *argv[]) { string path; GuiPlanner *gui; Model *m = NULL; Geom *g = NULL; Problem *prob; if (argc < 2) { cout << "Try this: planrpf ~cs352/data/M-2d" << endl; exit(-1); } path = string(argv[1])+"/"; if (!is_directory(path)) { cout << "Error: Directory does not exist\n"; exit(-1); } SetupProblem(m,g,path); prob = new Problem(g,m,path); // Create our planner, initilized with the default values RandPField *rpf = new RandPField(prob); /* The default is: rpf->init(50, // numberOfRandomStates 15, // stuckPathsize 3, // numberOfBounces 100, // numberOfBounceSteps 50, // backtrackLength 50/1, // stuckRatio 1, // translationStepSize 1 / (2* 3.1416), // RotationStepSize 3, // smoothingIterations false); // forceHolonomic */ // Modify the constants if desired rpf->init(50, // numberOfRandomStates 15, // stuckPathsize 3, // numberOfBounces 100, // numberOfBounceSteps 50, // backtrackLength 50/1, // stuckRatio 1, // translationStepSize 1 / (2* 3.1416), // RotationStepSize 3, // smoothingIterations true); // forceHolonomic // Create the GUI gui = new GuiPlanner(new RenderGL(new Scene(prob, path), path), rpf); // Activate & display the GUI gui->Start(); return 0; } // end main // Undefine the short leda names (e.g., vector now becomes leda_vector) #include