]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Make `steer` procedure part of RRTBase
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 10 Dec 2018 09:30:25 +0000 (10:30 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 10 Dec 2018 09:35:48 +0000 (10:35 +0100)
CHANGELOG.md
CMakeLists.txt
README.md
base/rrtbase.cc
decision_control/rrtplanner.cc
incl/compile.h
incl/rrtbase.h
incl/rrtplanner.h

index 775ee3ac39e0109bfb3cf5fd403d27019daa8ec9..baf29d1f7e773136d58ba5dae2a5a8ad25f4b990 100644 (file)
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog][] and this project adheres to
 - Make `cost` function part of RRTBase.
 - Make `nn` procedure part of RRTBase.
 - Make `nv` procedure part of RRTBase.
+- Make `steer` procedure part of RRTBase.
 
 ## 0.3.0 - 2018-12-03
 ### Added
index aa86fb12572ed1285bf9d9c583f07ec27235ac8b..96a22eeaef5d5521f1d677e4d3557d14b2c36f5a 100644 (file)
@@ -7,9 +7,6 @@ ENDIF(PLANNER)
 IF(TMAX)
         ADD_DEFINITIONS(-DTMAX=${TMAX})
 ENDIF(TMAX)
-IF(ST)
-        ADD_DEFINITIONS(-DST=${ST})
-ENDIF(ST)
 
 find_package(OpenMP)
 if (OPENMP_FOUND)
index aad8cf6b30985f82a83156234364ff42213c4764..2caf1fc47c57c662b628ebb1b4666fd153f6e438 100644 (file)
--- a/README.md
+++ b/README.md
@@ -33,11 +33,12 @@ The list of available macros with values:
         - `Kuwata2008` - RRT with changing cost and steering to goal.
         - `Karaman2011` - RRT* framework.
 - `TMAX` - Specify the upper time bound in seconds.
-- `ST`
-        - `st1` - Steer directly to goal.
-        - `st2` - Steer with maximum turning radius and direction in mind.
-        - `st3` - Reeds and Shepp steer procedure.
-        - `st4` - Very basic closed-loop simulator.
+
+Implemented Steering procedures:
+- `st1` - Steer directly to goal.
+- `st2` - Steer with maximum turning radius and direction in mind.
+- `st3` - Reeds and Shepp steer procedure.
+- `st4` - Very basic closed-loop simulator.
 
 To disable *OpenMP*, add `-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE` to `cmake`
 command or to `build.sh` script.
index 47465c8fafec72bc2e3648df3755ae96cfbad6d2..6719101183e2b7282ec9f5df88b7ddf3b7019039 100644 (file)
@@ -717,3 +717,8 @@ std::vector<RRTNode *> RRTBase::nv(RRTNode *node, float dist)
         }
         return nvs;
 }
+
+std::vector<RRTNode *> RRTBase::steer(RRTNode *init, RRTNode *goal)
+{
+        return st3(init, goal);
+}
index 1f8d63def1b17d475383015e7df106a04b491eaf..b1fa6e98c958f8af25549d2d69bde08226290f7f 100644 (file)
@@ -32,8 +32,7 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #define KUWATA2008_DCOST CO
 
 LaValle1998::LaValle1998(RRTNode *init, RRTNode *goal):
-        RRTBase(init, goal),
-        steer(ST)
+        RRTBase(init, goal)
 {
         srand(static_cast<unsigned>(time(0)));
 }
@@ -79,8 +78,7 @@ bool LaValle1998::next()
 }
 
 Kuwata2008::Kuwata2008(RRTNode *init, RRTNode *goal):
-        RRTBase(init, goal),
-        steer(ST)
+        RRTBase(init, goal)
 {
         srand(static_cast<unsigned>(time(0)));
 }
@@ -166,8 +164,7 @@ bool Kuwata2008::next()
 }
 
 Karaman2011::Karaman2011(RRTNode *init, RRTNode *goal):
-        RRTBase(init, goal),
-        steer(ST)
+        RRTBase(init, goal)
 {
         srand(static_cast<unsigned>(time(0)));
 }
@@ -284,8 +281,7 @@ bool Karaman2011::rewire(std::vector<RRTNode *> nvs, RRTNode *ns)
 }
 
 T1::T1(RRTNode *init, RRTNode *goal):
-        RRTBase(init, goal),
-        steer(ST)
+        RRTBase(init, goal)
 {
         srand(static_cast<unsigned>(time(0)));
 }
@@ -583,7 +579,6 @@ bool T3::overlaptrees(RRTNode **ron, RRTNode **gon)
 
 Klemm2015::Klemm2015(RRTNode *init, RRTNode *goal):
         Karaman2011(init, goal),
-        steer(ST),
         orig_root_(init),
         orig_goal_(goal)
 {
index 9843a1cf2f217f111941789eb080b04a734e33b0..c32f63dd1973e8e54e9cd14554d46e121e3b6f25 100644 (file)
@@ -26,8 +26,4 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #define TMAX 10
 #endif
 
-#ifndef ST
-#define ST st1
-#endif
-
 #endif
index b183c59bf394482a4f031b2ce5372889e959a1bc..961b62633afd4f6634e576866d11a57c97e2d1cb 100644 (file)
@@ -105,6 +105,7 @@ class RRTBase {
                 float cost(RRTNode *init, RRTNode *goal);
                 RRTNode *nn(RRTNode *rs);
                 std::vector<RRTNode *> nv(RRTNode *node, float dist);
+                std::vector<RRTNode *> steer(RRTNode *init, RRTNode *goal);
 
                 // virtuals - implemented by child classes
                 virtual bool next() = 0;
index 63e8b33eedd8eb33cdd528989be795e1c4bcbbae..824c153eecf45d75e493b184512c8aa8f3d41b75 100644 (file)
@@ -28,22 +28,12 @@ class LaValle1998: public RRTBase {
         public:
                 //using RRTBase::RRTBase;
                 LaValle1998(RRTNode *init, RRTNode *goal);
-
-                // RRT framework
-                std::vector<RRTNode *> (*steer)(
-                                RRTNode *init,
-                                RRTNode *goal);
                 bool next();
 };
 
 class Kuwata2008: public RRTBase {
         public:
                 Kuwata2008(RRTNode *init, RRTNode *goal);
-
-                // RRT framework
-                std::vector<RRTNode *> (*steer)(
-                                RRTNode *init,
-                                RRTNode *goal);
                 bool next();
 };
 
@@ -56,29 +46,18 @@ class Karaman2011: public RRTBase {
                 bool rewire(std::vector<RRTNode *> nvs, RRTNode *ns);
         public:
                 Karaman2011(RRTNode *init, RRTNode *goal);
-
-                // RRT framework
-                std::vector<RRTNode *> (*steer)(
-                                RRTNode *init,
-                                RRTNode *goal);
                 bool next();
 };
 
 class T1: public RRTBase {
         public:
                 T1(RRTNode *init, RRTNode *goal);
-
-                // RRT framework
-                std::vector<RRTNode *> (*steer)(
-                                RRTNode *init,
-                                RRTNode *goal);
                 bool next();
 };
 
 class T2: public Karaman2011 {
         public:
                 using Karaman2011::Karaman2011;
-
                 bool next();
                 float goal_cost();
 };
@@ -108,11 +87,6 @@ class Klemm2015: public Karaman2011 {
                 void swap();
         public:
                 Klemm2015(RRTNode *init, RRTNode *goal);
-
-                // RRT framework
-                std::vector<RRTNode *> (*steer)(
-                                RRTNode *init,
-                                RRTNode *goal);
                 bool next();
 };