]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blobdiff - api/rrts.h
Add rrt node type class, type to RRTNode
[hubacji1/rrts.git] / api / rrts.h
index d4e575901fb55105ff3c443e8e9c59746b703ad0..1d870f74c49e7bc491a967721283bd1d84222da5 100644 (file)
@@ -7,6 +7,17 @@
 #include <vector>
 #include "bcar.h"
 
+/*! \brief Possible type of RRT node.
+
+\param cusp The node that is cusp (change in direction).
+\param connected The node that branches generated steered path.
+*/
+class RRTNodeType {
+        public:
+                static const unsigned int cusp = 1 << 0;
+                static const unsigned int connected = 1 << 1;
+};
+
 /*! \brief RRT node basic class.
 
 \param c Cumulative cost from RRT data structure root.
@@ -17,6 +28,7 @@ class RRTNode : public BicycleCar {
         private:
                 double c_ = 0;
                 RRTNode *p_ = nullptr;
+                unsigned int t_ = 0;
         public:
                 // getters, setters
                 double c() const { return this->c_; }
@@ -25,6 +37,10 @@ class RRTNode : public BicycleCar {
                 RRTNode *p() const { return this->p_; }
                 void p(RRTNode *p) { this->p_ = p; }
 
+                bool t(unsigned int flag) { return this->t_ & flag; }
+                void set_t(unsigned int flag) { this->t_ |= flag; }
+                void clear_t(unsigned int flag) { this->t_ &= ~flag; }
+
                 RRTNode();
                 RRTNode(const BicycleCar &bc);
 };