]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Remove unused vector, use `npi` for parent node
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Sat, 6 Oct 2018 11:19:06 +0000 (13:19 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Sat, 6 Oct 2018 12:27:28 +0000 (14:27 +0200)
decision_control/rrtplanner.cc

index 744a662484eac47636312de41fec58732ad3aaba..2b93dbcde0ce6d2132a767b983e03687bad80bdf 100644 (file)
@@ -696,9 +696,8 @@ bool T2::opt_path()
                 tmpi = dnodes[tmpi].pi;
         }
         npi.push_back(tmpi);
-        std::vector<RRTNode *> npn; // new path nodes
         std::reverse(npi.begin(), npi.end());
-        RRTNode *pn = cusps[0];
+        RRTNode *pn = cusps[npi[0]];
         for (unsigned int i = 0; i < npi.size() - 1; i++) {
                 for (auto ns: this->steer(cusps[npi[i]], cusps[npi[i + 1]])) {
                         pn->add_child(ns, this->cost(pn, ns));