00001 // Copyright (C) 2006 Christopher Mire 00002 // Copyright (C) 2006 University of Louisiana at Lafayette 00003 // Authors: Pablo Mejia, Suresh Golconda, Christopher Mire 00004 00005 #ifndef CAJUN_LASER_DATA_H 00006 #define CAJUN_LASER_DATA_H 00007 00008 #define ACTUAL_BEAM 1 00009 #define OBSTACLE_POSITION 2 00010 00011 #include "data_queue.H" 00012 #include "conf.H" 00013 #include "cbviz_util.H" 00014 #include <string> 00015 #include "world_state.H" 00016 #include "tstamp_buffering.H" 00017 00018 namespace cajun 00019 { 00020 class laser_data_t 00021 { 00022 public: 00023 laser_data_t () {;}; 00024 laser_data_t (double cbviz_origin_pos[3], int scan_gp_id, 00025 conf_t &conf, world_state_t *ws_); 00026 ~laser_data_t (){;}; 00027 bool get_laser_beam_position (int id, 00028 scan_gp_data_t::coord_t *start_beam, 00029 scan_gp_data_t::coord_t *end_beam, 00030 unsigned packet_); 00031 00032 unsigned get_num_beams (unsigned packet_); 00033 00034 bool read_from_queue_head (); 00035 bool read_from_queue_next (); 00036 protected: 00037 int m_scan_gp_id; 00038 world_state_t *m_ws; 00039 access_data_t *m_ad; 00040 std::vector <scan_gp_data_t> m_scan_gp_list; 00041 double cbviz_origin[3]; 00042 std::string m_conf_filename; 00043 int m_display_laser_beams; 00044 double laser_position[10000][2]; 00045 double number_of_laser_beams; 00046 data_queue_reader_t<scan_gp_data_t> *m_scan_gp_dq; 00047 bool m_qid_ok; 00048 private: 00049 std::vector <scan_gp_data_t> m_latest_scan_gp_list; 00050 tstamp_buffering_t <scan_gp_data_t> m_scan_gp_buffer; 00051 scan_gp_data_t m_scan_gp_data; 00052 }; 00053 }; 00054 #endif 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066