_RectArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from face_detector_mono/RectArray.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 face_detector_mono.msg
00008 import std_msgs.msg
00009 
00010 class RectArray(genpy.Message):
00011   _md5sum = "e83b38fbaea3a641fa77f009f9bf492e"
00012   _type = "face_detector_mono/RectArray"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 Rect[] rects
00016 
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data 
00021 # in a particular coordinate frame.
00022 # 
00023 # sequence ID: consecutively increasing ID 
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034 
00035 ================================================================================
00036 MSG: face_detector_mono/Rect
00037 int32 x
00038 int32 y
00039 int32 width
00040 int32 height
00041 
00042 """
00043   __slots__ = ['header','rects']
00044   _slot_types = ['std_msgs/Header','face_detector_mono/Rect[]']
00045 
00046   def __init__(self, *args, **kwds):
00047     """
00048     Constructor. Any message fields that are implicitly/explicitly
00049     set to None will be assigned a default value. The recommend
00050     use is keyword arguments as this is more robust to future message
00051     changes.  You cannot mix in-order arguments and keyword arguments.
00052 
00053     The available fields are:
00054        header,rects
00055 
00056     :param args: complete set of field values, in .msg order
00057     :param kwds: use keyword arguments corresponding to message field names
00058     to set specific fields.
00059     """
00060     if args or kwds:
00061       super(RectArray, self).__init__(*args, **kwds)
00062       #message fields cannot be None, assign default values for those that are
00063       if self.header is None:
00064         self.header = std_msgs.msg.Header()
00065       if self.rects is None:
00066         self.rects = []
00067     else:
00068       self.header = std_msgs.msg.Header()
00069       self.rects = []
00070 
00071   def _get_types(self):
00072     """
00073     internal API method
00074     """
00075     return self._slot_types
00076 
00077   def serialize(self, buff):
00078     """
00079     serialize message into buffer
00080     :param buff: buffer, ``StringIO``
00081     """
00082     try:
00083       _x = self
00084       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00085       _x = self.header.frame_id
00086       length = len(_x)
00087       if python3 or type(_x) == unicode:
00088         _x = _x.encode('utf-8')
00089         length = len(_x)
00090       buff.write(struct.pack('<I%ss'%length, length, _x))
00091       length = len(self.rects)
00092       buff.write(_struct_I.pack(length))
00093       for val1 in self.rects:
00094         _x = val1
00095         buff.write(_struct_4i.pack(_x.x, _x.y, _x.width, _x.height))
00096     except struct.error as se: self._check_types(se)
00097     except TypeError as te: self._check_types(te)
00098 
00099   def deserialize(self, str):
00100     """
00101     unpack serialized message in str into this message instance
00102     :param str: byte array of serialized message, ``str``
00103     """
00104     try:
00105       if self.header is None:
00106         self.header = std_msgs.msg.Header()
00107       if self.rects is None:
00108         self.rects = None
00109       end = 0
00110       _x = self
00111       start = end
00112       end += 12
00113       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00114       start = end
00115       end += 4
00116       (length,) = _struct_I.unpack(str[start:end])
00117       start = end
00118       end += length
00119       if python3:
00120         self.header.frame_id = str[start:end].decode('utf-8')
00121       else:
00122         self.header.frame_id = str[start:end]
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       self.rects = []
00127       for i in range(0, length):
00128         val1 = face_detector_mono.msg.Rect()
00129         _x = val1
00130         start = end
00131         end += 16
00132         (_x.x, _x.y, _x.width, _x.height,) = _struct_4i.unpack(str[start:end])
00133         self.rects.append(val1)
00134       return self
00135     except struct.error as e:
00136       raise genpy.DeserializationError(e) #most likely buffer underfill
00137 
00138 
00139   def serialize_numpy(self, buff, numpy):
00140     """
00141     serialize message with numpy array types into buffer
00142     :param buff: buffer, ``StringIO``
00143     :param numpy: numpy python module
00144     """
00145     try:
00146       _x = self
00147       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00148       _x = self.header.frame_id
00149       length = len(_x)
00150       if python3 or type(_x) == unicode:
00151         _x = _x.encode('utf-8')
00152         length = len(_x)
00153       buff.write(struct.pack('<I%ss'%length, length, _x))
00154       length = len(self.rects)
00155       buff.write(_struct_I.pack(length))
00156       for val1 in self.rects:
00157         _x = val1
00158         buff.write(_struct_4i.pack(_x.x, _x.y, _x.width, _x.height))
00159     except struct.error as se: self._check_types(se)
00160     except TypeError as te: self._check_types(te)
00161 
00162   def deserialize_numpy(self, str, numpy):
00163     """
00164     unpack serialized message in str into this message instance using numpy for array types
00165     :param str: byte array of serialized message, ``str``
00166     :param numpy: numpy python module
00167     """
00168     try:
00169       if self.header is None:
00170         self.header = std_msgs.msg.Header()
00171       if self.rects is None:
00172         self.rects = None
00173       end = 0
00174       _x = self
00175       start = end
00176       end += 12
00177       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00178       start = end
00179       end += 4
00180       (length,) = _struct_I.unpack(str[start:end])
00181       start = end
00182       end += length
00183       if python3:
00184         self.header.frame_id = str[start:end].decode('utf-8')
00185       else:
00186         self.header.frame_id = str[start:end]
00187       start = end
00188       end += 4
00189       (length,) = _struct_I.unpack(str[start:end])
00190       self.rects = []
00191       for i in range(0, length):
00192         val1 = face_detector_mono.msg.Rect()
00193         _x = val1
00194         start = end
00195         end += 16
00196         (_x.x, _x.y, _x.width, _x.height,) = _struct_4i.unpack(str[start:end])
00197         self.rects.append(val1)
00198       return self
00199     except struct.error as e:
00200       raise genpy.DeserializationError(e) #most likely buffer underfill
00201 
00202 _struct_I = genpy.struct_I
00203 _struct_3I = struct.Struct("<3I")
00204 _struct_4i = struct.Struct("<4i")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


face_detector_mono
Author(s): Dejan Pangercic
autogenerated on Thu May 23 2013 15:01:52