]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Remove obsolete extension
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:06:57 +0000 (14:06 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:06:57 +0000 (14:06 +0100)
Because costs as well as paths are now logged by RRTS class.

rrts/CMakeLists.txt
rrts/incl/rrtext.hh
rrts/incl/rrtsp.hh
scripts/plot_cost.py
scripts/plot_multidir_cost.py
scripts/scenario.py

index 363fe1393b41810e60023e3c370de4a376fd7be4..51025a46e0f0d36ad26ef7e493ed45a3b6f6e6b0 100644 (file)
@@ -35,7 +35,6 @@ add_library(rrts STATIC
        src/rrtext18.cc
        src/rrtext17.cc
        src/rrtext16.cc
-       src/rrtext15.cc
        src/rrtext14.cc
        src/rrtext13.cc
        src/rrtext10.cc
index 10e8c2658ef38a792a86e800760b5104610b3780..17962faa53143a70f4120b7ffd3d049b5b1f9ce4 100644 (file)
@@ -94,19 +94,6 @@ private:
        void steer(RRTNode const& f, RRTNode const& t);
 };
 
-/*! \brief Log goal's cumulative cost each iteration.
- *
- * \ingroup ext-aux
- */
-class RRTExt15 : public virtual RRTS {
-private:
-       std::vector<double> log_path_cost_;
-public:
-       Json::Value json() const;
-       void json(Json::Value jvi);
-       bool next();
-};
-
 /*! \brief Random sampling in the circuit between root and goal.
  *
  * \ingroup ext-sampl
index da509bfd3bc1fe74d449b0d42c43c452774dbc65..f2e1ab809e7c2487e06e77ff278457c9dffa6df7 100644 (file)
@@ -26,15 +26,11 @@ namespace rrts {
  * \ingroup planners
  */
 class P40 : public RRTExt21, public RRTExt8, public RRTExt10, public RRTExt14,
-               public RRTExt15, public RRTExt19, public RRTExt17,
-               public RRTExt13 {
+               public RRTExt19, public RRTExt17, public RRTExt13 {
 public:
        Json::Value json() const
        {
-               auto jvo = RRTExt13::json();
-               auto json15 = RRTExt15::json();
-               jvo["log_path_cost"] = json15["log_path_cost"];
-               return jvo;
+               return RRTExt13::json();
        }
        void reset()
        {
@@ -49,15 +45,11 @@ public:
  * \ingroup planners
  */
 class P39 : public RRTExt2, public RRTExt8, public RRTExt10, public RRTExt14,
-               public RRTExt15, public RRTExt16, public RRTExt17,
-               public RRTExt13 {
+               public RRTExt16, public RRTExt17, public RRTExt13 {
 public:
        Json::Value json() const
        {
-               auto jvo = RRTExt13::json();
-               auto json15 = RRTExt15::json();
-               jvo["log_path_cost"] = json15["log_path_cost"];
-               return jvo;
+               return RRTExt13::json();
        }
        void json(Json::Value jvi)
        {
@@ -73,15 +65,11 @@ public:
 };
 
 class P38 : public RRTExt2, public RRTExt8, public RRTExt10, public RRTExt14,
-               public RRTExt15, public RRTExt16, public RRTExt18,
-               public RRTExt13 {
+               public RRTExt16, public RRTExt18, public RRTExt13 {
 public:
        Json::Value json() const
        {
-               auto jvo = RRTExt13::json();
-               auto json15 = RRTExt15::json();
-               jvo["log_path_cost"] = json15["log_path_cost"];
-               return jvo;
+               return RRTExt13::json();
        }
        void json(Json::Value jvi)
        {
@@ -97,11 +85,11 @@ public:
 };
 
 class P37 : public RRTExt2, public RRTExt8, public RRTExt10, public RRTExt14,
-               public RRTExt15, public RRTExt16, public RRTExt18 {
+               public RRTExt16, public RRTExt18 {
 public:
        Json::Value json() const
        {
-               return RRTExt15::json();
+               return RRTS::json();
        }
        void json(Json::Value jvi)
        {
@@ -116,11 +104,11 @@ public:
 };
 
 class P36 : public RRTExt2, public RRTExt8, public RRTExt10, public RRTExt14,
-               public RRTExt15, public RRTExt16, public RRTExt17 {
+               public RRTExt16, public RRTExt17 {
 public:
        Json::Value json() const
        {
-               return RRTExt15::json();
+               return RRTS::json();
        }
        void json(Json::Value jvi)
        {
index 5450e7e4067e3236ce4ae010af05d9be93560997..ac256695a65f8160d047a76493b68f02da3c324f 100755 (executable)
@@ -75,7 +75,7 @@ Where:
     max_s = 0
     max_c = 0.0
     for s in scenarios:
-        lpc = s["log_path_cost"]
+        lpc = s["costs"]
         for i in range(L):
             if len(lpc) <= i:
                 lpc.append(lpc[-1])
index 9e330dbdd11e191121b3f9af7f86069c8a0941fe..8bc15e1dcd3a76f6a23264bf3307a8e2afd6930e 100755 (executable)
@@ -129,7 +129,7 @@ if __name__ == "__main__":
         max_s = 0
         max_c = 0.0
         for s in scenarios:
-            lpc = s["log_path_cost"]
+            lpc = s["costs"]
             for i in range(L):
                 if len(lpc) <= i:
                     lpc.append(lpc[-1])
index 5ec8a31d2ca76ebd4333fb63c5691fee4d5883f9..a51929981e976da0c83bbae628cbec5b64276897 100644 (file)
@@ -184,7 +184,7 @@ def cost():
 
 def costs():
     """Return the dictionary of ``fname``'s and corresponding costs."""
-    r = greps("log_path_cost")
+    r = greps("costs")
     r2 = {}
     M = 0
     MV = 0
@@ -257,7 +257,7 @@ def iter():
 
 def log_path_cost():
     """Return the dictionary of ``fname``'s and logged path costs."""
-    r = grep("log_path_cost")
+    r = grep("costs")
     r2 = {}
     i = 1
     for k, v in r.items():