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


pr2_mechanism_msgs
Author(s): Stuart Glaser sglaser@willowgarage.com, Wim Meeussen
autogenerated on Mon Nov 19 2012 16:39:56