$search
00001 """autogenerated by genmsg_py from DetectObjectsResult.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 DetectObjectsResult(roslib.message.Message): 00011 _md5sum = "6e46a64486bc23cca1c161460b4c92b6" 00012 _type = "cob_object_detection_msgs/DetectObjectsResult" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 # The result 00016 cob_object_detection_msgs/DetectionArray object_list 00017 00018 ================================================================================ 00019 MSG: cob_object_detection_msgs/DetectionArray 00020 Header header 00021 Detection[] detections 00022 00023 ================================================================================ 00024 MSG: std_msgs/Header 00025 # Standard metadata for higher-level stamped data types. 00026 # This is generally used to communicate timestamped data 00027 # in a particular coordinate frame. 00028 # 00029 # sequence ID: consecutively increasing ID 00030 uint32 seq 00031 #Two-integer timestamp that is expressed as: 00032 # * stamp.secs: seconds (stamp_secs) since epoch 00033 # * stamp.nsecs: nanoseconds since stamp_secs 00034 # time-handling sugar is provided by the client library 00035 time stamp 00036 #Frame this data is associated with 00037 # 0: no frame 00038 # 1: global frame 00039 string frame_id 00040 00041 ================================================================================ 00042 MSG: cob_object_detection_msgs/Detection 00043 Header header 00044 string label 00045 string detector 00046 float32 score 00047 Mask mask 00048 geometry_msgs/PoseStamped pose 00049 geometry_msgs/Point bounding_box_lwh 00050 00051 ================================================================================ 00052 MSG: cob_object_detection_msgs/Mask 00053 # this message is used to mark where an object is present in an image 00054 # this can be done either by a roi region on the image (less precise) or a mask (more precise) 00055 00056 Rect roi 00057 00058 # in the case when mask is used, 'roi' specifies the image region and 'mask' 00059 # (which should be of the same size) a binary mask in that region 00060 sensor_msgs/Image mask 00061 00062 # in the case there is 3D data available, 'indices' are used to index the 00063 # part of the point cloud representing the object 00064 #pcl/PointIndices indices 00065 00066 ================================================================================ 00067 MSG: cob_object_detection_msgs/Rect 00068 int32 x 00069 int32 y 00070 int32 width 00071 int32 height 00072 00073 ================================================================================ 00074 MSG: sensor_msgs/Image 00075 # This message contains an uncompressed image 00076 # (0, 0) is at top-left corner of image 00077 # 00078 00079 Header header # Header timestamp should be acquisition time of image 00080 # Header frame_id should be optical frame of camera 00081 # origin of frame should be optical center of cameara 00082 # +x should point to the right in the image 00083 # +y should point down in the image 00084 # +z should point into to plane of the image 00085 # If the frame_id here and the frame_id of the CameraInfo 00086 # message associated with the image conflict 00087 # the behavior is undefined 00088 00089 uint32 height # image height, that is, number of rows 00090 uint32 width # image width, that is, number of columns 00091 00092 # The legal values for encoding are in file src/image_encodings.cpp 00093 # If you want to standardize a new string format, join 00094 # ros-users@lists.sourceforge.net and send an email proposing a new encoding. 00095 00096 string encoding # Encoding of pixels -- channel meaning, ordering, size 00097 # taken from the list of strings in src/image_encodings.cpp 00098 00099 uint8 is_bigendian # is this data bigendian? 00100 uint32 step # Full row length in bytes 00101 uint8[] data # actual matrix data, size is (step * rows) 00102 00103 ================================================================================ 00104 MSG: geometry_msgs/PoseStamped 00105 # A Pose with reference coordinate frame and timestamp 00106 Header header 00107 Pose pose 00108 00109 ================================================================================ 00110 MSG: geometry_msgs/Pose 00111 # A representation of pose in free space, composed of postion and orientation. 00112 Point position 00113 Quaternion orientation 00114 00115 ================================================================================ 00116 MSG: geometry_msgs/Point 00117 # This contains the position of a point in free space 00118 float64 x 00119 float64 y 00120 float64 z 00121 00122 ================================================================================ 00123 MSG: geometry_msgs/Quaternion 00124 # This represents an orientation in free space in quaternion form. 00125 00126 float64 x 00127 float64 y 00128 float64 z 00129 float64 w 00130 00131 """ 00132 __slots__ = ['object_list'] 00133 _slot_types = ['cob_object_detection_msgs/DetectionArray'] 00134 00135 def __init__(self, *args, **kwds): 00136 """ 00137 Constructor. Any message fields that are implicitly/explicitly 00138 set to None will be assigned a default value. The recommend 00139 use is keyword arguments as this is more robust to future message 00140 changes. You cannot mix in-order arguments and keyword arguments. 00141 00142 The available fields are: 00143 object_list 00144 00145 @param args: complete set of field values, in .msg order 00146 @param kwds: use keyword arguments corresponding to message field names 00147 to set specific fields. 00148 """ 00149 if args or kwds: 00150 super(DetectObjectsResult, self).__init__(*args, **kwds) 00151 #message fields cannot be None, assign default values for those that are 00152 if self.object_list is None: 00153 self.object_list = cob_object_detection_msgs.msg.DetectionArray() 00154 else: 00155 self.object_list = cob_object_detection_msgs.msg.DetectionArray() 00156 00157 def _get_types(self): 00158 """ 00159 internal API method 00160 """ 00161 return self._slot_types 00162 00163 def serialize(self, buff): 00164 """ 00165 serialize message into buffer 00166 @param buff: buffer 00167 @type buff: StringIO 00168 """ 00169 try: 00170 _x = self 00171 buff.write(_struct_3I.pack(_x.object_list.header.seq, _x.object_list.header.stamp.secs, _x.object_list.header.stamp.nsecs)) 00172 _x = self.object_list.header.frame_id 00173 length = len(_x) 00174 buff.write(struct.pack('<I%ss'%length, length, _x)) 00175 length = len(self.object_list.detections) 00176 buff.write(_struct_I.pack(length)) 00177 for val1 in self.object_list.detections: 00178 _v1 = val1.header 00179 buff.write(_struct_I.pack(_v1.seq)) 00180 _v2 = _v1.stamp 00181 _x = _v2 00182 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00183 _x = _v1.frame_id 00184 length = len(_x) 00185 buff.write(struct.pack('<I%ss'%length, length, _x)) 00186 _x = val1.label 00187 length = len(_x) 00188 buff.write(struct.pack('<I%ss'%length, length, _x)) 00189 _x = val1.detector 00190 length = len(_x) 00191 buff.write(struct.pack('<I%ss'%length, length, _x)) 00192 buff.write(_struct_f.pack(val1.score)) 00193 _v3 = val1.mask 00194 _v4 = _v3.roi 00195 _x = _v4 00196 buff.write(_struct_4i.pack(_x.x, _x.y, _x.width, _x.height)) 00197 _v5 = _v3.mask 00198 _v6 = _v5.header 00199 buff.write(_struct_I.pack(_v6.seq)) 00200 _v7 = _v6.stamp 00201 _x = _v7 00202 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00203 _x = _v6.frame_id 00204 length = len(_x) 00205 buff.write(struct.pack('<I%ss'%length, length, _x)) 00206 _x = _v5 00207 buff.write(_struct_2I.pack(_x.height, _x.width)) 00208 _x = _v5.encoding 00209 length = len(_x) 00210 buff.write(struct.pack('<I%ss'%length, length, _x)) 00211 _x = _v5 00212 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00213 _x = _v5.data 00214 length = len(_x) 00215 # - if encoded as a list instead, serialize as bytes instead of string 00216 if type(_x) in [list, tuple]: 00217 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00218 else: 00219 buff.write(struct.pack('<I%ss'%length, length, _x)) 00220 _v8 = val1.pose 00221 _v9 = _v8.header 00222 buff.write(_struct_I.pack(_v9.seq)) 00223 _v10 = _v9.stamp 00224 _x = _v10 00225 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00226 _x = _v9.frame_id 00227 length = len(_x) 00228 buff.write(struct.pack('<I%ss'%length, length, _x)) 00229 _v11 = _v8.pose 00230 _v12 = _v11.position 00231 _x = _v12 00232 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00233 _v13 = _v11.orientation 00234 _x = _v13 00235 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00236 _v14 = val1.bounding_box_lwh 00237 _x = _v14 00238 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00239 except struct.error as se: self._check_types(se) 00240 except TypeError as te: self._check_types(te) 00241 00242 def deserialize(self, str): 00243 """ 00244 unpack serialized message in str into this message instance 00245 @param str: byte array of serialized message 00246 @type str: str 00247 """ 00248 try: 00249 if self.object_list is None: 00250 self.object_list = cob_object_detection_msgs.msg.DetectionArray() 00251 end = 0 00252 _x = self 00253 start = end 00254 end += 12 00255 (_x.object_list.header.seq, _x.object_list.header.stamp.secs, _x.object_list.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00256 start = end 00257 end += 4 00258 (length,) = _struct_I.unpack(str[start:end]) 00259 start = end 00260 end += length 00261 self.object_list.header.frame_id = str[start:end] 00262 start = end 00263 end += 4 00264 (length,) = _struct_I.unpack(str[start:end]) 00265 self.object_list.detections = [] 00266 for i in range(0, length): 00267 val1 = cob_object_detection_msgs.msg.Detection() 00268 _v15 = val1.header 00269 start = end 00270 end += 4 00271 (_v15.seq,) = _struct_I.unpack(str[start:end]) 00272 _v16 = _v15.stamp 00273 _x = _v16 00274 start = end 00275 end += 8 00276 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 start = end 00281 end += length 00282 _v15.frame_id = str[start:end] 00283 start = end 00284 end += 4 00285 (length,) = _struct_I.unpack(str[start:end]) 00286 start = end 00287 end += length 00288 val1.label = str[start:end] 00289 start = end 00290 end += 4 00291 (length,) = _struct_I.unpack(str[start:end]) 00292 start = end 00293 end += length 00294 val1.detector = str[start:end] 00295 start = end 00296 end += 4 00297 (val1.score,) = _struct_f.unpack(str[start:end]) 00298 _v17 = val1.mask 00299 _v18 = _v17.roi 00300 _x = _v18 00301 start = end 00302 end += 16 00303 (_x.x, _x.y, _x.width, _x.height,) = _struct_4i.unpack(str[start:end]) 00304 _v19 = _v17.mask 00305 _v20 = _v19.header 00306 start = end 00307 end += 4 00308 (_v20.seq,) = _struct_I.unpack(str[start:end]) 00309 _v21 = _v20.stamp 00310 _x = _v21 00311 start = end 00312 end += 8 00313 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00314 start = end 00315 end += 4 00316 (length,) = _struct_I.unpack(str[start:end]) 00317 start = end 00318 end += length 00319 _v20.frame_id = str[start:end] 00320 _x = _v19 00321 start = end 00322 end += 8 00323 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00324 start = end 00325 end += 4 00326 (length,) = _struct_I.unpack(str[start:end]) 00327 start = end 00328 end += length 00329 _v19.encoding = str[start:end] 00330 _x = _v19 00331 start = end 00332 end += 5 00333 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 00334 start = end 00335 end += 4 00336 (length,) = _struct_I.unpack(str[start:end]) 00337 start = end 00338 end += length 00339 _v19.data = str[start:end] 00340 _v22 = val1.pose 00341 _v23 = _v22.header 00342 start = end 00343 end += 4 00344 (_v23.seq,) = _struct_I.unpack(str[start:end]) 00345 _v24 = _v23.stamp 00346 _x = _v24 00347 start = end 00348 end += 8 00349 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00350 start = end 00351 end += 4 00352 (length,) = _struct_I.unpack(str[start:end]) 00353 start = end 00354 end += length 00355 _v23.frame_id = str[start:end] 00356 _v25 = _v22.pose 00357 _v26 = _v25.position 00358 _x = _v26 00359 start = end 00360 end += 24 00361 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00362 _v27 = _v25.orientation 00363 _x = _v27 00364 start = end 00365 end += 32 00366 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00367 _v28 = val1.bounding_box_lwh 00368 _x = _v28 00369 start = end 00370 end += 24 00371 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00372 self.object_list.detections.append(val1) 00373 return self 00374 except struct.error as e: 00375 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00376 00377 00378 def serialize_numpy(self, buff, numpy): 00379 """ 00380 serialize message with numpy array types into buffer 00381 @param buff: buffer 00382 @type buff: StringIO 00383 @param numpy: numpy python module 00384 @type numpy module 00385 """ 00386 try: 00387 _x = self 00388 buff.write(_struct_3I.pack(_x.object_list.header.seq, _x.object_list.header.stamp.secs, _x.object_list.header.stamp.nsecs)) 00389 _x = self.object_list.header.frame_id 00390 length = len(_x) 00391 buff.write(struct.pack('<I%ss'%length, length, _x)) 00392 length = len(self.object_list.detections) 00393 buff.write(_struct_I.pack(length)) 00394 for val1 in self.object_list.detections: 00395 _v29 = val1.header 00396 buff.write(_struct_I.pack(_v29.seq)) 00397 _v30 = _v29.stamp 00398 _x = _v30 00399 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00400 _x = _v29.frame_id 00401 length = len(_x) 00402 buff.write(struct.pack('<I%ss'%length, length, _x)) 00403 _x = val1.label 00404 length = len(_x) 00405 buff.write(struct.pack('<I%ss'%length, length, _x)) 00406 _x = val1.detector 00407 length = len(_x) 00408 buff.write(struct.pack('<I%ss'%length, length, _x)) 00409 buff.write(_struct_f.pack(val1.score)) 00410 _v31 = val1.mask 00411 _v32 = _v31.roi 00412 _x = _v32 00413 buff.write(_struct_4i.pack(_x.x, _x.y, _x.width, _x.height)) 00414 _v33 = _v31.mask 00415 _v34 = _v33.header 00416 buff.write(_struct_I.pack(_v34.seq)) 00417 _v35 = _v34.stamp 00418 _x = _v35 00419 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00420 _x = _v34.frame_id 00421 length = len(_x) 00422 buff.write(struct.pack('<I%ss'%length, length, _x)) 00423 _x = _v33 00424 buff.write(_struct_2I.pack(_x.height, _x.width)) 00425 _x = _v33.encoding 00426 length = len(_x) 00427 buff.write(struct.pack('<I%ss'%length, length, _x)) 00428 _x = _v33 00429 buff.write(_struct_BI.pack(_x.is_bigendian, _x.step)) 00430 _x = _v33.data 00431 length = len(_x) 00432 # - if encoded as a list instead, serialize as bytes instead of string 00433 if type(_x) in [list, tuple]: 00434 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00435 else: 00436 buff.write(struct.pack('<I%ss'%length, length, _x)) 00437 _v36 = val1.pose 00438 _v37 = _v36.header 00439 buff.write(_struct_I.pack(_v37.seq)) 00440 _v38 = _v37.stamp 00441 _x = _v38 00442 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00443 _x = _v37.frame_id 00444 length = len(_x) 00445 buff.write(struct.pack('<I%ss'%length, length, _x)) 00446 _v39 = _v36.pose 00447 _v40 = _v39.position 00448 _x = _v40 00449 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00450 _v41 = _v39.orientation 00451 _x = _v41 00452 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00453 _v42 = val1.bounding_box_lwh 00454 _x = _v42 00455 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00456 except struct.error as se: self._check_types(se) 00457 except TypeError as te: self._check_types(te) 00458 00459 def deserialize_numpy(self, str, numpy): 00460 """ 00461 unpack serialized message in str into this message instance using numpy for array types 00462 @param str: byte array of serialized message 00463 @type str: str 00464 @param numpy: numpy python module 00465 @type numpy: module 00466 """ 00467 try: 00468 if self.object_list is None: 00469 self.object_list = cob_object_detection_msgs.msg.DetectionArray() 00470 end = 0 00471 _x = self 00472 start = end 00473 end += 12 00474 (_x.object_list.header.seq, _x.object_list.header.stamp.secs, _x.object_list.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00475 start = end 00476 end += 4 00477 (length,) = _struct_I.unpack(str[start:end]) 00478 start = end 00479 end += length 00480 self.object_list.header.frame_id = str[start:end] 00481 start = end 00482 end += 4 00483 (length,) = _struct_I.unpack(str[start:end]) 00484 self.object_list.detections = [] 00485 for i in range(0, length): 00486 val1 = cob_object_detection_msgs.msg.Detection() 00487 _v43 = val1.header 00488 start = end 00489 end += 4 00490 (_v43.seq,) = _struct_I.unpack(str[start:end]) 00491 _v44 = _v43.stamp 00492 _x = _v44 00493 start = end 00494 end += 8 00495 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00496 start = end 00497 end += 4 00498 (length,) = _struct_I.unpack(str[start:end]) 00499 start = end 00500 end += length 00501 _v43.frame_id = str[start:end] 00502 start = end 00503 end += 4 00504 (length,) = _struct_I.unpack(str[start:end]) 00505 start = end 00506 end += length 00507 val1.label = str[start:end] 00508 start = end 00509 end += 4 00510 (length,) = _struct_I.unpack(str[start:end]) 00511 start = end 00512 end += length 00513 val1.detector = str[start:end] 00514 start = end 00515 end += 4 00516 (val1.score,) = _struct_f.unpack(str[start:end]) 00517 _v45 = val1.mask 00518 _v46 = _v45.roi 00519 _x = _v46 00520 start = end 00521 end += 16 00522 (_x.x, _x.y, _x.width, _x.height,) = _struct_4i.unpack(str[start:end]) 00523 _v47 = _v45.mask 00524 _v48 = _v47.header 00525 start = end 00526 end += 4 00527 (_v48.seq,) = _struct_I.unpack(str[start:end]) 00528 _v49 = _v48.stamp 00529 _x = _v49 00530 start = end 00531 end += 8 00532 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00533 start = end 00534 end += 4 00535 (length,) = _struct_I.unpack(str[start:end]) 00536 start = end 00537 end += length 00538 _v48.frame_id = str[start:end] 00539 _x = _v47 00540 start = end 00541 end += 8 00542 (_x.height, _x.width,) = _struct_2I.unpack(str[start:end]) 00543 start = end 00544 end += 4 00545 (length,) = _struct_I.unpack(str[start:end]) 00546 start = end 00547 end += length 00548 _v47.encoding = str[start:end] 00549 _x = _v47 00550 start = end 00551 end += 5 00552 (_x.is_bigendian, _x.step,) = _struct_BI.unpack(str[start:end]) 00553 start = end 00554 end += 4 00555 (length,) = _struct_I.unpack(str[start:end]) 00556 start = end 00557 end += length 00558 _v47.data = str[start:end] 00559 _v50 = val1.pose 00560 _v51 = _v50.header 00561 start = end 00562 end += 4 00563 (_v51.seq,) = _struct_I.unpack(str[start:end]) 00564 _v52 = _v51.stamp 00565 _x = _v52 00566 start = end 00567 end += 8 00568 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00569 start = end 00570 end += 4 00571 (length,) = _struct_I.unpack(str[start:end]) 00572 start = end 00573 end += length 00574 _v51.frame_id = str[start:end] 00575 _v53 = _v50.pose 00576 _v54 = _v53.position 00577 _x = _v54 00578 start = end 00579 end += 24 00580 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00581 _v55 = _v53.orientation 00582 _x = _v55 00583 start = end 00584 end += 32 00585 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00586 _v56 = val1.bounding_box_lwh 00587 _x = _v56 00588 start = end 00589 end += 24 00590 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00591 self.object_list.detections.append(val1) 00592 return self 00593 except struct.error as e: 00594 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00595 00596 _struct_I = roslib.message.struct_I 00597 _struct_f = struct.Struct("<f") 00598 _struct_BI = struct.Struct("<BI") 00599 _struct_3I = struct.Struct("<3I") 00600 _struct_4i = struct.Struct("<4i") 00601 _struct_4d = struct.Struct("<4d") 00602 _struct_2I = struct.Struct("<2I") 00603 _struct_3d = struct.Struct("<3d")