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


hrl_rfid
Author(s): Travis Deyle, Advisor: Prof. Charlie Kemp (Healthcare Robotics Lab at Georgia Tech) and Prof. Matt Reynolds (Duke University)
autogenerated on Wed Nov 27 2013 11:32:45