00001 // Copyright (C) 2007 University of Louisiana at Lafayette 00002 // Author: Chandan Uddaraju 00003 00004 00005 #ifndef CAJUN_IBEO_OBJECT_DATA_H 00006 #define CAJUN_IBEO_OBJECT_DATA_H 00007 00008 00009 #define MAX_OBJECTS 64 00010 #define MAX_CONTOURPOINTS 16 00011 00012 // common for short and long 00013 struct object_data_t 00014 { 00015 /* * \brief Specified the number of objects which were transmitted. 00016 */ 00017 unsigned num_of_objects; 00018 /* * \brief Specified the status of the Laserscanner. 00019 * 00020 * There are 2 possibilities: 00021 * - 0: Error and 00022 * - 1: already. 00023 */ 00024 unsigned sensor_status; 00025 /* * \brief Specified if the Laserscanner (or the IPC) has been calibrated. 00026 * 00027 * There are 2 possibilities: 00028 * - 0: not calibrated and 00029 * - 1: calibrated. 00030 */ 00031 unsigned calib_flag; 00032 // * \brief Number of the object-dataset (will be incremented with each scan) 00033 unsigned cycle_counter; 00034 00035 // * \brief Time of the first scanpoint from the corresponding scan. 00036 unsigned timestamp; 00037 00038 /* * \brief Shows if the Laserscanner is dirty or not. 00039 * 00040 * There are 3 possibilities: 00041 * - 0: The Laserscanner isn't dirty, 00042 * - 1: the Laserscanner is dirty and must been cleaned and 00043 * - 255: the dirt-information isn't available. 00044 */ 00045 unsigned sensor_dirty; 00046 00047 bool sensor_dirty_valid; 00048 00049 bool dirt_det_start_angle_valid; 00050 00051 00052 /* brief Specified the startangle of the dirt-area in case of a dirty Laserscanner [deg]. 00053 */ 00054 unsigned dirt_det_start_angle; 00055 00056 bool dirt_det_end_angle_valid; 00057 00058 unsigned dirt_det_end_angle; 00059 00063 bool rain_det_valid; 00064 00074 unsigned rain_detection; 00075 00081 unsigned object_age[MAX_OBJECTS]; 00088 unsigned tracking_number[MAX_OBJECTS]; 00098 unsigned tracking_status[MAX_OBJECTS]; 00106 bool class_certainty_valid[MAX_OBJECTS]; 00112 unsigned class_certainty[MAX_OBJECTS]; 00127 unsigned classification[MAX_OBJECTS]; 00135 bool age_of_class_valid[MAX_OBJECTS]; 00141 unsigned age_of_classification[MAX_OBJECTS]; 00147 unsigned num_of_points[MAX_OBJECTS]; 00154 double point_num_x_pos[MAX_OBJECTS][MAX_CONTOURPOINTS]; 00161 double point_num_y_pos[MAX_OBJECTS][MAX_CONTOURPOINTS]; 00169 bool velocity_x_valid[MAX_OBJECTS]; 00176 double velocity_x[MAX_OBJECTS]; 00185 bool abs_vel_x_valid [MAX_OBJECTS]; 00186 00187 double abs_vel_x [MAX_OBJECTS]; 00188 00189 bool velocity_y_valid[MAX_OBJECTS]; 00196 double velocity_y[MAX_OBJECTS]; 00205 bool abs_vel_y_valid [MAX_OBJECTS]; 00206 00207 double abs_vel_y [MAX_OBJECTS]; 00208 00209 bool acceleration_x_valid[MAX_OBJECTS]; 00216 double acceleration_x[MAX_OBJECTS]; 00224 bool acceleration_y_valid[MAX_OBJECTS]; 00231 double acceleration_y[MAX_OBJECTS]; 00232 00238 unsigned rel_moment_measure[MAX_OBJECTS]; 00246 bool pos_x_sigma_valid[MAX_OBJECTS]; 00252 double pos_x_sigma[MAX_OBJECTS]; 00260 bool pos_y_sigma_valid[MAX_OBJECTS]; 00266 double pos_y_sigma[MAX_OBJECTS]; 00274 bool velocity_x_sigma_valid[MAX_OBJECTS]; 00280 double velocity_x_sigma[MAX_OBJECTS]; 00288 bool velocity_y_sigma_valid[MAX_OBJECTS]; 00294 double velocity_y_sigma[MAX_OBJECTS]; 00302 bool pos_correl_coeff_valid[MAX_OBJECTS]; 00308 double pos_correl_coeff[MAX_OBJECTS]; 00316 bool velocity_correl_coeff_valid[MAX_OBJECTS]; 00322 double velocity_correl_coeff[MAX_OBJECTS]; 00330 bool height_valid[MAX_OBJECTS]; 00337 double obj_height[MAX_OBJECTS]; 00345 bool height_sigma_valid[MAX_OBJECTS]; 00351 double obj_height_sigma[MAX_OBJECTS]; 00359 bool ACC_type_valid[MAX_OBJECTS]; 00365 unsigned ACC_type[MAX_OBJECTS]; 00373 bool lane_valid[MAX_OBJECTS]; 00379 unsigned lane[MAX_OBJECTS]; 00385 bool time_to_collision_valid[MAX_OBJECTS]; 00393 unsigned time_to_collision[MAX_OBJECTS]; 00399 bool crash_prob_valid[MAX_OBJECTS]; 00407 unsigned crash_prob[MAX_OBJECTS]; 00408 00416 bool left_lane_offset_valid; 00423 double left_lane_offset; 00431 bool right_lane_offset_valid; 00438 double right_lane_offset; 00446 bool heading_angle_valid; 00453 double heading_angle; 00461 bool curvature_valid; 00468 double curvature; 00476 bool num_of_lanes_valid; 00483 unsigned num_of_lanes; 00491 bool confidence_level_valid; 00499 unsigned confidence_level; 00507 bool view_range_valid; 00515 double view_range; 00516 00521 unsigned check_sum; 00522 00527 unsigned CP_object_num; 00533 bool CP_Object_num_valid; 00538 unsigned CP_time_to_collision; 00544 bool CP_TTC_valid; 00549 unsigned CP_crash_prob; 00555 bool CP_crash_prob_valid; 00556 00557 unsigned error_code; 00558 }; 00559 00560 namespace ibeo 00561 { 00562 class ibeo_object_data_t 00563 { 00564 protected: 00565 static unsigned const FORMAT_OFFSET = 1; 00566 unsigned m_num_of_objects; 00567 public: 00568 static unsigned const SHORT_FORMAT = 64; 00569 static unsigned const LONG_FORMAT = 128; 00570 00571 ibeo_object_data_t (): m_num_of_objects (0) {}; 00572 unsigned num_of_objects () 00573 { 00574 return m_num_of_objects; 00575 } 00576 00577 unsigned decode_format (unsigned char const *data_) 00578 { 00579 return (data_[FORMAT_OFFSET]); 00580 } 00581 bool decode_long_format_obj_data (unsigned char const *data_, 00582 object_data_t *object_data, 00583 unsigned size); 00584 bool decode_short_format_obj_data (unsigned char const *data_, 00585 object_data_t *object_data, 00586 unsigned size); 00587 }; 00588 }; 00589 #endif