]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Rewrite rrtext6
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Fri, 23 Jul 2021 11:12:13 +0000 (13:12 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 27 Jul 2021 15:10:19 +0000 (17:10 +0200)
CMakeLists.txt
incl/rrtext.hh
src/rrtext6.cc

index 963aefc26b5de362ffb8748dc1d9c4d940f70e2b..910678f4d4c0a8f3f20276dd67e0312e5c1449ec 100644 (file)
@@ -25,6 +25,7 @@ add_library(rrts STATIC
        src/rrtext13.cc
        src/rrtext10.cc
        src/rrtext8.cc
+       src/rrtext6.cc
        src/rrtext2.cc
        src/reeds_shepp.cpp
 )
index dba83fa258d144e52b947b6663185fec49197f36..b09f1c4829db9b5ad72ee163be02cf30774ae09d 100644 (file)
@@ -231,16 +231,17 @@ class RRTExt7 : public virtual RRTS {
                std::vector<RRTNode *> nv(RRTNode &t);
 };
 
-/*! \brief Reeds and Shepp cost for building and search.
-*/
+/*! \brief Reeds & Shepp (build, search).
+ *
+ * Use Reeds & Shepp path length for building tree data structure as well as for
+ * searching it.
+ *
+ * \ingroup ext-cost
+ */
 class RRTExt6 : public virtual RRTS {
-       public:
-               /*! \brief Reeds and Shepp path length.
-               */
-               double cost_build(RRTNode &f, RRTNode &t);
-               /*! \brief Reeds and Shepp path length.
-               */
-               double cost_search(RRTNode &f, RRTNode &t);
+private:
+       double cost_build(RRTNode const& f, RRTNode const& t) const;
+       double cost_search(RRTNode const& f, RRTNode const& t) const;
 };
 
 /*! \brief Different costs extension.
index db7d661e9143c61b301eb7aaf335106a27f8d82a..934c871d6ec2568e6753b01204717a4bc0d11030 100644 (file)
@@ -1,18 +1,21 @@
-#include "rrtext.h"
+#include "rrtext.hh"
 #include "reeds_shepp.h"
 
-double RRTExt6::cost_build(RRTNode &f, RRTNode &t)
+namespace rrts {
+
+double
+RRTExt6::cost_build(RRTNode const& f, RRTNode const& t) const
 {
        double q0[] = {f.x(), f.y(), f.h()};
        double q1[] = {t.x(), t.y(), t.h()};
-       ReedsSheppStateSpace rsss(this->bc.mtr());
+       ReedsSheppStateSpace rsss(this->bc_.mtr());
        return rsss.distance(q0, q1);
 }
 
-double RRTExt6::cost_search(RRTNode &f, RRTNode &t)
+double
+RRTExt6::cost_search(RRTNode const& f, RRTNode const& t) const
 {
-       double q0[] = {f.x(), f.y(), f.h()};
-       double q1[] = {t.x(), t.y(), t.h()};
-       ReedsSheppStateSpace rsss(this->bc.mtr());
-       return rsss.distance(q0, q1);
+       return this->cost_build(f, t);
 }
+
+} // namespace rrts