]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/blobdiff - incl/rrtext.hh
Add simple occupancy grid collision check
[hubacji1/rrts.git] / incl / rrtext.hh
index 4f20a7937897435e698b6b7a69e2d0753e6dcd2a..e285fa2796c4d287067a96a6f26aa2da2c043520 100644 (file)
 
 namespace rrts {
 
+/*! \brief Collision check based on enlarged occupancy grid.
+ *
+ */
+class RRTExt21 : public virtual RRTS {
+private:
+       unsigned int _grid_width = 0;
+       unsigned int _grid_height = 0;
+       float _grid_res = 0.0;
+       int8_t const *_grid_data = nullptr;
+       double _origin_x = 0.0;
+       double _origin_y = 0.0;
+       bool collide(RRTNode const &n);
+       bool collide_steered();
+public:
+       void set_grid_to_check(unsigned int w, unsigned int h, float r,
+                       int8_t const *d, double x, double y);
+};
+
+/*! \brief Collision check based on occupancy grid.
+ *
+ * \ingroup ext-col
+ */
+class RRTExt20 : public virtual RRTS {
+private:
+       std::vector<bcar::Point> const *_points_to_check = nullptr;
+       bool collide_steered();
+public:
+       void set_points_to_check(std::vector<bcar::Point> const *p);
+};
+
 /*! \brief Use Dubins paths-based steering procedure.
  *
  * \ingroup ext-steer
  * \see https://github.com/AndrewWalker/Dubins-Curves
  */
 class RRTExt19 : public virtual RRTS {
+private:
+       void steer(RRTNode const &f, RRTNode const &t);
 };
 
 /*! \brief Finish when more than 1000 iterations.
@@ -412,6 +444,7 @@ public:
        RRTExt2();
        Json::Value json() const;
        void json(Json::Value jvi);
+       void reset();
 };
 
 /* \brief Different costs extension.