]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Rename cumulative cost functions
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 21 Sep 2018 14:03:28 +0000 (16:03 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 21 Sep 2018 14:03:28 +0000 (16:03 +0200)
decision_control/rrtplanner.cc
incl/compile.h
incl/cost.h
vehicle_platform/cost.cc

index 7a08ac0a9c312a8c9fd7d3077fe66a580e8e0927..eeb19d96f2008662eb1bfae187a675b02a05e52a 100644 (file)
@@ -25,7 +25,9 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #include "rrtplanner.h"
 #include "cost.h"
 
-#define KUWATA2008_CCOST CCO
+#define CATI(a, b) a ## b
+#define CAT(a, b) CATI(a, b)
+#define KUWATA2008_CCOST CAT(c, CO)
 #define KUWATA2008_DCOST CO
 
 LaValle1998::LaValle1998(RRTNode *init, RRTNode *goal):
index 441a428c790a47a1dc36182cf21b7714c3cce5b4..2ac1899667fac49c69c000ce0a3acd64a176b407 100644 (file)
@@ -46,8 +46,4 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #define CO co1
 #endif
 
-#ifndef CCO
-#define CCO co3
-#endif
-
 #endif
index 42ca4f3cd5690611f0f9173e988718a5af5a6cb7..ae3e118a79c1ed3c2390f66a5444c50df108ca84 100644 (file)
@@ -21,8 +21,8 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #include "rrtnode.h"
 
 float co1(RRTNode *init, RRTNode *goal);
+float cco1(RRTNode *init, RRTNode *goal);
 float co2(RRTNode *init, RRTNode *goal);
-float co3(RRTNode *init, RRTNode *goal);
-float co4(RRTNode *init, RRTNode *goal);
+float cco2(RRTNode *init, RRTNode *goal);
 
 #endif
index 31771d8c1c6005c21c2a6085430555415739d9a6..b26f5d364c4760aa539645757f2d80e638dc3106 100644 (file)
@@ -27,6 +27,11 @@ float co1(RRTNode *init, RRTNode *goal)
         return pow(pow(dx, 2) + pow(dy, 2), 0.5);
 }
 
+float cco1(RRTNode *init, RRTNode *goal)
+{
+        return init->ccost() + co1(init, goal);
+}
+
 float co2(RRTNode *init, RRTNode *goal)
 {
         double q0[] = {init->x(), init->y(), init->h()};
@@ -35,12 +40,7 @@ float co2(RRTNode *init, RRTNode *goal)
         return static_cast<float>(rsss.distance(q0, q1));
 }
 
-float co3(RRTNode *init, RRTNode *goal)
-{
-        return init->ccost() + co1(init, goal);
-}
-
-float co4(RRTNode *init, RRTNode *goal)
+float cco2(RRTNode *init, RRTNode *goal)
 {
         return init->ccost() + co2(init, goal);
 }