00001 // Copyright (C) 2007 University of Louisiana at Lafayette 00002 // Author(s): Christopher Mire 00003 00004 #ifndef CAJUN_ANGULAR_RATE_SENSOR_OBSERVERS_H 00005 #define CAJUN_ANGULAR_RATE_SENSOR_OBSERVERS_H 00006 00007 #include "timer.H" 00008 #include "data_logger.H" 00009 #include "queue_generator.H" 00010 #include "components.H" 00011 #include "sim_world_object.H" 00012 00013 namespace cajun 00014 { 00015 class angular_rate_observer_t; 00016 00018 class angular_rate_sensor_t : public components_t 00019 { 00020 #define DELAY_ANGULAR_RATE 0.01 00021 friend class angular_rate_observer_t; 00022 public: 00023 angular_rate_sensor_t (sim_world_object_t *parent, timer_t *timer); 00024 virtual ~angular_rate_sensor_t (); 00025 void update_angular_rate_data (); 00026 00027 double get_x_vel () { return m_x_vel; } 00028 double get_y_vel () { return m_y_vel; } 00029 double get_z_vel () { return m_z_vel; } 00030 00031 // inherited functions 00032 void update_position ( dBodyID carb ) { }; 00033 void command ( int cmd, double value ) { }; 00034 void simulate_component (dBodyID carb) { }; 00035 private: 00036 sim_world_object_t *m_robot; 00037 double m_x_vel; 00038 double m_y_vel; 00039 double m_z_vel; 00040 angular_rate_observer_t * m_angular_rate_observer; 00041 }; 00042 00044 class angular_rate_observer_t : public timer_t::observer_t 00045 { 00046 angular_rate_sensor_t * m_angular_rate_sensor; 00047 public: 00048 angular_rate_observer_t (angular_rate_sensor_t * m, double interval_v); 00049 virtual ~angular_rate_observer_t (); 00050 bool timeout (double currTime); 00051 }; 00052 }; 00053 #endif