00001
00002
00003
00004
00005 #ifndef CAJUN_INTERSECTION_TASK_PLANNER_H
00006 #define CAJUN_INTERSECTION_TASK_PLANNER_H
00007
00008
00009 #include "task_planner.H"
00010 #include "uc_planner_param.H"
00011 #include "rndf_point.H"
00012
00013 namespace cajun
00014 {
00015
00016
00017 class intersection_task_planner_t : public task_planner_t
00018 {
00019 public:
00020 enum internal_status_t
00021 {
00022 NOT_ACTIVE_YET,
00023 STOP_AT_INTERSECTION,
00024 READY_TO_GO,
00025 };
00026
00027 intersection_task_planner_t (world_state_t *ws_);
00028
00029 void set_plan (rndf_point_t *exit_wp_, rndf_point_t *entry_wp_);
00030
00031 void get_plan (rndf_point_t* &exit_wp_, rndf_point_t* &entry_wp_);
00032
00033 void set_active ();
00034
00035 path_status_t generate_path (
00036 world_state_t *ws_, path_t &path_, double &p_length_,
00037 const path_t &base_path_);
00038
00039 bool get_path_lane_lids (unsigned &sid_,
00040 std::vector<unsigned> &lids_);
00041
00042 bool is_task_complete (world_state_t *ws_, double x_, double y_,
00043 double heading_);
00044
00045 void print_plan ();
00046
00047 void set_path_blocked (unsigned p_id_);
00048
00049 internal_status_t get_status ()
00050 { return m_internal_status; }
00051
00052 bool is_quick_acceleration_path ()
00053 { return true; }
00054
00055
00056 protected:
00057 const uc_planner_param_t *m_uc_param;
00058
00059 internal_status_t m_internal_status;
00060
00061 double m_stopped;
00062 double m_stop_time;
00063
00064 double m_have_precedence_since;
00065 double m_inter_path_free_since;
00066
00067 rndf_point_t* m_exit_point;
00068 rndf_point_t* m_entry_point;
00069
00070 bool m_left_turn;
00071
00072 bool m_wait_at_intersection;
00073
00074
00075 double m_inter_tstamp;
00076
00077 bool m_is_stop_inter;
00078 unsigned m_inter_id;
00079
00080 double m_lane_width;
00081
00082 double m_min_inter_speed;
00083 double m_max_inter_speed;
00084
00085
00086 path_status_t add_intersection_path (world_state_t *ws_,
00087 path_t &path_,
00088 double &p_length_,
00089 const path_t &base_path_,
00090 double x_, double y_);
00091
00092 bool stop_at_intersection (world_state_t *ws_);
00093
00094 bool inter_precedence (world_state_t *ws_);
00095
00096 bool stop_for_stop_sign (world_state_t *ws_);
00097
00098 bool intersection_region_free (world_state_t *ws_, unsigned inter_id_);
00099
00100
00101
00102
00103
00104 };
00105
00106
00107 };
00108
00109
00110 #endif