// ext9
#define GRID_MAX_HI 60
+/*! \brief Goal Zone.
+
+*/
+class RRTExt11 : public virtual RRTS {
+ protected:
+ bool goal_found(RRTNode &f);
+};
+
/*! \brief Different costs extension.
Use different cost for bulding tree data structure and searching in the
\param f RRT node to join steered nodes to.
*/
void join_steered(RRTNode *f);
- bool goal_found(RRTNode &f);
+ virtual bool goal_found(RRTNode &f);
// RRT* procedures
bool connect();
void rewire();
--- /dev/null
+#include "rrtext.h"
+
+bool RRTExt11::goal_found(RRTNode &f)
+{
+ auto &g = this->goals().front();
+ double cost = this->cost_build(f, g);
+ if (g.drivable(f)) {
+ this->steer(f, g);
+ if (std::get<0>(this->collide_steered_from(f)))
+ return false;
+ this->join_steered(&f);
+ if (g.p() == nullptr || cc(f) + cost < cc(g)) {
+ g.p(&f);
+ g.c(cost);
+ }
+ return true;
+ }
+ return false;
+}