]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Split cost to build and search
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 11 Sep 2019 05:44:25 +0000 (07:44 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 11 Sep 2019 05:44:36 +0000 (07:44 +0200)
api/rrts.h
src/rrts.cc

index 47e6ea5eab21e89a7df4de36e98a2544a23c38bf..58f6ad8cfd4f4b7e35def14f444504aea6c0de0c 100644 (file)
@@ -69,7 +69,6 @@ class RRTS {
                 collide_steered_from(RRTNode &f);
                 std::tuple<bool, unsigned int, unsigned int>
                 collide_two_nodes(RRTNode &f, RRTNode &t);
-                double cost(RRTNode &f, RRTNode &t);
                 double cost_build(RRTNode &f, RRTNode &t);
                 double cost_search(RRTNode &f, RRTNode &t);
                 void sample();
index c486742f920b24bc17ffee5c023e27c738a16581..5c2460888156a9b100eecd5f5af5b723739fda76 100644 (file)
@@ -68,7 +68,14 @@ RRTS::collide_two_nodes(RRTNode &f, RRTNode &t)
         return this->collide(p);
 }
 
-double RRTS::cost(RRTNode &f, RRTNode &t)
+double RRTS::cost_build(RRTNode &f, RRTNode &t)
+{
+        double cost = 0;
+        cost = sqrt(pow(t.y() - f.y(), 2) + pow(t.x() - f.x(), 2));
+        return cost;
+}
+
+double RRTS::cost_search(RRTNode &f, RRTNode &t)
 {
         double cost = 0;
         cost = sqrt(pow(t.y() - f.y(), 2) + pow(t.x() - f.x(), 2));