00001
00002
00003
00004
00005 #ifndef CAJUN_VS_GUIDE_H
00006 #define CAJUN_VS_GUIDE_H
00007
00008 #include "guide_mode.H"
00009 #include "conf.H"
00010
00011 namespace cajun
00012 {
00018 class vs_guide_t : public guide_mode_t
00019 {
00020 private:
00021 double m_min_look_ahead_distance;
00022 double m_max_look_ahead_distance;
00023 double look_ahead_distance_vs;
00024 double look_ahead_distance;
00025 double reverse_look_ahead_distance;
00026 double forward_look_ahead_distance;
00027 double m_reduction_factor;
00028 double offset;
00029 int gain_scheduling_opt;
00030
00031 bool m_selective_rounding;
00032
00033 bool read_conf (const conf_t &conf);
00034 void get_drive_point_position (waypoint_t &goal_wp);
00035 bool can_look_beyond_wp (const uniform_path_t &goal_data,
00036 unsigned goal_index);
00037 void track_with_drive_point (double &look_ahead_distance,
00038 const uniform_path_t &goal_data,
00039 unsigned &goal_index,
00040 double x, double y,
00041 double &distance_from_next_wp,
00042 double heading);
00043 void get_drive_point (waypoint_t &goal_wp,
00044 waypoint_t next_path_wp,
00045 double distance_from_next_wp);
00046 public:
00047 vs_guide_t (const conf_t &conf){read_conf (conf);}
00048 void guide (guide_data_t &gd, const uniform_path_t &goal_data,
00049 unsigned goal_index, double x, double y,
00050 double heading, double speed, bool valid_path,
00051 bool forward, bool tight_path, double tstamp);
00052
00053 };
00054 };
00055 #endif