_Turn.py
Go to the documentation of this file.
00001 """autogenerated by genpy from irobot_create_2_1/TurnRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class TurnRequest(genpy.Message):
00009   _md5sum = "d7233ced7da7131cf3836ae5864297ef"
00010   _type = "irobot_create_2_1/TurnRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """bool clear
00013 int16 turn
00014 
00015 """
00016   __slots__ = ['clear','turn']
00017   _slot_types = ['bool','int16']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        clear,turn
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(TurnRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.clear is None:
00037         self.clear = False
00038       if self.turn is None:
00039         self.turn = 0
00040     else:
00041       self.clear = False
00042       self.turn = 0
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       _x = self
00057       buff.write(_struct_Bh.pack(_x.clear, _x.turn))
00058     except struct.error as se: self._check_types(se)
00059     except TypeError as te: self._check_types(te)
00060 
00061   def deserialize(self, str):
00062     """
00063     unpack serialized message in str into this message instance
00064     :param str: byte array of serialized message, ``str``
00065     """
00066     try:
00067       end = 0
00068       _x = self
00069       start = end
00070       end += 3
00071       (_x.clear, _x.turn,) = _struct_Bh.unpack(str[start:end])
00072       self.clear = bool(self.clear)
00073       return self
00074     except struct.error as e:
00075       raise genpy.DeserializationError(e) #most likely buffer underfill
00076 
00077 
00078   def serialize_numpy(self, buff, numpy):
00079     """
00080     serialize message with numpy array types into buffer
00081     :param buff: buffer, ``StringIO``
00082     :param numpy: numpy python module
00083     """
00084     try:
00085       _x = self
00086       buff.write(_struct_Bh.pack(_x.clear, _x.turn))
00087     except struct.error as se: self._check_types(se)
00088     except TypeError as te: self._check_types(te)
00089 
00090   def deserialize_numpy(self, str, numpy):
00091     """
00092     unpack serialized message in str into this message instance using numpy for array types
00093     :param str: byte array of serialized message, ``str``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       end = 0
00098       _x = self
00099       start = end
00100       end += 3
00101       (_x.clear, _x.turn,) = _struct_Bh.unpack(str[start:end])
00102       self.clear = bool(self.clear)
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 _struct_I = genpy.struct_I
00108 _struct_Bh = struct.Struct("<Bh")
00109 """autogenerated by genpy from irobot_create_2_1/TurnResponse.msg. Do not edit."""
00110 import sys
00111 python3 = True if sys.hexversion > 0x03000000 else False
00112 import genpy
00113 import struct
00114 
00115 
00116 class TurnResponse(genpy.Message):
00117   _md5sum = "358e233cde0c8a8bcfea4ce193f8fc15"
00118   _type = "irobot_create_2_1/TurnResponse"
00119   _has_header = False #flag to mark the presence of a Header object
00120   _full_text = """bool success
00121 
00122 
00123 """
00124   __slots__ = ['success']
00125   _slot_types = ['bool']
00126 
00127   def __init__(self, *args, **kwds):
00128     """
00129     Constructor. Any message fields that are implicitly/explicitly
00130     set to None will be assigned a default value. The recommend
00131     use is keyword arguments as this is more robust to future message
00132     changes.  You cannot mix in-order arguments and keyword arguments.
00133 
00134     The available fields are:
00135        success
00136 
00137     :param args: complete set of field values, in .msg order
00138     :param kwds: use keyword arguments corresponding to message field names
00139     to set specific fields.
00140     """
00141     if args or kwds:
00142       super(TurnResponse, self).__init__(*args, **kwds)
00143       #message fields cannot be None, assign default values for those that are
00144       if self.success is None:
00145         self.success = False
00146     else:
00147       self.success = False
00148 
00149   def _get_types(self):
00150     """
00151     internal API method
00152     """
00153     return self._slot_types
00154 
00155   def serialize(self, buff):
00156     """
00157     serialize message into buffer
00158     :param buff: buffer, ``StringIO``
00159     """
00160     try:
00161       buff.write(_struct_B.pack(self.success))
00162     except struct.error as se: self._check_types(se)
00163     except TypeError as te: self._check_types(te)
00164 
00165   def deserialize(self, str):
00166     """
00167     unpack serialized message in str into this message instance
00168     :param str: byte array of serialized message, ``str``
00169     """
00170     try:
00171       end = 0
00172       start = end
00173       end += 1
00174       (self.success,) = _struct_B.unpack(str[start:end])
00175       self.success = bool(self.success)
00176       return self
00177     except struct.error as e:
00178       raise genpy.DeserializationError(e) #most likely buffer underfill
00179 
00180 
00181   def serialize_numpy(self, buff, numpy):
00182     """
00183     serialize message with numpy array types into buffer
00184     :param buff: buffer, ``StringIO``
00185     :param numpy: numpy python module
00186     """
00187     try:
00188       buff.write(_struct_B.pack(self.success))
00189     except struct.error as se: self._check_types(se)
00190     except TypeError as te: self._check_types(te)
00191 
00192   def deserialize_numpy(self, str, numpy):
00193     """
00194     unpack serialized message in str into this message instance using numpy for array types
00195     :param str: byte array of serialized message, ``str``
00196     :param numpy: numpy python module
00197     """
00198     try:
00199       end = 0
00200       start = end
00201       end += 1
00202       (self.success,) = _struct_B.unpack(str[start:end])
00203       self.success = bool(self.success)
00204       return self
00205     except struct.error as e:
00206       raise genpy.DeserializationError(e) #most likely buffer underfill
00207 
00208 _struct_I = genpy.struct_I
00209 _struct_B = struct.Struct("<B")
00210 class Turn(object):
00211   _type          = 'irobot_create_2_1/Turn'
00212   _md5sum = 'f28782ca6cac906741095df052f0ccc1'
00213   _request_class  = TurnRequest
00214   _response_class = TurnResponse


irobot_create_2_1
Author(s): Graylin Trevor Jay, Brian Thomas
autogenerated on Fri Jan 3 2014 11:10:15