$search
00001 """autogenerated by genmsg_py from Detection.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import cob_object_detection_msgs.msg 00007 import sensor_msgs.msg 00008 import std_msgs.msg 00009 00010 class Detection(roslib.message.Message): 00011 _md5sum = "0e10cbf79379d085e3459569bbe22c63" 00012 _type = "cob_object_detection_msgs/Detection" 00013 _has_header = True #flag to mark the presence of a Header object 00014 _full_text = """Header header 00015 string label 00016 string detector 00017 float32 score 00018 Mask mask 00019 geometry_msgs/PoseStamped pose 00020 geometry_msgs/Point bounding_box_lwh 00021 00022 ================================================================================ 00023 MSG: std_msgs/Header 00024 # Standard metadata for higher-level stamped data types. 00025 # This is generally used to communicate timestamped data 00026 # in a particular coordinate frame. 00027 # 00028 # sequence ID: consecutively increasing ID 00029 uint32 seq 00030 #Two-integer timestamp that is expressed as: 00031 # * stamp.secs: seconds (stamp_secs) since epoch 00032 # * stamp.nsecs: nanoseconds since stamp_secs 00033 # time-handling sugar is provided by the client library 00034 time stamp 00035 #Frame this data is associated with 00036 # 0: no frame 00037 # 1: global frame 00038 string frame_id 00039 00040 ================================================================================ 00041 MSG: cob_object_detection_msgs/Mask 00042 # this message is used to mark where an object is present in an image 00043 # this can be done either by a roi region on the image (less precise) or a mask (more precise) 00044 00045 Rect roi 00046 00047 # in the case when mask is used, 'roi' specifies the image region and 'mask' 00048 # (which should be of the same size) a binary mask in that region 00049 sensor_msgs/Image mask 00050 00051 # in the case there is 3D data available, 'indices' are used to index the 00052 # part of the point cloud representing the object 00053 #pcl/PointIndices indices 00054 00055 ================================================================================ 00056 MSG: cob_object_detection_msgs/Rect 00057 int32 x 00058 int32 y 00059 int32 width 00060 int32 height 00061 00062 ================================================================================ 00063 MSG: sensor_msgs/Image 00064 # This message contains an uncompressed image 00065 # (0, 0) is at top-left corner of image 00066 # 00067 00068 Header header # Header timestamp should be acquisition time of image 00069 # Header frame_id should be optical frame of camera 00070 # origin of frame should be optical center of cameara 00071 # +x should point to the right in the image 00072 # +y should point down in the image 00073 # +z should point into to plane of the image 00074 # If the frame_id here and the frame_id of the CameraInfo 00075 # message associated with the image conflict 00076 # the behavior is undefined 00077 00078 uint32 height # image height, that is, number of rows 00079 uint32 width # image width, that is, number of columns 00080 00081 # The legal values for encoding are in file src/image_encodings.cpp 00082 # If you want to standardize a new string format, join 00083 # ros-users@lists.sourceforge.net and send an email proposing a new encoding. 00084 00085 string encoding # Encoding of pixels -- channel meaning, ordering, size 00086 # taken from the list of strings in src/image_encodings.cpp 00087 00088 uint8 is_bigendian # is this data bigendian? 00089 uint32 step # Full row length in bytes 00090 uint8[] data # actual matrix data, size is (step * rows) 00091 00092 ================================================================================ 00093 MSG: geometry_msgs/PoseStamped 00094 # A Pose with reference coordinate frame and timestamp 00095 Header header 00096 Pose pose 00097 00098 ================================================================================ 00099 MSG: geometry_msgs/Pose 00100 # A representation of pose in free space, composed of postion and orientation. 00101 Point position 00102 Quaternion orientation 00103 00104 ================================================================================ 00105 MSG: geometry_msgs/Point 00106 # This contains the position of a point in free space 00107 float64 x 00108 float64 y 00109 float64 z 00110 00111 ================================================================================ 00112 MSG: geometry_msgs/Quaternion 00113 # This represents an orientation in free space in quaternion form. 00114 00115 float64 x 00116 float64 y 00117 float64 z 00118 float64 w 00119 00120 """ 00121 __slots__ = ['header','label','detector','score','mask','pose','bounding_box_lwh'] 00122 _slot_types = ['Header','string','string','float32','cob_object_detection_msgs/Mask','geometry_msgs/PoseStamped','geometry_msgs/Point'] 00123 00124 def __init__(self, *args, **kwds): 00125 """ 00126 Constructor. Any message fields that are implicitly/explicitly 00127 set to None will be assigned a default value. The recommend 00128 use is keyword arguments as this is more robust to future message 00129 changes. You cannot mix in-order arguments and keyword arguments. 00130 00131 The available fields are: 00132 header,label,detector,score,mask,pose,bounding_box_lwh 00133 00134 @param args: complete set of field values, in .msg order 00135 @param kwds: use keyword arguments corresponding to message field names 00136 to set specific fields. 00137 """ 00138 if args or kwds: 00139 super(Detection, self).__init__(*args, **kwds) 00140 #message fields cannot be None, assign default values for those that are 00141 if self.header is None: 00142 self.header = std_msgs.msg._Header.Header() 00143 if self.label is None: 00144 self.label = '' 00145 if self.detector is None: 00146 self.detector = '' 00147 if self.score is None: 00148 self.score = 0. 00149 if self.mask is None: 00150 self.mask = cob_object_detection_msgs.msg.Mask() 00151 if self.pose is None: 00152 self.pose = geometry_msgs.msg.PoseStamped() 00153 if self.bounding_box_lwh is None: 00154 self.bounding_box_lwh = geometry_msgs.msg.Point() 00155 else: 00156 self.header = std_msgs.msg._Header.Header() 00157 self.label = '' 00158 self.detector = '' 00159 self.score = 0. 00160 self.mask = cob_object_detection_msgs.msg.Mask() 00161 self.pose = geometry_msgs.msg.PoseStamped() 00162 self.bounding_box_lwh = geometry_msgs.msg.Point() 00163 00164 def _get_types(self): 00165 """ 00166 internal API method 00167 """ 00168 return self._slot_types 00169 00170 def serialize(self, buff): 00171 """ 00172 serialize message into buffer 00173 @param buff: buffer 00174 @type buff: StringIO 00175 """ 00176 try: 00177 _x = self 00178 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00179 _x = self.header.frame_id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 _x = self.label 00183 length = len(_x) 00184 buff.write(struct.pack('<I%ss'%length, length, _x)) 00185 _x = self.detector 00186 length = len(_x) 00187 buff.write(struct.pack('<I%ss'%length, length, _x)) 00188 _x = self 00189 buff.write(_struct_f4i3I.pack(_x.score, _x.mask.roi.x, _x.mask.roi.y, _x.mask.roi.width, _x.mask.roi.height, _x.mask.mask.header.seq, _x.mask.mask.header.stamp.secs, _x.mask.mask.header.stamp.nsecs)) 00190 _x = self.mask.mask.header.frame_id 00191 length = len(_x) 00192 buff.write(struct.pack('<I%ss'%length, length, _x)) 00193 _x = self 00194 buff.write(_struct_2I.pack(_x.mask.mask.height, _x.mask.mask.width)) 00195 _x = self.mask.mask.encoding 00196 length = len(_x) 00197 buff.write(struct.pack('<I%ss'%length, length, _x)) 00198 _x = self 00199 buff.write(_struct_BI.pack(_x.mask.mask.is_bigendian, _x.mask.mask.step)) 00200 _x = self.mask.mask.data 00201 length = len(_x) 00202 # - if encoded as a list instead, serialize as bytes instead of string 00203 if type(_x) in [list, tuple]: 00204 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00205 else: 00206 buff.write(struct.pack('<I%ss'%length, length, _x)) 00207 _x = self 00208 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs)) 00209 _x = self.pose.header.frame_id 00210 length = len(_x) 00211 buff.write(struct.pack('<I%ss'%length, length, _x)) 00212 _x = self 00213 buff.write(_struct_10d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.bounding_box_lwh.x, _x.bounding_box_lwh.y, _x.bounding_box_lwh.z)) 00214 except struct.error as se: self._check_types(se) 00215 except TypeError as te: self._check_types(te) 00216 00217 def deserialize(self, str): 00218 """ 00219 unpack serialized message in str into this message instance 00220 @param str: byte array of serialized message 00221 @type str: str 00222 """ 00223 try: 00224 if self.header is None: 00225 self.header = std_msgs.msg._Header.Header() 00226 if self.mask is None: 00227 self.mask = cob_object_detection_msgs.msg.Mask() 00228 if self.pose is None: 00229 self.pose = geometry_msgs.msg.PoseStamped() 00230 if self.bounding_box_lwh is None: 00231 self.bounding_box_lwh = geometry_msgs.msg.Point() 00232 end = 0 00233 _x = self 00234 start = end 00235 end += 12 00236 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00237 start = end 00238 end += 4 00239 (length,) = _struct_I.unpack(str[start:end]) 00240 start = end 00241 end += length 00242 self.header.frame_id = str[start:end] 00243 start = end 00244 end += 4 00245 (length,) = _struct_I.unpack(str[start:end]) 00246 start = end 00247 end += length 00248 self.label = str[start:end] 00249 start = end 00250 end += 4 00251 (length,) = _struct_I.unpack(str[start:end]) 00252 start = end 00253 end += length 00254 self.detector = str[start:end] 00255 _x = self 00256 start = end 00257 end += 32 00258 (_x.score, _x.mask.roi.x, _x.mask.roi.y, _x.mask.roi.width, _x.mask.roi.height, _x.mask.mask.header.seq, _x.mask.mask.header.stamp.secs, _x.mask.mask.header.stamp.nsecs,) = _struct_f4i3I.unpack(str[start:end]) 00259 start = end 00260 end += 4 00261 (length,) = _struct_I.unpack(str[start:end]) 00262 start = end 00263 end += length 00264 self.mask.mask.header.frame_id = str[start:end] 00265 _x = self 00266 start = end 00267 end += 8 00268 (_x.mask.mask.height, _x.mask.mask.width,) = _struct_2I.unpack(str[start:end]) 00269 start = end 00270 end += 4 00271 (length,) = _struct_I.unpack(str[start:end]) 00272 start = end 00273 end += length 00274 self.mask.mask.encoding = str[start:end] 00275 _x = self 00276 start = end 00277 end += 5 00278 (_x.mask.mask.is_bigendian, _x.mask.mask.step,) = _struct_BI.unpack(str[start:end]) 00279 start = end 00280 end += 4 00281 (length,) = _struct_I.unpack(str[start:end]) 00282 start = end 00283 end += length 00284 self.mask.mask.data = str[start:end] 00285 _x = self 00286 start = end 00287 end += 12 00288 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00289 start = end 00290 end += 4 00291 (length,) = _struct_I.unpack(str[start:end]) 00292 start = end 00293 end += length 00294 self.pose.header.frame_id = str[start:end] 00295 _x = self 00296 start = end 00297 end += 80 00298 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.bounding_box_lwh.x, _x.bounding_box_lwh.y, _x.bounding_box_lwh.z,) = _struct_10d.unpack(str[start:end]) 00299 return self 00300 except struct.error as e: 00301 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00302 00303 00304 def serialize_numpy(self, buff, numpy): 00305 """ 00306 serialize message with numpy array types into buffer 00307 @param buff: buffer 00308 @type buff: StringIO 00309 @param numpy: numpy python module 00310 @type numpy module 00311 """ 00312 try: 00313 _x = self 00314 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00315 _x = self.header.frame_id 00316 length = len(_x) 00317 buff.write(struct.pack('<I%ss'%length, length, _x)) 00318 _x = self.label 00319 length = len(_x) 00320 buff.write(struct.pack('<I%ss'%length, length, _x)) 00321 _x = self.detector 00322 length = len(_x) 00323 buff.write(struct.pack('<I%ss'%length, length, _x)) 00324 _x = self 00325 buff.write(_struct_f4i3I.pack(_x.score, _x.mask.roi.x, _x.mask.roi.y, _x.mask.roi.width, _x.mask.roi.height, _x.mask.mask.header.seq, _x.mask.mask.header.stamp.secs, _x.mask.mask.header.stamp.nsecs)) 00326 _x = self.mask.mask.header.frame_id 00327 length = len(_x) 00328 buff.write(struct.pack('<I%ss'%length, length, _x)) 00329 _x = self 00330 buff.write(_struct_2I.pack(_x.mask.mask.height, _x.mask.mask.width)) 00331 _x = self.mask.mask.encoding 00332 length = len(_x) 00333 buff.write(struct.pack('<I%ss'%length, length, _x)) 00334 _x = self 00335 buff.write(_struct_BI.pack(_x.mask.mask.is_bigendian, _x.mask.mask.step)) 00336 _x = self.mask.mask.data 00337 length = len(_x) 00338 # - if encoded as a list instead, serialize as bytes instead of string 00339 if type(_x) in [list, tuple]: 00340 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00341 else: 00342 buff.write(struct.pack('<I%ss'%length, length, _x)) 00343 _x = self 00344 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs)) 00345 _x = self.pose.header.frame_id 00346 length = len(_x) 00347 buff.write(struct.pack('<I%ss'%length, length, _x)) 00348 _x = self 00349 buff.write(_struct_10d.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.bounding_box_lwh.x, _x.bounding_box_lwh.y, _x.bounding_box_lwh.z)) 00350 except struct.error as se: self._check_types(se) 00351 except TypeError as te: self._check_types(te) 00352 00353 def deserialize_numpy(self, str, numpy): 00354 """ 00355 unpack serialized message in str into this message instance using numpy for array types 00356 @param str: byte array of serialized message 00357 @type str: str 00358 @param numpy: numpy python module 00359 @type numpy: module 00360 """ 00361 try: 00362 if self.header is None: 00363 self.header = std_msgs.msg._Header.Header() 00364 if self.mask is None: 00365 self.mask = cob_object_detection_msgs.msg.Mask() 00366 if self.pose is None: 00367 self.pose = geometry_msgs.msg.PoseStamped() 00368 if self.bounding_box_lwh is None: 00369 self.bounding_box_lwh = geometry_msgs.msg.Point() 00370 end = 0 00371 _x = self 00372 start = end 00373 end += 12 00374 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00375 start = end 00376 end += 4 00377 (length,) = _struct_I.unpack(str[start:end]) 00378 start = end 00379 end += length 00380 self.header.frame_id = str[start:end] 00381 start = end 00382 end += 4 00383 (length,) = _struct_I.unpack(str[start:end]) 00384 start = end 00385 end += length 00386 self.label = str[start:end] 00387 start = end 00388 end += 4 00389 (length,) = _struct_I.unpack(str[start:end]) 00390 start = end 00391 end += length 00392 self.detector = str[start:end] 00393 _x = self 00394 start = end 00395 end += 32 00396 (_x.score, _x.mask.roi.x, _x.mask.roi.y, _x.mask.roi.width, _x.mask.roi.height, _x.mask.mask.header.seq, _x.mask.mask.header.stamp.secs, _x.mask.mask.header.stamp.nsecs,) = _struct_f4i3I.unpack(str[start:end]) 00397 start = end 00398 end += 4 00399 (length,) = _struct_I.unpack(str[start:end]) 00400 start = end 00401 end += length 00402 self.mask.mask.header.frame_id = str[start:end] 00403 _x = self 00404 start = end 00405 end += 8 00406 (_x.mask.mask.height, _x.mask.mask.width,) = _struct_2I.unpack(str[start:end]) 00407 start = end 00408 end += 4 00409 (length,) = _struct_I.unpack(str[start:end]) 00410 start = end 00411 end += length 00412 self.mask.mask.encoding = str[start:end] 00413 _x = self 00414 start = end 00415 end += 5 00416 (_x.mask.mask.is_bigendian, _x.mask.mask.step,) = _struct_BI.unpack(str[start:end]) 00417 start = end 00418 end += 4 00419 (length,) = _struct_I.unpack(str[start:end]) 00420 start = end 00421 end += length 00422 self.mask.mask.data = str[start:end] 00423 _x = self 00424 start = end 00425 end += 12 00426 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00427 start = end 00428 end += 4 00429 (length,) = _struct_I.unpack(str[start:end]) 00430 start = end 00431 end += length 00432 self.pose.header.frame_id = str[start:end] 00433 _x = self 00434 start = end 00435 end += 80 00436 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.bounding_box_lwh.x, _x.bounding_box_lwh.y, _x.bounding_box_lwh.z,) = _struct_10d.unpack(str[start:end]) 00437 return self 00438 except struct.error as e: 00439 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00440 00441 _struct_I = roslib.message.struct_I 00442 _struct_3I = struct.Struct("<3I") 00443 _struct_BI = struct.Struct("<BI") 00444 _struct_f4i3I = struct.Struct("<f4i3I") 00445 _struct_10d = struct.Struct("<10d") 00446 _struct_2I = struct.Struct("<2I")