00001
00002
00003
00004
00005 #ifndef CAJUN_SPEED_PLANNER_H
00006 #define CAJUN_SPEED_PLANNER_H
00007
00008 #include "conf.H"
00009 #include "data_type.H"
00010 #include "uniform_path.H"
00011
00012 namespace cajun
00013 {
00014 class speed_planner_t
00015 {
00016 private:
00017 double m_suggested_deceleration;
00018
00019 double m_max_acceleration;
00020 double m_max_deceleration;
00021
00022 double m_pause_deceleration;
00023 bool m_already_paused;
00024 double m_tstamp_when_paused;
00025 double m_speed_when_paused;
00026 double m_speed_look_ahead_time;
00027
00028 double m_LA_time;
00029 public:
00030 speed_planner_t (const conf_t &conf);
00031 ~speed_planner_t ();
00032 double desired_speed (double tstamp, double present_speed,
00033 double safety_speed_limit,
00034 uniform_path_t &path, int goal_index,
00035 double bx, double by,
00036 double &desired_speed_rate,
00037 bool pause);
00038 void set_consistent_speed_limits (uniform_path_t &path);
00039
00040 private:
00041 double safe_approach_speed (double present_speed,
00042 double distance_between_points);
00043 double next_lower_speed (double min_speed,
00044 double present_speed);
00045 bool read_config (const conf_t &conf);
00046 double speed_at_LA_point (double pres_speed, double bx,
00047 double by,
00048 uniform_path_t &path,
00049 int goal_index, int &v_gi);
00050 void compute_speed_rate (double target_speed,
00051 double present_speed,
00052 double &desired_speed_rate);
00053 double speed_at_point (uniform_path_t &path, int goal_index,
00054 double x_, double y_);
00055 void compute_LA_point (double LA_dis, double pres_x,
00056 double pres_y,
00057 uniform_path_t &path, unsigned gi,
00058 double &LA_x, double &LA_y,
00059 int &LA_gi);
00060 };
00061 };
00062
00063
00064
00065 #endif