00001
00002
00003
00004 #ifndef CAJUN_TRAFFIC_VERIFIER_H
00005 #define CAJUN_TRAFFIC_VERIFIER_H
00006
00007
00008 #include "data_type.H"
00009 #include "rndf.H"
00010 #include "world_state.H"
00011 #include "uc_planner_param.H"
00012
00013 #include "intersection_task_planner.H"
00014 #include "change_lane_task_planner.H"
00015 #include "uturn_task_planner.H"
00016 #include "passing_lane_task_planner.H"
00017 #include "task_planner_util.H"
00018
00019 namespace cajun
00020 {
00021 class traffic_verifier_t
00022 {
00023
00024 public:
00025 traffic_verifier_t (world_state_t *ws_, rndf_t const *rndf_);
00026
00027 bool path_free_of_traffic (std::deque<task_planner_t *> &plan_,
00028 unsigned &stop_tp_ind_,
00029 unsigned &stop_path_ind_);
00030
00031
00032 private:
00033 world_state_t *m_ws;
00034 rndf_t const *m_rndf;
00035
00036 const uc_planner_param_t *m_uc_param;
00037
00038 bool intersection_free_of_traffic (
00039 intersection_task_planner_t* int_tp_,
00040 unsigned &stop_path_ind_, double start_tstamp_);
00041
00042 bool change_lane_free_of_traffic (
00043 change_lane_task_planner_t* cl_tp,
00044 unsigned &stop_path_ind_, double start_tstamp_);
00045
00046 bool uturn_free_of_traffic (uturn_task_planner_t *ut_tp_,
00047 double start_tstamp_);
00048
00049 bool passing_lane_free_of_traffic (
00050 passing_lane_task_planner_t *pl_tp,
00051 unsigned &stop_path_ind_,
00052 double start_tstamp_);
00053
00054 bool approach_traffic (
00055 rndf_t::waypoint_id_t const &exit_wp_id_,
00056 rndf_t::waypoint_id_t const &entry_wp_id_,
00057 double till_time_);
00058
00059 bool approaching_traffic_through_radar (
00060 rndf_t::waypoint_id_t const &ref_exit_id,
00061 rndf_t::waypoint_id_t const &entry_id,
00062 double till_time_);
00063
00064 bool check_radar (std::vector<radar_info_t> const &radar_qid_,
00065 double till_time_);
00066
00067 bool traffic_crossing (double x_, double y_,
00068 unsigned sid_, unsigned lid_,
00069 unsigned wid_, double till_time_);
00070
00071 void traffic_approach_point (
00072 std::vector<blocked_lane_data_t> &traff_approaching,
00073 double x_, double y_, unsigned sid_, unsigned lid_,
00074 unsigned wid_);
00075
00076 bool tp_path_free_of_traffic (task_planner_t *tp_,
00077 unsigned tp_i,
00078 unsigned &stop_tp_ind_,
00079 unsigned &stop_path_ind_,
00080 double start_tstamp_);
00081
00082 int radar_to_check (
00083 rndf_t::waypoint_id_t const &ref_exit_id,
00084 rndf_t::waypoint_id_t const &entry_id);
00085 };
00086
00087 };
00088
00089
00090 #endif