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