private:
double _c = 0.0;
double _cc = 0.0;
- RRTNode* _p;
+ RRTNode* _p = nullptr;
unsigned int _cusp = 0;
int _segment_type = 0; // 0 ~ straight, 1 ~ left, -1 right
public:
/*! RRT* algorithm basic class. */
class RRTS {
-private:
+protected:
BicycleCar _bc;
RRTGoal _goal;
unsigned int _icnt = 0;
double _cost = 0.0;
double _eta = 0.5;
double _time = 0.0;
- double _last_path_cost = 0.0;
std::vector<RRTNode> _last_path;
protected:
- void recompute_cc(RRTNode* g);
+ double min_gamma_eta(void) const;
+ bool should_continue(void) const;
+ void recompute_cc_for_predecessors_and(RRTNode* g);
void recompute_path_cc();
- double min_gamma_eta() const;
- bool should_continue() const;
void join_steered(RRTNode* f);
- RRTNode& nn();
bool connect();
void rewire();
bool goal_drivable_from(RRTNode const& f);
virtual void find_nn(RRTNode const& t);
virtual void find_nv(RRTNode const& t);
virtual void compute_path();
+protected:
virtual void steer(RRTNode const& f, RRTNode const& t) = 0;
virtual bool collide_steered() = 0;
virtual RRTNode sample() = 0;
public:
RRTS();
- /*! Get bicycle car used in the planner. */
- BicycleCar& bc(void) const;
-
/*! Set pose of the bicycle car used in the planner. */
- void bc(double x, double y, double h);
+ void set_bc_pose_to(Pose const& p);
/*! Get goal. */
- RRTGoal& goal(void) const;
+ RRTGoal const& goal(void) const;
/*! Set goal. */
void goal(double x, double y, double b, double e);
/*! Set maximum number of iterations before reset. */
void icnt_max(unsigned int i);
+ /*! Start elapsed time counter. */
+ void tstart(void);
+
/*! Return elapsed time. */
double scnt() const;
/*! Get cost of the last path. */
double last_path_cost(void) const;
- /*! Get cost of the last path. */
- void last_path_cost(double c);
-
/*! Get eta, the RRT* constant used in near vertices and steering. */
double eta() const;