]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Fix adding child in RRT* connect
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 14 Dec 2018 14:28:00 +0000 (15:28 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 14 Dec 2018 17:51:17 +0000 (18:51 +0100)
decision_control/rrtplanner.cc

index b1fa6e98c958f8af25549d2d69bde08226290f7f..1c55967a64a594a2802e6374ee48cbeac7607b6d 100644 (file)
@@ -236,7 +236,10 @@ bool Karaman2011::connect(
                         op = ns->parent();
                         od = ns->dcost();
                         oc = ns->ccost();
-                        nv->add_child(ns, this->cost(nv, ns));
+                        if (IS_NEAR(nv, ns))
+                                ns = nv;
+                        else
+                                nv->add_child(ns, this->cost(nv, ns));
                         if (this->collide(nv, ns)) {
                                 nv->children().pop_back();
                                 if (op)