00001 /************************************************************************************************** 00002 Software License Agreement (BSD License) 00003 00004 Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, are permitted 00008 provided that the following conditions are met: 00009 00010 *Redistributions of source code must retain the above copyright notice, this list of 00011 conditions and the following disclaimer. 00012 *Redistributions in binary form must reproduce the above copyright notice, this list of 00013 conditions and the following disclaimer in the documentation and/or other materials provided 00014 with the distribution. 00015 *Neither the name of the University of Aveiro nor the names of its contributors may be used to 00016 endorse or promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00021 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00022 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00024 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00025 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 ***************************************************************************************************/ 00027 #ifndef _CLASS_COLISION_TIME_H_ 00028 #define _CLASS_COLISION_TIME_H_ 00029 00030 00036 #include <stdio.h> 00037 #include <ros/ros.h> 00038 #include <mtt/TargetListPC.h> 00039 #include <time.h> 00040 #include <sensor_msgs/PointCloud2.h> 00041 #include <pcl/point_cloud.h> 00042 #include <pcl/point_types.h> 00043 #include <pcl/ros/conversions.h> 00044 #include <pcl_ros/transforms.h> 00045 #include <tf/transform_listener.h> 00046 #include <points_from_volume/points_from_volume.h> 00047 #include <atlascar_base/AtlascarStatus.h> 00048 #include <atlascar_base/AtlascarVelocityStatus.h> 00049 #include <atlascar_base/AtlascarPartialStatus.h> 00050 #include <visualization_msgs/Marker.h> 00051 00052 #include "ros/file_log.h" 00053 #include "rosgraph_msgs/Log.h" 00054 00055 #define PFLN printf("Line = %d\n", __LINE__); 00056 00057 using namespace std; 00058 using namespace pcl; 00059 00063 class class_colision_time 00064 { 00065 public: 00066 00067 struct TYPE_msg_mtt 00068 { 00069 int id; 00070 float x; 00071 float y; 00072 float z; 00073 float v_x; 00074 float v_y; 00075 float v_z; 00076 00077 friend ostream& operator<< (ostream &o, const TYPE_msg_mtt &i) 00078 { 00079 return o 00080 <<"||||||||msg_mtt||||||"<<endl 00081 << "id: "<< i.id<<endl 00082 << "x: "<< i.x<<endl 00083 << "y: "<< i.y<<endl 00084 << "z: "<< i.z<<endl 00085 << "v_x: "<< i.v_x<<endl 00086 << "v_y: "<< i.v_y<<endl 00087 << "v_z: "<< i.v_z<<endl; 00088 } 00089 00090 }; 00091 00092 struct TYPE_msg_partial 00093 { 00094 int lights_high; 00095 int lights_medium; 00096 int ignition; 00097 int lights_left; 00098 int lights_right; 00099 int danger_lights; 00100 int horn; 00101 int throttle; 00102 int brake; 00103 int clutch; 00104 00105 friend ostream& operator<< (ostream &o, const TYPE_msg_partial &i) 00106 { 00107 return o 00108 <<"||||||||msg_partial||||||"<<endl 00109 << "lights_high: "<< i.lights_high<<endl 00110 << "lights_medium: "<< i.lights_medium<<endl 00111 << "ignition: "<< i.ignition<<endl 00112 << "lights_left: "<< i.lights_left<<endl 00113 << "lights_right: "<< i.lights_right<<endl 00114 << "danger_lights: "<< i.danger_lights<<endl 00115 << "horn: "<< i.horn<<endl 00116 << "throttle: "<< i.throttle<<endl 00117 << "brake: "<< i.brake<<endl 00118 << "clutch: "<< i.clutch<<endl; 00119 } 00120 }; 00121 00122 struct TYPE_msg_velocity 00123 { 00124 float counting; 00125 float pulses_sec; 00126 float revolutions_sec; 00127 float velocity; 00128 00129 friend ostream& operator<< (ostream &o, const TYPE_msg_velocity &i) 00130 { 00131 return o 00132 <<"||||||||msg_velocityl||||||"<<endl 00133 << "counting: "<< i.counting<<endl 00134 << "pulses_sec: "<< i.pulses_sec<<endl 00135 << "revolutions_sec: "<< i.revolutions_sec<<endl 00136 << "velocity: "<< i.velocity<<endl; 00137 } 00138 }; 00139 00140 00141 struct TYPE_msg_plc 00142 { 00143 float steering_wheel; 00144 float rpm; 00145 00146 00147 // friend ostream& operator<< (ostream &o, const t_parameters &i) 00148 friend ostream& operator<< (ostream &o, const TYPE_msg_plc &i) 00149 { 00150 return o 00151 <<"||||||||msg_plc||||||"<<endl 00152 << "steering_wheel: "<< i.steering_wheel<<endl 00153 << "rpm: "<< i.rpm<<endl; 00154 } 00155 00156 }; 00157 00158 00159 struct TYPE_msg_bags 00160 { 00161 string name_file; 00162 00163 //double sit_begin; 00164 //double duration; 00165 // double sit_end_1; 00166 double bag_time; 00167 00168 00169 string sit_type_1; 00170 int sit_1; 00171 double lst_obj_sit_1; 00172 int internal_1; 00173 double sit_begin_1; 00174 double duration_1; 00175 double sit_end_1; 00176 00177 string sit_type_2; 00178 int sit_2; 00179 double lst_obj_sit_2; 00180 int internal_2; 00181 double sit_begin_2; 00182 double duration_2; 00183 double sit_end_2; 00184 00185 string sit_type_3; 00186 int sit_3; 00187 double lst_obj_sit_3; 00188 int internal_3; 00189 double sit_begin_3; 00190 double duration_3; 00191 double sit_end_3; 00192 00193 string sit_type_4; 00194 int sit_4; 00195 float lst_obj_sit_4; 00196 int internal_4; 00197 double sit_begin_4; 00198 double duration_4; 00199 double sit_end_4; 00200 00201 00202 00203 friend ostream& operator<< (ostream &o, const TYPE_msg_bags &i) 00204 { 00205 return o 00206 <<"||||||||msg_plc||||||"<<endl 00207 << "name_file: "<< i.name_file<<endl 00208 // << "sit_type: "<< i.sit_type<<endl 00209 // << "sit_begin: "<< i.sit_begin<<endl 00210 // << "duration: "<< i.duration<<endl 00211 // << "sit_end: "<< i.sit_end<<endl 00212 << "bag_time: "<< i.bag_time<<endl; 00213 } 00214 00215 }; 00216 00217 00218 00222 class_colision_time() 00223 { }; 00224 00228 ~class_colision_time() 00229 { }; 00230 00231 00232 // void topic_callback_partial(atlascar_base::AtlascarPartialStatus AtlascarPartialStatus_msg); 00233 // // 00234 // void topic_callback_velocity(atlascar_base::AtlascarVelocityStatus AtlascarVelocityStatus_msg); 00235 // 00236 // void topic_callback_plc_status(atlascar_base::AtlascarStatus AtlascarStatus_msg); 00237 00238 // int cria_txt(void); 00239 // char* TimeString(); 00240 00241 00242 private: 00243 00244 00245 00246 00247 }; 00248 00249 #endif