From 7b106d3938950d85604bf7b881341d3bb9da3dfe Mon Sep 17 00:00:00 2001 From: Jiri Hubacek Date: Fri, 21 Sep 2018 16:03:28 +0200 Subject: [PATCH] Rename cumulative cost functions --- decision_control/rrtplanner.cc | 4 +++- incl/compile.h | 4 ---- incl/cost.h | 4 ++-- vehicle_platform/cost.cc | 12 ++++++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/decision_control/rrtplanner.cc b/decision_control/rrtplanner.cc index 7a08ac0..eeb19d9 100644 --- a/decision_control/rrtplanner.cc +++ b/decision_control/rrtplanner.cc @@ -25,7 +25,9 @@ along with I am car. If not, see . #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): diff --git a/incl/compile.h b/incl/compile.h index 441a428..2ac1899 100644 --- a/incl/compile.h +++ b/incl/compile.h @@ -46,8 +46,4 @@ along with I am car. If not, see . #define CO co1 #endif -#ifndef CCO -#define CCO co3 -#endif - #endif diff --git a/incl/cost.h b/incl/cost.h index 42ca4f3..ae3e118 100644 --- a/incl/cost.h +++ b/incl/cost.h @@ -21,8 +21,8 @@ along with I am car. If not, see . #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 diff --git a/vehicle_platform/cost.cc b/vehicle_platform/cost.cc index 31771d8..b26f5d3 100644 --- a/vehicle_platform/cost.cc +++ b/vehicle_platform/cost.cc @@ -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(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); } -- 2.39.2