00001 // Copyright (C) 2006 University of Louisiana at Lafayette 00002 // Authors: Christopher Mire 00003 00004 #ifndef CAJUN_CBSIM_OBJECT_INFO_H 00005 #define CAJUN_CBSIM_OBJECT_INFO_H 00006 00007 #include <vector> 00008 #include <string> 00009 00010 namespace cajun 00011 { 00012 enum object_type_t { DYN_SIM = 0, DYN_NO_SIM = 1, STATIC = 2, MESH = 3}; 00013 enum control_type_t { SENSOR = 0, MANUAL = 1, SCRIPT = 2, WAYPOINT = 3, NONE = 4}; 00014 enum sensor_type_t { LASER = 0, RAY = 1}; 00015 enum wheel_type_t { SKID = 0, CONVENTIONAL = 1}; 00016 //enum object_shape_t { SIM_BOX = 0, SIM_SPHERE = 1, SIM_CYLINDER = 2, SIM_WHEEL = 3}; 00017 00018 struct dyn_sim_object_t 00019 { 00020 public: 00021 dyn_sim_object_t (){;} 00022 ~dyn_sim_object_t (){;} 00023 int wheel; 00024 float wheel_height; 00025 float wheel_width; 00026 float throttle_rate; 00027 float lever_rate; 00028 }; 00029 00030 struct mesh_object_info_t 00031 { 00032 mesh_object_info_t () {;} 00033 ~mesh_object_info_t () {;} 00034 bool vertices_file_is_full_path; 00035 bool indices_file_is_full_path; 00036 string vertices_file; 00037 string indices_file; 00038 }; 00039 00040 struct sensor_object_t 00041 { 00042 public: 00043 sensor_object_t (){;} 00044 ~sensor_object_t (){;} 00045 int sensor; 00046 std::string sensor_filename; 00047 }; 00048 00049 struct goal_t 00050 { 00051 float sog; 00052 float pause; 00053 double distance; 00054 double angle; 00055 }; 00056 00057 struct script_data_t 00058 { 00059 unsigned num_goals; 00060 std::vector<goal_t> script_goals; 00061 }; 00062 00063 struct rndf_goal_t 00064 { 00065 float sog; 00066 float pause; 00067 unsigned segment; 00068 unsigned lane; 00069 unsigned waypoint; 00070 }; 00071 00072 struct waypoint_data_t 00073 { 00074 unsigned num_goals; 00075 float initial_pause; 00076 std::vector<rndf_goal_t> waypoint_goals; 00077 }; 00078 00079 class object_info_t 00080 { 00081 public: 00082 object_info_t () 00083 { 00084 m_dyn_sim_data = NULL; 00085 m_script_data = NULL; 00086 m_object = STATIC; 00087 m_controller = 0; 00088 m_object_id = 0; 00089 m_segment_id = 0; 00090 m_lane_id = 0; 00091 m_wp_id = 0; 00092 m_pos_x = 0; 00093 m_pos_y = 0; 00094 m_pos_z = 0; 00095 m_size_x = 0; 00096 m_size_y = 0; 00097 m_size_z = 0; 00098 m_orient_x = 0; 00099 m_orient_y = 0; 00100 m_orient_z = 0; 00101 m_num_sensors = 0; 00102 } 00103 ~object_info_t () 00104 { 00105 if (m_dyn_sim_data != NULL) 00106 delete m_dyn_sim_data; 00107 if (m_script_data != NULL) 00108 delete m_script_data; 00109 } 00110 object_type_t m_object; 00111 int m_controller; 00112 script_data_t *m_script_data; 00113 waypoint_data_t *m_waypoint_data; 00114 int m_object_id; 00115 int m_num_objects; 00116 obstacle_data_t::obstacle_shape_t m_shape; 00117 00118 unsigned m_segment_id; 00119 unsigned m_lane_id; 00120 unsigned m_wp_id; 00121 float m_pos_x; 00122 float m_pos_y; 00123 float m_pos_z; 00124 float m_size_x; 00125 float m_size_y; 00126 float m_size_z; 00127 float m_orient_x; 00128 float m_orient_y; 00129 float m_orient_z; 00130 dyn_sim_object_t *m_dyn_sim_data; 00131 mesh_object_info_t *m_mesh_object; 00132 unsigned m_num_sensors; 00133 std::vector<sensor_object_t> m_sensor; 00134 }; 00135 }; 00136 #endif