From 7047eca9d47fe201101207b95cc7011e6c08df88 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Wed, 28 Jul 2021 21:52:20 +0200 Subject: [PATCH] Add rrttext19 todo --- incl/rrtext.hh | 18 ++++++++++++++++++ incl/rrtsp.hh | 18 ++++++++++++++++++ src/rrtext19.cc | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 src/rrtext19.cc diff --git a/incl/rrtext.hh b/incl/rrtext.hh index 02cb9c6..56bbda2 100644 --- a/incl/rrtext.hh +++ b/incl/rrtext.hh @@ -38,6 +38,24 @@ 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 diff --git a/incl/rrtsp.hh b/incl/rrtsp.hh index c79fdc0..5e74372 100644 --- a/incl/rrtsp.hh +++ b/incl/rrtsp.hh @@ -20,6 +20,24 @@ 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 index 0000000..67508f1 --- /dev/null +++ b/src/rrtext19.cc @@ -0,0 +1,39 @@ +#include +#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 -- 2.39.2