]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Output goal and entry in json
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 12 Nov 2020 10:17:12 +0000 (11:17 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 12 Nov 2020 10:17:12 +0000 (11:17 +0100)
src/rrts.cc

index 066fc12a397facc54c3a89236c8bf99e394ccdfe..e5f0334f022e8eade07d67a80e907c0a2b535f03 100644 (file)
@@ -487,9 +487,12 @@ Json::Value RRTS::json()
         {
                 if (this->path().size() > 0) {
                         jvo["cost"] = cc(*this->path().back());
-                        jvo["goal"][0] = this->path().back()->x();
-                        jvo["goal"][1] = this->path().back()->y();
-                        jvo["goal"][2] = this->path().back()->h();
+                        jvo["entry"][0] = this->goals().front().x();
+                        jvo["entry"][1] = this->goals().front().y();
+                        jvo["entry"][2] = this->goals().front().h();
+                        jvo["goal"][0] = this->goals().back().x();
+                        jvo["goal"][1] = this->goals().back().y();
+                        jvo["goal"][2] = this->goals().back().h();
                 }
         }
         {