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


cob_object_detection_msgs
Author(s): Florian Weisshardt
autogenerated on Sat Mar 9 2013 11:24:33