00001 // Copyright (C) 2004 Nitin Jyoti, Arun Pratap, Suresh Golconda ;-) 00002 00003 #ifndef CAJUN_CBSIM_NAV_SENSOR_OBSERVERS_H 00004 #define CAJUN_CBSIM_NAV_SENSOR_OBSERVERS_H 00005 00006 #include "timer.H" 00007 #include "data_logger.H" 00008 #include "queue_generator.H" 00009 #include "sim_world_object.H" 00010 #include "components.H" 00011 00012 namespace cajun 00013 { 00014 class nav_observer_t; 00015 00017 class nav_sensor_t : public components_t 00018 { 00019 #define DELAY_GPS 0.01 00020 friend class nav_observer_t; 00021 public: 00022 nav_sensor_t (sim_world_object_t *parent, timer_t *timer); 00023 virtual ~nav_sensor_t (); 00024 nav_data_t * update_nav_data (); 00025 00026 double get_position_x (); 00027 double get_position_y (); 00028 double get_position_z (); 00029 00030 // inherited functions 00031 void update_position (dBodyID carb ) {}; 00032 void command (int cmd, double value ) {}; 00033 void simulate_component (dBodyID carb) {}; 00034 private: 00035 sim_world_object_t *m_robot; 00036 nav_data_t m_nav_data; 00037 nav_observer_t * m_nav_observer; 00038 }; 00039 00041 00042 class nav_observer_t : public timer_t::observer_t 00043 { 00044 public: 00045 nav_observer_t ( nav_sensor_t * m, double interval_v); 00046 virtual ~nav_observer_t ( ); 00047 bool timeout(double currTime); 00048 private: 00049 nav_sensor_t * m_nav_sensor; 00050 }; 00051 }; 00052 #endif