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


corobot_ssc32
Author(s):
autogenerated on Wed Aug 26 2015 11:09:37