]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Remove unused macros
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 24 Jun 2019 15:44:43 +0000 (17:44 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 24 Jun 2019 15:44:43 +0000 (17:44 +0200)
base/rrtbase.cc
incl/rrtbase.h

index 8785ad7230849e6b3f736d5d6df3610f092892d1..5bb1385616c49b3b0826a3409bf8ae303338524f 100644 (file)
@@ -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<RRTNode *> RRTBase::nv(RRTNode *node, float dist)
 {
         std::vector<RRTNode *> 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
index 7b4f2e2e7d251778c21cb87fbd11956d50549c5b..44dc06de2784b6ac5fc5022c64adfdebdbe46849 100644 (file)
@@ -32,15 +32,7 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #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)