00001 """autogenerated by genpy from hrl_rfid/RFIDreadArr.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 hrl_rfid.msg
00008 import std_msgs.msg
00009
00010 class RFIDreadArr(genpy.Message):
00011 _md5sum = "be8ea670b71691b0a1506962409d71b9"
00012 _type = "hrl_rfid/RFIDreadArr"
00013 _has_header = True
00014 _full_text = """Header header
00015 RFIDread[] arr
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: hrl_rfid/RFIDread
00037 Header header
00038 string antenna_name
00039 string tagID
00040 int32 rssi
00041
00042 """
00043 __slots__ = ['header','arr']
00044 _slot_types = ['std_msgs/Header','hrl_rfid/RFIDread[]']
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,arr
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(RFIDreadArr, self).__init__(*args, **kwds)
00062
00063 if self.header is None:
00064 self.header = std_msgs.msg.Header()
00065 if self.arr is None:
00066 self.arr = []
00067 else:
00068 self.header = std_msgs.msg.Header()
00069 self.arr = []
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.arr)
00092 buff.write(_struct_I.pack(length))
00093 for val1 in self.arr:
00094 _v1 = val1.header
00095 buff.write(_struct_I.pack(_v1.seq))
00096 _v2 = _v1.stamp
00097 _x = _v2
00098 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00099 _x = _v1.frame_id
00100 length = len(_x)
00101 if python3 or type(_x) == unicode:
00102 _x = _x.encode('utf-8')
00103 length = len(_x)
00104 buff.write(struct.pack('<I%ss'%length, length, _x))
00105 _x = val1.antenna_name
00106 length = len(_x)
00107 if python3 or type(_x) == unicode:
00108 _x = _x.encode('utf-8')
00109 length = len(_x)
00110 buff.write(struct.pack('<I%ss'%length, length, _x))
00111 _x = val1.tagID
00112 length = len(_x)
00113 if python3 or type(_x) == unicode:
00114 _x = _x.encode('utf-8')
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 buff.write(_struct_i.pack(val1.rssi))
00118 except struct.error as se: self._check_types(se)
00119 except TypeError as te: self._check_types(te)
00120
00121 def deserialize(self, str):
00122 """
00123 unpack serialized message in str into this message instance
00124 :param str: byte array of serialized message, ``str``
00125 """
00126 try:
00127 if self.header is None:
00128 self.header = std_msgs.msg.Header()
00129 if self.arr is None:
00130 self.arr = None
00131 end = 0
00132 _x = self
00133 start = end
00134 end += 12
00135 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 start = end
00140 end += length
00141 if python3:
00142 self.header.frame_id = str[start:end].decode('utf-8')
00143 else:
00144 self.header.frame_id = str[start:end]
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 self.arr = []
00149 for i in range(0, length):
00150 val1 = hrl_rfid.msg.RFIDread()
00151 _v3 = val1.header
00152 start = end
00153 end += 4
00154 (_v3.seq,) = _struct_I.unpack(str[start:end])
00155 _v4 = _v3.stamp
00156 _x = _v4
00157 start = end
00158 end += 8
00159 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 start = end
00164 end += length
00165 if python3:
00166 _v3.frame_id = str[start:end].decode('utf-8')
00167 else:
00168 _v3.frame_id = str[start:end]
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 if python3:
00175 val1.antenna_name = str[start:end].decode('utf-8')
00176 else:
00177 val1.antenna_name = 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 val1.tagID = str[start:end].decode('utf-8')
00185 else:
00186 val1.tagID = str[start:end]
00187 start = end
00188 end += 4
00189 (val1.rssi,) = _struct_i.unpack(str[start:end])
00190 self.arr.append(val1)
00191 return self
00192 except struct.error as e:
00193 raise genpy.DeserializationError(e)
00194
00195
00196 def serialize_numpy(self, buff, numpy):
00197 """
00198 serialize message with numpy array types into buffer
00199 :param buff: buffer, ``StringIO``
00200 :param numpy: numpy python module
00201 """
00202 try:
00203 _x = self
00204 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00205 _x = self.header.frame_id
00206 length = len(_x)
00207 if python3 or type(_x) == unicode:
00208 _x = _x.encode('utf-8')
00209 length = len(_x)
00210 buff.write(struct.pack('<I%ss'%length, length, _x))
00211 length = len(self.arr)
00212 buff.write(_struct_I.pack(length))
00213 for val1 in self.arr:
00214 _v5 = val1.header
00215 buff.write(_struct_I.pack(_v5.seq))
00216 _v6 = _v5.stamp
00217 _x = _v6
00218 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00219 _x = _v5.frame_id
00220 length = len(_x)
00221 if python3 or type(_x) == unicode:
00222 _x = _x.encode('utf-8')
00223 length = len(_x)
00224 buff.write(struct.pack('<I%ss'%length, length, _x))
00225 _x = val1.antenna_name
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 = val1.tagID
00232 length = len(_x)
00233 if python3 or type(_x) == unicode:
00234 _x = _x.encode('utf-8')
00235 length = len(_x)
00236 buff.write(struct.pack('<I%ss'%length, length, _x))
00237 buff.write(_struct_i.pack(val1.rssi))
00238 except struct.error as se: self._check_types(se)
00239 except TypeError as te: self._check_types(te)
00240
00241 def deserialize_numpy(self, str, numpy):
00242 """
00243 unpack serialized message in str into this message instance using numpy for array types
00244 :param str: byte array of serialized message, ``str``
00245 :param numpy: numpy python module
00246 """
00247 try:
00248 if self.header is None:
00249 self.header = std_msgs.msg.Header()
00250 if self.arr is None:
00251 self.arr = None
00252 end = 0
00253 _x = self
00254 start = end
00255 end += 12
00256 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 start = end
00261 end += length
00262 if python3:
00263 self.header.frame_id = str[start:end].decode('utf-8')
00264 else:
00265 self.header.frame_id = str[start:end]
00266 start = end
00267 end += 4
00268 (length,) = _struct_I.unpack(str[start:end])
00269 self.arr = []
00270 for i in range(0, length):
00271 val1 = hrl_rfid.msg.RFIDread()
00272 _v7 = val1.header
00273 start = end
00274 end += 4
00275 (_v7.seq,) = _struct_I.unpack(str[start:end])
00276 _v8 = _v7.stamp
00277 _x = _v8
00278 start = end
00279 end += 8
00280 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00281 start = end
00282 end += 4
00283 (length,) = _struct_I.unpack(str[start:end])
00284 start = end
00285 end += length
00286 if python3:
00287 _v7.frame_id = str[start:end].decode('utf-8')
00288 else:
00289 _v7.frame_id = str[start:end]
00290 start = end
00291 end += 4
00292 (length,) = _struct_I.unpack(str[start:end])
00293 start = end
00294 end += length
00295 if python3:
00296 val1.antenna_name = str[start:end].decode('utf-8')
00297 else:
00298 val1.antenna_name = 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 val1.tagID = str[start:end].decode('utf-8')
00306 else:
00307 val1.tagID = str[start:end]
00308 start = end
00309 end += 4
00310 (val1.rssi,) = _struct_i.unpack(str[start:end])
00311 self.arr.append(val1)
00312 return self
00313 except struct.error as e:
00314 raise genpy.DeserializationError(e)
00315
00316 _struct_I = genpy.struct_I
00317 _struct_i = struct.Struct("<i")
00318 _struct_3I = struct.Struct("<3I")
00319 _struct_2I = struct.Struct("<2I")