_SetMaxVel.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_srvs/SetMaxVelRequest.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 SetMaxVelRequest(genpy.Message):
00009   _md5sum = "dd4c36ffe76b55c7212cbc93d9e269be"
00010   _type = "cob_srvs/SetMaxVelRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float32 max_vel
00013 
00014 """
00015   __slots__ = ['max_vel']
00016   _slot_types = ['float32']
00017 
00018   def __init__(self, *args, **kwds):
00019     """
00020     Constructor. Any message fields that are implicitly/explicitly
00021     set to None will be assigned a default value. The recommend
00022     use is keyword arguments as this is more robust to future message
00023     changes.  You cannot mix in-order arguments and keyword arguments.
00024 
00025     The available fields are:
00026        max_vel
00027 
00028     :param args: complete set of field values, in .msg order
00029     :param kwds: use keyword arguments corresponding to message field names
00030     to set specific fields.
00031     """
00032     if args or kwds:
00033       super(SetMaxVelRequest, self).__init__(*args, **kwds)
00034       #message fields cannot be None, assign default values for those that are
00035       if self.max_vel is None:
00036         self.max_vel = 0.
00037     else:
00038       self.max_vel = 0.
00039 
00040   def _get_types(self):
00041     """
00042     internal API method
00043     """
00044     return self._slot_types
00045 
00046   def serialize(self, buff):
00047     """
00048     serialize message into buffer
00049     :param buff: buffer, ``StringIO``
00050     """
00051     try:
00052       buff.write(_struct_f.pack(self.max_vel))
00053     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00054     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00055 
00056   def deserialize(self, str):
00057     """
00058     unpack serialized message in str into this message instance
00059     :param str: byte array of serialized message, ``str``
00060     """
00061     try:
00062       end = 0
00063       start = end
00064       end += 4
00065       (self.max_vel,) = _struct_f.unpack(str[start:end])
00066       return self
00067     except struct.error as e:
00068       raise genpy.DeserializationError(e) #most likely buffer underfill
00069 
00070 
00071   def serialize_numpy(self, buff, numpy):
00072     """
00073     serialize message with numpy array types into buffer
00074     :param buff: buffer, ``StringIO``
00075     :param numpy: numpy python module
00076     """
00077     try:
00078       buff.write(_struct_f.pack(self.max_vel))
00079     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00080     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00081 
00082   def deserialize_numpy(self, str, numpy):
00083     """
00084     unpack serialized message in str into this message instance using numpy for array types
00085     :param str: byte array of serialized message, ``str``
00086     :param numpy: numpy python module
00087     """
00088     try:
00089       end = 0
00090       start = end
00091       end += 4
00092       (self.max_vel,) = _struct_f.unpack(str[start:end])
00093       return self
00094     except struct.error as e:
00095       raise genpy.DeserializationError(e) #most likely buffer underfill
00096 
00097 _struct_I = genpy.struct_I
00098 _struct_f = struct.Struct("<f")
00099 """autogenerated by genpy from cob_srvs/SetMaxVelResponse.msg. Do not edit."""
00100 import sys
00101 python3 = True if sys.hexversion > 0x03000000 else False
00102 import genpy
00103 import struct
00104 
00105 import std_msgs.msg
00106 
00107 class SetMaxVelResponse(genpy.Message):
00108   _md5sum = "c3b62f691308002270bd6702fd7da94b"
00109   _type = "cob_srvs/SetMaxVelResponse"
00110   _has_header = False #flag to mark the presence of a Header object
00111   _full_text = """bool success
00112 std_msgs/String errorMessage
00113 
00114 
00115 ================================================================================
00116 MSG: std_msgs/String
00117 string data
00118 
00119 """
00120   __slots__ = ['success','errorMessage']
00121   _slot_types = ['bool','std_msgs/String']
00122 
00123   def __init__(self, *args, **kwds):
00124     """
00125     Constructor. Any message fields that are implicitly/explicitly
00126     set to None will be assigned a default value. The recommend
00127     use is keyword arguments as this is more robust to future message
00128     changes.  You cannot mix in-order arguments and keyword arguments.
00129 
00130     The available fields are:
00131        success,errorMessage
00132 
00133     :param args: complete set of field values, in .msg order
00134     :param kwds: use keyword arguments corresponding to message field names
00135     to set specific fields.
00136     """
00137     if args or kwds:
00138       super(SetMaxVelResponse, self).__init__(*args, **kwds)
00139       #message fields cannot be None, assign default values for those that are
00140       if self.success is None:
00141         self.success = False
00142       if self.errorMessage is None:
00143         self.errorMessage = std_msgs.msg.String()
00144     else:
00145       self.success = False
00146       self.errorMessage = std_msgs.msg.String()
00147 
00148   def _get_types(self):
00149     """
00150     internal API method
00151     """
00152     return self._slot_types
00153 
00154   def serialize(self, buff):
00155     """
00156     serialize message into buffer
00157     :param buff: buffer, ``StringIO``
00158     """
00159     try:
00160       buff.write(_struct_B.pack(self.success))
00161       _x = self.errorMessage.data
00162       length = len(_x)
00163       if python3 or type(_x) == unicode:
00164         _x = _x.encode('utf-8')
00165         length = len(_x)
00166       buff.write(struct.pack('<I%ss'%length, length, _x))
00167     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00168     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00169 
00170   def deserialize(self, str):
00171     """
00172     unpack serialized message in str into this message instance
00173     :param str: byte array of serialized message, ``str``
00174     """
00175     try:
00176       if self.errorMessage is None:
00177         self.errorMessage = std_msgs.msg.String()
00178       end = 0
00179       start = end
00180       end += 1
00181       (self.success,) = _struct_B.unpack(str[start:end])
00182       self.success = bool(self.success)
00183       start = end
00184       end += 4
00185       (length,) = _struct_I.unpack(str[start:end])
00186       start = end
00187       end += length
00188       if python3:
00189         self.errorMessage.data = str[start:end].decode('utf-8')
00190       else:
00191         self.errorMessage.data = str[start:end]
00192       return self
00193     except struct.error as e:
00194       raise genpy.DeserializationError(e) #most likely buffer underfill
00195 
00196 
00197   def serialize_numpy(self, buff, numpy):
00198     """
00199     serialize message with numpy array types into buffer
00200     :param buff: buffer, ``StringIO``
00201     :param numpy: numpy python module
00202     """
00203     try:
00204       buff.write(_struct_B.pack(self.success))
00205       _x = self.errorMessage.data
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     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00212     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00213 
00214   def deserialize_numpy(self, str, numpy):
00215     """
00216     unpack serialized message in str into this message instance using numpy for array types
00217     :param str: byte array of serialized message, ``str``
00218     :param numpy: numpy python module
00219     """
00220     try:
00221       if self.errorMessage is None:
00222         self.errorMessage = std_msgs.msg.String()
00223       end = 0
00224       start = end
00225       end += 1
00226       (self.success,) = _struct_B.unpack(str[start:end])
00227       self.success = bool(self.success)
00228       start = end
00229       end += 4
00230       (length,) = _struct_I.unpack(str[start:end])
00231       start = end
00232       end += length
00233       if python3:
00234         self.errorMessage.data = str[start:end].decode('utf-8')
00235       else:
00236         self.errorMessage.data = str[start:end]
00237       return self
00238     except struct.error as e:
00239       raise genpy.DeserializationError(e) #most likely buffer underfill
00240 
00241 _struct_I = genpy.struct_I
00242 _struct_B = struct.Struct("<B")
00243 class SetMaxVel(object):
00244   _type          = 'cob_srvs/SetMaxVel'
00245   _md5sum = '5212ea5f4e683819f4e395ad0eb8ae8c'
00246   _request_class  = SetMaxVelRequest
00247   _response_class = SetMaxVelResponse


cob_srvs
Author(s): Florian Weisshardt
autogenerated on Sun Oct 5 2014 22:58:03