_IRCharacter.py
Go to the documentation of this file.
00001 """autogenerated by genpy from roomba_500_series/IRCharacter.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 IRCharacter(genpy.Message):
00010   _md5sum = "fdef8c079e4550ab8502f7b78ba5302e"
00011   _type = "roomba_500_series/IRCharacter"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 uint8 omni
00015 uint8 left
00016 uint8 right
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','omni','left','right']
00038   _slot_types = ['std_msgs/Header','uint8','uint8','uint8']
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,omni,left,right
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(IRCharacter, 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.omni is None:
00060         self.omni = 0
00061       if self.left is None:
00062         self.left = 0
00063       if self.right is None:
00064         self.right = 0
00065     else:
00066       self.header = std_msgs.msg.Header()
00067       self.omni = 0
00068       self.left = 0
00069       self.right = 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
00092       buff.write(_struct_3B.pack(_x.omni, _x.left, _x.right))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize(self, str):
00097     """
00098     unpack serialized message in str into this message instance
00099     :param str: byte array of serialized message, ``str``
00100     """
00101     try:
00102       if self.header is None:
00103         self.header = std_msgs.msg.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       if python3:
00115         self.header.frame_id = str[start:end].decode('utf-8')
00116       else:
00117         self.header.frame_id = str[start:end]
00118       _x = self
00119       start = end
00120       end += 3
00121       (_x.omni, _x.left, _x.right,) = _struct_3B.unpack(str[start:end])
00122       return self
00123     except struct.error as e:
00124       raise genpy.DeserializationError(e) #most likely buffer underfill
00125 
00126 
00127   def serialize_numpy(self, buff, numpy):
00128     """
00129     serialize message with numpy array types into buffer
00130     :param buff: buffer, ``StringIO``
00131     :param numpy: numpy python module
00132     """
00133     try:
00134       _x = self
00135       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00136       _x = self.header.frame_id
00137       length = len(_x)
00138       if python3 or type(_x) == unicode:
00139         _x = _x.encode('utf-8')
00140         length = len(_x)
00141       buff.write(struct.pack('<I%ss'%length, length, _x))
00142       _x = self
00143       buff.write(_struct_3B.pack(_x.omni, _x.left, _x.right))
00144     except struct.error as se: self._check_types(se)
00145     except TypeError as te: self._check_types(te)
00146 
00147   def deserialize_numpy(self, str, numpy):
00148     """
00149     unpack serialized message in str into this message instance using numpy for array types
00150     :param str: byte array of serialized message, ``str``
00151     :param numpy: numpy python module
00152     """
00153     try:
00154       if self.header is None:
00155         self.header = std_msgs.msg.Header()
00156       end = 0
00157       _x = self
00158       start = end
00159       end += 12
00160       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00161       start = end
00162       end += 4
00163       (length,) = _struct_I.unpack(str[start:end])
00164       start = end
00165       end += length
00166       if python3:
00167         self.header.frame_id = str[start:end].decode('utf-8')
00168       else:
00169         self.header.frame_id = str[start:end]
00170       _x = self
00171       start = end
00172       end += 3
00173       (_x.omni, _x.left, _x.right,) = _struct_3B.unpack(str[start:end])
00174       return self
00175     except struct.error as e:
00176       raise genpy.DeserializationError(e) #most likely buffer underfill
00177 
00178 _struct_I = genpy.struct_I
00179 _struct_3B = struct.Struct("<3B")
00180 _struct_3I = struct.Struct("<3I")


roomba_500_series
Author(s): Gonçalo Cabrita
autogenerated on Mon Jan 6 2014 11:26:40