From 016beae2048a11c2d6888206795db8e3dfed3203 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Mon, 24 Jun 2019 17:44:43 +0200 Subject: [PATCH] Remove unused macros --- base/rrtbase.cc | 6 ++++-- incl/rrtbase.h | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/base/rrtbase.cc b/base/rrtbase.cc index 8785ad7..5bb1385 100644 --- a/base/rrtbase.cc +++ b/base/rrtbase.cc @@ -1083,13 +1083,14 @@ float RRTBase::cost(RRTNode *init, RRTNode *goal) RRTNode *RRTBase::nn(RRTNode *rs) { int iy = this->YI(rs); + float iy_step = (this->VMAX - this->VMIN) / IYSIZE; struct mcnn nn; nn.nn = nullptr; nn.mc = 9999; unsigned int i = 0; // vector step unsigned int j = 0; // array step int iyj = 0; - while (nn.mc > j * IYSTEP) { + while (nn.mc > j * iy_step) { iyj = (int) (iy + j); if (iyj >= IYSIZE) iyj = IYSIZE - 1; @@ -1121,7 +1122,8 @@ std::vector RRTBase::nv(RRTNode *node, float dist) { std::vector nvs; unsigned int iy = this->YI(node); - unsigned int iy_dist = floor(dist / IYSTEP) + 1; + float iy_step = (this->VMAX - this->VMIN) / IYSIZE; + unsigned int iy_dist = floor(dist / iy_step) + 1; unsigned int i = 0; // vector index unsigned int j = 0; // array index unsigned int jmin = 0; // minimal j index diff --git a/incl/rrtbase.h b/incl/rrtbase.h index 7b4f2e2..44dc06d 100644 --- a/incl/rrtbase.h +++ b/incl/rrtbase.h @@ -32,15 +32,7 @@ along with I am car. If not, see . #define NOFNODES 20000 #define IXSIZE 100 -#define IXSTEP (1.0 * ((HMAX) - (HMIN)) / IXSIZE) -#define IXI(x) ({ __typeof__ (x) _x = (x); \ - std::abs((int) floor(_x / IXSTEP)); }) #define IYSIZE 100 -#define IYSTEP (1.0 * ((VMAX) - (VMIN)) / IYSIZE) -#define IYI(y) ({ \ - __typeof__ (y) _y = (y); \ - (int) floor((_y - VMIN) / IYSTEP); \ -}) #define GLVERTEX(n) ((n)->x() * glplwscale), ((n)->y() * glplhscale) -- 2.39.2