From 574d789a55081b6531c32d9986508b2264e60120 Mon Sep 17 00:00:00 2001 From: americast Date: Sat, 30 Sep 2017 14:31:40 +0530 Subject: [PATCH] Match original RRT with modified class --- include/RRT_implementation.hpp | 37 ++++++++++++++++++++++------------ src/main.cpp | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/include/RRT_implementation.hpp b/include/RRT_implementation.hpp index 5e9bbd9..a07b128 100644 --- a/include/RRT_implementation.hpp +++ b/include/RRT_implementation.hpp @@ -25,9 +25,9 @@ namespace rrt } template - std::deque > RRT::getPointsOnPath() + std::vector > RRT::getPointsOnPath() { - return pathPoints; + return finalPath; } template @@ -42,6 +42,12 @@ namespace rrt maxIterations=value; } + template + void RRT::setObstacleRadius(int value) + { + obstacleradius=value; + } + template bool RRT:: plan() { @@ -54,11 +60,14 @@ namespace rrt Utils::Point next; int arr[]={1}; std::pair ,Utils::Point > mid = treeComplete(arr); + std::pair ,int > both; + // Utils::Point both; if(mid.first!=mid.second) { std::cout<<"Tree complete!!"<, Utils::Point > (next,parent)); + tree.push_back( std::pair< Utils::Point, Utils::Point > (next,parent.first)); //std::cout<<"Tree grown"< - bool RRT::checkPoint(Utils::Point next) + bool RRT::checkPoint(Utils::Point first, Utils::Point next) { return userCheck(next); } @@ -204,12 +215,12 @@ namespace rrt void RRT::generatePath(Utils::Point first,Utils::Point last) { Utils::Point cur=last; - pathPoints.push_back(cur); + finalPath.push_back(cur); while(cur!=first || cur!=startPoint) { Utils::Point parent= getParent(cur); //std::cout<<"current : "< > path=test.getPointsOnPath(); + vector > path=test.getPointsOnPath(); for(int i=0;i