]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Add rrttext19 todo spatialite
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Wed, 28 Jul 2021 19:52:20 +0000 (21:52 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Thu, 30 Sep 2021 11:49:26 +0000 (13:49 +0200)
incl/rrtext.hh
incl/rrtsp.hh
src/rrtext19.cc [new file with mode: 0644]

index 02cb9c6c3046534ea619178a3cafefbd80b3dbec..56bbda20f49faa9199c028eba19b50cb4151c8e7 100644 (file)
 
 namespace rrts {
 
+/*! \brief Use Spatialite (SQLite with GIS) for collision detection.
+ *
+ * The database file `wo.db` is accessed in RAII idiom style -- opened in the
+ * constructor and closed in the destructor. It's not possible to have multiple
+ * instances of `RRTExt19` running (for now.)
+ *
+ * \ingroup ext-col
+ */
+class RRTExt19 : public virtual RRTS {
+private:
+       bool collide_steered();
+public:
+       ~RRTExt19();
+       RRTExt19();
+       Json::Value json() const;
+       void json(Json::Value jvi);
+};
+
 /*! \brief Finish when more than 1000 iterations.
  *
  * \ingroup ext-aux
index c79fdc0994c59828ef16f7c019629701133134a1..5e74372bbe32a6bcd755b81f68761d58c441bb61 100644 (file)
 
 namespace rrts {
 
+class P40 : public RRTExt8, public RRTExt10, public RRTExt14, public RRTExt15,
+               public RRTExt16, public RRTExt17, RRTExt19 {
+public:
+       Json::Value json() const
+       {
+               return RRTExt15::json();
+       }
+       void json(Json::Value jvi)
+       {
+               RRTExt19::json(jvi);
+       }
+       void reset()
+       {
+               RRTExt8::reset();
+               RRTExt14::reset();
+       }
+};
+
 class P39 : public RRTExt2, public RRTExt8, public RRTExt10, public RRTExt14,
                public RRTExt15, public RRTExt16, public RRTExt17,
                public RRTExt13 {
diff --git a/src/rrtext19.cc b/src/rrtext19.cc
new file mode 100644 (file)
index 0000000..67508f1
--- /dev/null
@@ -0,0 +1,39 @@
+#include <cassert>
+#include "rrtext.hh"
+
+namespace rrts {
+
+bool
+RRTExt19::collide_steered()
+{
+       // TODO store this->steered_ to db as multipolygon
+       // TODO request db for collision between steered and obstacles
+}
+
+RRTExt19::~RRTExt19()
+{
+       // TODO close db (file)
+}
+
+RRTExt19::RRTExt19()
+{
+       // TODO open db (file)
+}
+
+RRTExt19::json() const
+{
+       return RRTS::json();
+}
+
+void
+RRTExt19::json(Json::Value jvi)
+{
+       RRTS::json(jvi);
+       assert(jvi["obst"] != Json::nullValue);
+       for (auto& o: jvi["obst"]) {
+               // TODO load polygon (to db?)
+               // TODO create multipolygon in db
+       }
+}
+
+} // namespace rrts