00001
00002
00003
00004
00005
00006 #ifndef CAJUN_UTURN_TASK_PLANNER_H
00007 #define CAJUN_UTURN_TASK_PLANNER_H
00008
00009
00010 #include "task_planner.H"
00011 #include "uc_planner_param.H"
00012 #include "planner_defs.H"
00013
00014 #define MAX_ACCESS_PHASE 3
00015
00016 namespace cajun
00017 {
00018
00019
00020 class uturn_task_planner_t : public task_planner_t
00021 {
00022 public:
00023 uturn_task_planner_t ();
00024
00025 void set_plan (unsigned sid_, unsigned start_lid_,
00026 unsigned end_lid_);
00027 void get_plan (unsigned &sid_, unsigned &start_lid_,
00028 unsigned &end_lid_);
00029 void set_active ();
00030 path_status_t generate_path (
00031 world_state_t *ws_, path_t &path_, double &p_len_left_,
00032 const path_t &base_path_);
00033 bool get_path_lane_lids (unsigned &sid_,
00034 std::vector<unsigned> &lids_);
00035 bool is_task_complete (world_state_t *ws_, double x_, double y_,
00036 double heading_);
00037 bool is_path_tight () { return true; }
00038 void print_plan ();
00039
00040 protected:
00041 const uc_planner_param_t *m_uc_param;
00042
00043 unsigned m_sid;
00044 unsigned m_start_lid;
00045 unsigned m_end_lid;
00046 bool m_active_generate;
00047
00048
00049
00050 double m_before_turn_x;
00051 double m_before_turn_y;
00052
00053
00054 double m_after_turn_x;
00055 double m_after_turn_y;
00056
00057
00058 double m_start_orient;
00059
00060
00061 unsigned m_turn_phase;
00062 unsigned m_last_turn_phase;
00063
00064 unsigned m_pre_path_copy;
00065 unsigned m_pre_path_index;
00066
00067
00068 double m_turn_radius [MAX_ACCESS_PHASE];
00069 double m_extend_path_length [MAX_ACCESS_PHASE];
00070
00071 double m_turn_angle [MAX_ACCESS_PHASE];
00072
00073 double m_speed_limit_reverse;
00074 double m_speed_limit_forward;
00075
00076 double m_interp_dis;
00077
00078 path_t m_pre_path;
00079
00080 void print_task_completion ();
00081 path_status_t add_3_point_turn (
00082 path_t &path_, double &p_len_left_, unsigned sid_,
00083 unsigned start_lid_, unsigned end_lid_, double min_speed_,
00084 double max_speed_);
00085 void limit_turn_speed_limits (path_t &path_, double min_speed_,
00086 double max_speed_);
00087 void set_speed_limits (path_t &path_, double min_speed_,
00088 double max_speed_);
00089 void turn_path (path_t &path_, double sx_, double sy_,
00090 double p_orient_, double del_angle,
00091 double t_rad, relative_side_t turn,
00092 double min_speed_, double max_speed_);
00093 bool record_conditions (world_state_t *ws_, path_t &path_);
00094 bool copy_path_after_point (double ref_x, double ref_y,
00095 path_t &des_path_,
00096 const path_t &src_path_);
00097 };
00098
00099
00100 };
00101
00102
00103 #endif