]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Remove unused files (nn, nv, sample)
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 24 Jun 2019 15:41:30 +0000 (17:41 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Mon, 24 Jun 2019 15:43:18 +0000 (17:43 +0200)
base/nn.cc [deleted file]
base/nv.cc [deleted file]
base/rrtbase.cc
base/sample.cc [deleted file]
decision_control/rrtplanner.cc
incl/nn.h [deleted file]
incl/nv.h [deleted file]
incl/rrtbase.h
incl/sample.h [deleted file]

diff --git a/base/nn.cc b/base/nn.cc
deleted file mode 100644 (file)
index 3679210..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <omp.h>
-#include <vector>
-#include "cost.h"
-#include "nn.h"
-#include "rrtbase.h"
-
-RRTNode *nn1(
-                std::vector<RRTNode *> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *))
-{
-        RRTNode *root = nodes[0];
-        std::vector<RRTNode *> s; // DFS stack
-        std::vector<RRTNode *> r; // reset visited_
-        RRTNode *tmp;
-        RRTNode *nn = root;
-        float mcost = (*cost)(root, node);
-
-        s.push_back(root);
-        while (s.size() > 0) {
-                tmp = s.back();
-                s.pop_back();
-                if (!tmp->visit()) {
-                        r.push_back(tmp);
-                        if ((*cost)(tmp, node) < mcost) {
-                                nn = tmp;
-                                mcost = (*cost)(tmp, node);
-                        }
-                        for (auto ch: tmp->children()) {
-                                s.push_back(ch);
-                        }
-                }
-        }
-        for (auto n: r) {
-                n->visit(false);
-        }
-        return nn;
-}
-
-RRTNode *nn2(
-                std::vector<RRTNode *> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *))
-{
-        RRTNode *nn = nodes[0];
-        float mcost = EDIST(nn, node);
-        unsigned int i;
-        // TODO fix see, user-defined reductions
-        #pragma omp parallel for
-        for (i = 0; i < nodes.size(); i++) {
-                if (EDIST(nodes[i], node) < mcost) {
-                        nn = nodes[i];
-                        mcost = EDIST(nodes[i], node);
-                }
-        }
-        return nn;
-}
-
-RRTNode *nn3(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *))
-{
-        int iy = IYI(node->y());
-        struct mcnn nn;
-        nn.nn = nullptr;
-        nn.mc = 9999;
-        unsigned int i = 0; // vector step
-        unsigned int j = 0; // array step
-        int iyj = 0;
-        float oh = node->h();
-        while (nn.mc > j * IYSTEP) {
-                iyj = (int) (iy + j);
-                if (iyj >= IYSIZE)
-                        iyj = IYSIZE - 1;
-                #pragma omp parallel for reduction(minn: nn)
-                for (i = 0; i < nodes[iyj].size(); i++) {
-                        node->h(nodes[iyj][i]->h());
-                        if (co2(nodes[iyj][i], node) < nn.mc) {
-                                nn.mc = co2(nodes[iyj][i], node);
-                                nn.nn = nodes[iyj][i];
-                        }
-                }
-                if (j > 0) {
-                        iyj = (int) (iy - j);
-                        if (iyj < 0)
-                                iyj = 0;
-                        #pragma omp parallel for reduction(minn: nn)
-                        for (i = 0; i < nodes[iyj].size(); i++) {
-                                node->h(nodes[iyj][i]->h());
-                                if (co2(nodes[iyj][i], node) < nn.mc) {
-                                        nn.mc = co2(nodes[iyj][i], node);
-                                        nn.nn = nodes[iyj][i];
-                                }
-                        }
-                }
-                j++;
-        }
-        node->h(oh);
-        return nn.nn;
-}
-
-RRTNode *nn4(
-                std::array<std::vector<RRTNode *>, IYSIZE> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *))
-{
-        int iy = IYI(node->y());
-        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) {
-                iyj = (int) (iy + j);
-                if (iyj >= IYSIZE)
-                        iyj = IYSIZE - 1;
-                #pragma omp parallel for reduction(minn: nn)
-                for (i = 0; i < nodes[iyj].size(); i++) {
-                        if (EDIST(nodes[iyj][i], node) < nn.mc) {
-                                nn.mc = EDIST(nodes[iyj][i], node);
-                                nn.nn = nodes[iyj][i];
-                        }
-                }
-                if (j > 0) {
-                        iyj = (int) (iy - j);
-                        if (iyj < 0)
-                                iyj = 0;
-                        #pragma omp parallel for reduction(minn: nn)
-                        for (i = 0; i < nodes[iyj].size(); i++) {
-                                if (EDIST(nodes[iyj][i], node) < nn.mc) {
-                                        nn.mc = EDIST(nodes[iyj][i], node);
-                                        nn.nn = nodes[iyj][i];
-                                }
-                        }
-                }
-                j++;
-        }
-        return nn.nn;
-}
-
-RRTNode *nn5(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                char tree)
-{
-        int iy = IYI(node->y());
-        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) {
-                iyj = (int) (iy + j);
-                if (iyj >= IYSIZE)
-                        iyj = IYSIZE - 1;
-                #pragma omp parallel for reduction(minn: nn)
-                for (i = 0; i < nodes[iyj].size(); i++) {
-                        if (EDIST(nodes[iyj][i], node) < nn.mc &&
-                                        tree != '0' &&
-                                        nodes[iyj][i]->tree() == tree) {
-                                nn.mc = EDIST(nodes[iyj][i], node);
-                                nn.nn = nodes[iyj][i];
-                        }
-                }
-                if (j > 0) {
-                        iyj = (int) (iy - j);
-                        if (iyj < 0)
-                                iyj = 0;
-                        #pragma omp parallel for reduction(minn: nn)
-                        for (i = 0; i < nodes[iyj].size(); i++) {
-                                if (EDIST(nodes[iyj][i], node) < nn.mc &&
-                                                tree != '0' &&
-                                                nodes[iyj][i]->tree() == tree) {
-                                        nn.mc = EDIST(nodes[iyj][i], node);
-                                        nn.nn = nodes[iyj][i];
-                                }
-                        }
-                }
-                j++;
-        }
-        return nn.nn;
-}
-
-RRTNode *nn6(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *))
-{
-        int iy = IYI(node->y());
-        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) {
-                iyj = (int) (iy + j);
-                if (iyj >= IYSIZE)
-                        iyj = IYSIZE - 1;
-                #pragma omp parallel for reduction(minn: nn)
-                for (i = 0; i < nodes[iyj].size(); i++) {
-                        if (co4(nodes[iyj][i], node) < nn.mc) {
-                                nn.mc = co4(nodes[iyj][i], node);
-                                nn.nn = nodes[iyj][i];
-                        }
-                }
-                if (j > 0) {
-                        iyj = (int) (iy - j);
-                        if (iyj < 0)
-                                iyj = 0;
-                        #pragma omp parallel for reduction(minn: nn)
-                        for (i = 0; i < nodes[iyj].size(); i++) {
-                                if (co4(nodes[iyj][i], node) < nn.mc) {
-                                        nn.mc = co4(nodes[iyj][i], node);
-                                        nn.nn = nodes[iyj][i];
-                                }
-                        }
-                }
-                j++;
-        }
-        return nn.nn;
-}
diff --git a/base/nv.cc b/base/nv.cc
deleted file mode 100644 (file)
index abe9450..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <omp.h>
-#include <vector>
-#include "nn.h"
-#include "nv.h"
-
-std::vector<RRTNode *> nv1(
-                RRTNode *root,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist)
-{
-        std::vector<RRTNode *> nodes;
-        std::vector<RRTNode *> s; // DFS stack
-        std::vector<RRTNode *> r; // reset visited_
-        RRTNode *tmp;
-
-        s.push_back(root);
-        while (s.size() > 0) {
-                tmp = s.back();
-                s.pop_back();
-                if (!tmp->visit()) {
-                        r.push_back(tmp);
-                        if ((*cost)(tmp, node) < dist) {
-                                nodes.push_back(tmp);
-                        }
-                        for (auto ch: tmp->children()) {
-                                s.push_back(ch);
-                        }
-                }
-        }
-        for (auto n: r) {
-                n->visit(false);
-        }
-        return nodes;
-}
-
-std::vector<RRTNode *> nv2(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist)
-{
-        std::vector<RRTNode *> nvs;
-        unsigned int iy = IYI(node->y());
-        unsigned int iy_dist = floor(dist / IYSTEP) + 1;
-        unsigned int i = 0; // vector index
-        unsigned int j = 0; // array index
-        unsigned int jmin = 0; // minimal j index
-        unsigned int jmax = 0; // maximal j index
-        jmin = iy - iy_dist;
-        jmin = (jmin > 0) ? jmin : 0;
-        jmax = iy + iy_dist + 1;
-        jmax = (jmax < IYSIZE) ? jmax : IYSIZE;
-        #pragma omp parallel for reduction(merge: nvs)
-        for (j = jmin; j < jmax; j++) {
-                #pragma omp parallel for reduction(merge: nvs)
-                for (i = 0; i < nodes[j].size(); i++) {
-                        if ((*cost)(nodes[j][i], node) < dist) {
-                                nvs.push_back(nodes[j][i]);
-                        }
-                }
-        }
-        return nvs;
-}
-
-std::vector<RRTNode *> nv3(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist)
-{
-        std::vector<RRTNode *> nvs;
-        unsigned int iy = IYI(node->y());
-        unsigned int iy_dist = floor(dist / IYSTEP) + 1;
-        unsigned int i = 0; // vector index
-        unsigned int j = 0; // array index
-        unsigned int jmin = 0; // minimal j index
-        unsigned int jmax = 0; // maximal j index
-        jmin = iy - iy_dist;
-        jmin = (jmin > 0) ? jmin : 0;
-        jmax = iy + iy_dist + 1;
-        jmax = (jmax < IYSIZE) ? jmax : IYSIZE;
-        #pragma omp parallel for reduction(merge: nvs)
-        for (j = jmin; j < jmax; j++) {
-                #pragma omp parallel for reduction(merge: nvs)
-                for (i = 0; i < nodes[j].size(); i++) {
-                        if (EDIST(nodes[j][i], node) < dist) {
-                                nvs.push_back(nodes[j][i]);
-                        }
-                }
-        }
-        return nvs;
-}
-
-std::vector<RRTNode *> nv4(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist,
-                char tree)
-{
-        std::vector<RRTNode *> nvs;
-        unsigned int iy = IYI(node->y());
-        unsigned int iy_dist = floor(dist / IYSTEP) + 1;
-        unsigned int i = 0; // vector index
-        unsigned int j = 0; // array index
-        unsigned int jmin = 0; // minimal j index
-        unsigned int jmax = 0; // maximal j index
-        jmin = iy - iy_dist;
-        jmin = (jmin > 0) ? jmin : 0;
-        jmax = iy + iy_dist + 1;
-        jmax = (jmax < IYSIZE) ? jmax : IYSIZE;
-        #pragma omp parallel for reduction(merge: nvs)
-        for (j = jmin; j < jmax; j++) {
-                #pragma omp parallel for reduction(merge: nvs)
-                for (i = 0; i < nodes[j].size(); i++) {
-                        if ((*cost)(nodes[j][i], node) < dist &&
-                                        tree != '0' &&
-                                        nodes[j][i]->tree() == tree) {
-                                nvs.push_back(nodes[j][i]);
-                        }
-                }
-        }
-        return nvs;
-}
index bbdd06eac1d8bc64944b04378e9a77dfde15b5e8..8785ad7230849e6b3f736d5d6df3610f092892d1 100644 (file)
@@ -30,11 +30,8 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 // RRT
-#include "sample.h"
 #include "cost.h"
 #include "steer.h"
-#include "nn.h"
-#include "nv.h"
 
 #if USE_GL > 0
 extern SDL_Window* gw;
diff --git a/base/sample.cc b/base/sample.cc
deleted file mode 100644 (file)
index 374f367..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <cmath>
-#include <cstdlib>
-#include "sample.h"
-
-RRTNode *sa1()
-{
-        float new_x = VMIN + static_cast<float>(rand()) /
-                static_cast<float>(RAND_MAX / (VMAX - VMIN));
-        float new_y = HMIN + static_cast<float>(rand()) /
-                static_cast<float>(RAND_MAX / (HMAX - HMIN));
-        float new_h = static_cast<float>(rand()) /
-                static_cast<float>(RAND_MAX / (2 * M_PI));
-        return new RRTNode(new_x, new_y, new_h);
-}
-
-RRTNode *sa2(float bx, float by, float br)
-{
-        float r = static_cast<float>(rand());
-        r /= static_cast<float>(RAND_MAX / br);
-        float sh = static_cast<float>(rand());
-        sh /= static_cast<float>(RAND_MAX / (2 * M_PI));
-        float h = static_cast<float>(rand());
-        h /= static_cast<float>(RAND_MAX / (2 * M_PI));
-        return new RRTNode(bx + r * cos(sh), by + r * sin(sh), h);
-}
index b019cfa6472c07fa2db5c61e1b72d47acc464915..59bdf96b9251eb9a8f8fa5413130e306ca7d04ef 100644 (file)
@@ -19,9 +19,6 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #include <cstdlib>
 #include <ctime>
 #include "compile.h"
-#include "nn.h"
-#include "nv.h"
-#include "sample.h"
 #include "steer.h"
 #include "rrtplanner.h"
 #include "cost.h"
diff --git a/incl/nn.h b/incl/nn.h
deleted file mode 100644 (file)
index c3e79a1..0000000
--- a/incl/nn.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef NEARESTNEIGHBOUR_H
-#define NEARESTNEIGHBOUR_H
-
-#include <array>
-#include "aux.h"
-#include "rrtbase.h"
-#include "rrtnode.h"
-
-RRTNode *nn1(
-                std::vector<RRTNode *> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *));
-RRTNode *nn2(
-                std::vector<RRTNode *> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *));
-RRTNode *nn3(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *));
-RRTNode *nn4(
-                std::array<std::vector<RRTNode *>, IYSIZE> &nodes,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *));
-RRTNode *nn5(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                char tree);
-RRTNode *nn6(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *));
-
-#endif
diff --git a/incl/nv.h b/incl/nv.h
deleted file mode 100644 (file)
index 912acb2..0000000
--- a/incl/nv.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef NEARVERTICES_H
-#define NEARVERTICES_H
-
-#include <vector>
-#include "aux.h"
-#include "rrtbase.h"
-#include "rrtnode.h"
-
-std::vector<RRTNode *> nv1(
-                RRTNode *root,
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist);
-std::vector<RRTNode *> nv2(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist);
-std::vector<RRTNode *> nv3(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist);
-std::vector<RRTNode *> nv4(
-                std::vector<RRTNode *> (&nodes)[IYSIZE],
-                RRTNode *node,
-                float (*cost)(RRTNode *, RRTNode *),
-                float dist,
-                char tree);
-
-#endif
index 3e77701a25207a67395f358b6dfdb2ab3fac99d9..7b4f2e2e7d251778c21cb87fbd11956d50549c5b 100644 (file)
@@ -27,7 +27,6 @@ along with I am car. If not, see <http://www.gnu.org/licenses/>.
 #include <vector>
 #include "obstacle.h"
 #include "rrtnode.h"
-#include "sample.h"
 #include "slotplanner.h"
 
 #define NOFNODES 20000
diff --git a/incl/sample.h b/incl/sample.h
deleted file mode 100644 (file)
index 5ced9bc..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-This file is part of I am car.
-
-I am car is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-I am car is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with I am car. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef SAMPLE_H
-#define SAMPLE_H
-
-#include "rrtnode.h"
-
-RRTNode *sa1();
-RRTNode *sa2(float bx, float by, float br);
-
-#endif