00001
00002
00003
00004
00005 #ifndef CAJUN_BASE_STEERING_H
00006 #define CAJUN_BASE_STEERING_H
00007
00008
00009 #include "guide_data.H"
00010 #include "heading_data.H"
00011 #include "steering_data.H"
00012 #include "conf.H"
00013 #include "integral.H"
00014
00015
00016 namespace cajun
00017 {
00018 class base_steering_t
00019 {
00020 public:
00021 base_steering_t () :
00022 m_last_error (0),
00023 m_last_error_rate (0),
00024 m_last_error_tstamp (0),
00025 m_debug_steering (false)
00026 {
00027 }
00028 virtual ~base_steering_t () {}
00029
00030 virtual bool read_config (const conf_t &conf)
00031 {
00032 return conf.require ("debug_steering",
00033 m_debug_steering);
00034 }
00035 virtual void init ()
00036 {
00037 m_last_error = 0;
00038 m_last_error_rate = 0;
00039 m_last_error_tstamp = 0;
00040 }
00041
00042 virtual void steer (steering_data_t &steering,
00043 double steering_position,
00044 guide_data_t const &gd,
00045 heading_data_t const &heading_data,
00046 double speed_, bool forward,
00047 bool tight_path) = 0;
00048
00049 protected:
00050 double m_last_error;
00051 double m_last_error_rate;
00052 double m_last_error_tstamp;
00053 bool m_debug_steering;
00054 };
00055 };
00056
00057
00058 #endif