]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Rename cusp counter member variable
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 14:59:30 +0000 (15:59 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 14:59:30 +0000 (15:59 +0100)
rrts/incl/rrts.hh
rrts/src/rrtext10.cc
rrts/src/rrts.cc

index 8c578b30ae9a58856d69f18491436a68a6997594..97fe2d028cfb5cb4ad7e981ab94de4c15329f9a3 100644 (file)
@@ -36,7 +36,7 @@ private:
        double _c = 0.0;
        double _cc = 0.0;
        RRTNode* _p = nullptr;
-       unsigned int _cusp = 0;
+       unsigned int _cusp_cnt = 0;
        int _segment_type = 0;  // 0 ~ straight, 1 ~ left, -1 right
 public:
        /*! Get cost to parent. */
@@ -55,10 +55,10 @@ public:
        void p(RRTNode& p);
 
        /*! Get number of backward-forward direction changes. */
-       unsigned int cusp() const;
+       unsigned int cusp_cnt() const;
 
        /*! Set number of backward-forward direction changes. */
-       void cusp(RRTNode const& p);
+       void cusp_cnt(RRTNode const& p);
 
        /*! \brief Get Reeds & Shepp segment type.
         *
index 27ec70d1e5951238231e10594215fa76fbf7b308..9d113d8e2a3537ef876e85c54bfe2e46364e3e22 100644 (file)
@@ -26,7 +26,7 @@ RRTExt10::cost_search(RRTNode const& f, RRTNode const& t) const
                2 * M_PI - std::abs(t.h() - f.h()));
        heur *= this->_bc.mtr();
        cost = std::max(cost, heur);
-       return cost + f.cusp() * 0.1;
+       return cost + f.cusp_cnt() * 0.1;
 }
 
 } // namespace rrts
index ea302e9d85fbb6edb48571f4a8532f674e167fd0..8c200281786ea074f328c53bbac6352bf2645a37 100644 (file)
@@ -63,17 +63,17 @@ RRTNode::p(RRTNode& p)
 }
 
 unsigned int
-RRTNode::cusp() const
+RRTNode::cusp_cnt() const
 {
-       return this->_cusp;
+       return this->_cusp_cnt;
 }
 
 void
-RRTNode::cusp(RRTNode const& p)
+RRTNode::cusp_cnt(RRTNode const& p)
 {
-       this->_cusp = p.cusp();
+       this->_cusp_cnt = p.cusp_cnt();
        if (this->sp() != p.sp() || this->sp() == 0.0) {
-               this->_cusp++;
+               this->_cusp_cnt++;
        }
 }
 
@@ -140,7 +140,7 @@ RRTS::join_steered(RRTNode* f)
                RRTNode* t = &this->_nodes.back();
                t->p(*f);
                t->c(this->cost_build(*f, *t));
-               t->cusp(*f);
+               t->cusp_cnt(*f);
                this->_steered.erase(this->_steered.begin());
                f = t;
        }
@@ -180,7 +180,7 @@ RRTS::connect()
        t = &this->_nodes.back();
        t->p(*f);
        t->c(this->cost_build(*f, *t));
-       t->cusp(*f);
+       t->cusp_cnt(*f);
        this->_steered.erase(this->_steered.begin());
        return true;
 }