00001
00002
00003
00004 #include <iostream>
00005 #include <sbpl_arm_planner/bfs_3d.h>
00006
00007 using namespace std;
00008
00009 int main(int argc, char *argv[])
00010 {
00011 if(argc < 4)
00012 {
00013 printf("Error: Goal must be passed as parameter\n");
00014 return 0;
00015 }
00016
00017 std::vector<short unsigned int> goal(3,0);
00018 BFS3D bfs(100,100,100,4,10);
00019
00020 bfs.init();
00021
00022 goal[0] = atoi(argv[1]);
00023 goal[1] = atoi(argv[2]);
00024 goal[2] = atoi(argv[3]);
00025
00026
00027 if(!bfs.setGoal(goal))
00028 {
00029 printf("Error setting goal. Please input a valid goal location.\n");
00030 return 0;
00031 }
00032
00033 if(!bfs.runBFS())
00034 {
00035 printf("Running BFS failed.\n");
00036 return 0;
00037 }
00038
00039
00040
00041
00042 std::vector<short unsigned int> start(3,0);
00043 start[0] = 0;
00044 start[1] = 3;
00045 start[2] = 5;
00046 std::vector<std::vector<int> > path;
00047 printf("Calling getShortestPath()\n");
00048
00049 bfs.getShortestPath(start,path);
00050
00051 printf("Returned from getShortestPath()\n");
00052
00053 return 1;
00054 }
00055