#include <vector>
-#define IS_NEAR(a, b) ({ __typeof__ (a) _a = (a); \
- __typeof__ (b) _b = (b); \
- pow(pow(_b->x() - _a->x(), 2) + \
- pow(_b->y() - _a->y(), 2), 0.5) < 0.2 && \
- std::abs(_b->h() - _a->h()) < M_PI / 32 ? true : false; })
+#define IS_NEAR(a, b) ({ \
+ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ pow(pow(_b->x() - _a->x(), 2) \
+ + pow(_b->y() - _a->y(), 2), 0.5) < 0.2 \
+ && std::abs(_b->h() - _a->h()) < M_PI / 32 ? true : false; \
+})
+
+#define GOAL_IS_NEAR(a, b) ({ \
+ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ pow(pow(_b->x() - _a->x(), 2) \
+ + pow(_b->y() - _a->y(), 2), 0.5) < 0.05 \
+ && std::abs(_b->h() - _a->h()) < M_PI / 32 ? true : false; \
+})
template <typename T> int sgn(T val) {
return (T(0) < val) - (val < T(0));
static bool comp_ccost(RRTNode *n1, RRTNode *n2);
float update_ccost();
bool visit();
+ /** Return ``true`` if ``n`` is in front of ``this``.
+ *
+ * @param n The node that is beeing checked.
+ */
+ bool inFront(RRTNode *n);
};
class RRTEdge {