_StartCustomString.py
Go to the documentation of this file.
00001 """autogenerated by genpy from openrave_msgs/StartCustomStringRequest.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 StartCustomStringRequest(genpy.Message):
00009   _md5sum = "39e92f1778057359c64c7b8a7d7b19de"
00010   _type = "openrave_msgs/StartCustomStringRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 string input
00014 
00015 """
00016   __slots__ = ['input']
00017   _slot_types = ['string']
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        input
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(StartCustomStringRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.input is None:
00037         self.input = ''
00038     else:
00039       self.input = ''
00040 
00041   def _get_types(self):
00042     """
00043     internal API method
00044     """
00045     return self._slot_types
00046 
00047   def serialize(self, buff):
00048     """
00049     serialize message into buffer
00050     :param buff: buffer, ``StringIO``
00051     """
00052     try:
00053       _x = self.input
00054       length = len(_x)
00055       if python3 or type(_x) == unicode:
00056         _x = _x.encode('utf-8')
00057         length = len(_x)
00058       buff.write(struct.pack('<I%ss'%length, length, _x))
00059     except struct.error as se: self._check_types(se)
00060     except TypeError as te: self._check_types(te)
00061 
00062   def deserialize(self, str):
00063     """
00064     unpack serialized message in str into this message instance
00065     :param str: byte array of serialized message, ``str``
00066     """
00067     try:
00068       end = 0
00069       start = end
00070       end += 4
00071       (length,) = _struct_I.unpack(str[start:end])
00072       start = end
00073       end += length
00074       if python3:
00075         self.input = str[start:end].decode('utf-8')
00076       else:
00077         self.input = 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.input
00091       length = len(_x)
00092       if python3 or type(_x) == unicode:
00093         _x = _x.encode('utf-8')
00094         length = len(_x)
00095       buff.write(struct.pack('<I%ss'%length, length, _x))
00096     except struct.error as se: self._check_types(se)
00097     except TypeError as te: self._check_types(te)
00098 
00099   def deserialize_numpy(self, str, numpy):
00100     """
00101     unpack serialized message in str into this message instance using numpy for array types
00102     :param str: byte array of serialized message, ``str``
00103     :param numpy: numpy python module
00104     """
00105     try:
00106       end = 0
00107       start = end
00108       end += 4
00109       (length,) = _struct_I.unpack(str[start:end])
00110       start = end
00111       end += length
00112       if python3:
00113         self.input = str[start:end].decode('utf-8')
00114       else:
00115         self.input = str[start:end]
00116       return self
00117     except struct.error as e:
00118       raise genpy.DeserializationError(e) #most likely buffer underfill
00119 
00120 _struct_I = genpy.struct_I
00121 """autogenerated by genpy from openrave_msgs/StartCustomStringResponse.msg. Do not edit."""
00122 import sys
00123 python3 = True if sys.hexversion > 0x03000000 else False
00124 import genpy
00125 import struct
00126 
00127 import genpy
00128 
00129 class StartCustomStringResponse(genpy.Message):
00130   _md5sum = "2426a6524e85b840974ac22cd5c0db02"
00131   _type = "openrave_msgs/StartCustomStringResponse"
00132   _has_header = False #flag to mark the presence of a Header object
00133   _full_text = """uint32 commandid
00134 time stamp
00135 string output
00136 
00137 
00138 """
00139   __slots__ = ['commandid','stamp','output']
00140   _slot_types = ['uint32','time','string']
00141 
00142   def __init__(self, *args, **kwds):
00143     """
00144     Constructor. Any message fields that are implicitly/explicitly
00145     set to None will be assigned a default value. The recommend
00146     use is keyword arguments as this is more robust to future message
00147     changes.  You cannot mix in-order arguments and keyword arguments.
00148 
00149     The available fields are:
00150        commandid,stamp,output
00151 
00152     :param args: complete set of field values, in .msg order
00153     :param kwds: use keyword arguments corresponding to message field names
00154     to set specific fields.
00155     """
00156     if args or kwds:
00157       super(StartCustomStringResponse, self).__init__(*args, **kwds)
00158       #message fields cannot be None, assign default values for those that are
00159       if self.commandid is None:
00160         self.commandid = 0
00161       if self.stamp is None:
00162         self.stamp = genpy.Time()
00163       if self.output is None:
00164         self.output = ''
00165     else:
00166       self.commandid = 0
00167       self.stamp = genpy.Time()
00168       self.output = ''
00169 
00170   def _get_types(self):
00171     """
00172     internal API method
00173     """
00174     return self._slot_types
00175 
00176   def serialize(self, buff):
00177     """
00178     serialize message into buffer
00179     :param buff: buffer, ``StringIO``
00180     """
00181     try:
00182       _x = self
00183       buff.write(_struct_3I.pack(_x.commandid, _x.stamp.secs, _x.stamp.nsecs))
00184       _x = self.output
00185       length = len(_x)
00186       if python3 or type(_x) == unicode:
00187         _x = _x.encode('utf-8')
00188         length = len(_x)
00189       buff.write(struct.pack('<I%ss'%length, length, _x))
00190     except struct.error as se: self._check_types(se)
00191     except TypeError as te: self._check_types(te)
00192 
00193   def deserialize(self, str):
00194     """
00195     unpack serialized message in str into this message instance
00196     :param str: byte array of serialized message, ``str``
00197     """
00198     try:
00199       if self.stamp is None:
00200         self.stamp = genpy.Time()
00201       end = 0
00202       _x = self
00203       start = end
00204       end += 12
00205       (_x.commandid, _x.stamp.secs, _x.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.output = str[start:end].decode('utf-8')
00213       else:
00214         self.output = str[start:end]
00215       self.stamp.canon()
00216       return self
00217     except struct.error as e:
00218       raise genpy.DeserializationError(e) #most likely buffer underfill
00219 
00220 
00221   def serialize_numpy(self, buff, numpy):
00222     """
00223     serialize message with numpy array types into buffer
00224     :param buff: buffer, ``StringIO``
00225     :param numpy: numpy python module
00226     """
00227     try:
00228       _x = self
00229       buff.write(_struct_3I.pack(_x.commandid, _x.stamp.secs, _x.stamp.nsecs))
00230       _x = self.output
00231       length = len(_x)
00232       if python3 or type(_x) == unicode:
00233         _x = _x.encode('utf-8')
00234         length = len(_x)
00235       buff.write(struct.pack('<I%ss'%length, length, _x))
00236     except struct.error as se: self._check_types(se)
00237     except TypeError as te: self._check_types(te)
00238 
00239   def deserialize_numpy(self, str, numpy):
00240     """
00241     unpack serialized message in str into this message instance using numpy for array types
00242     :param str: byte array of serialized message, ``str``
00243     :param numpy: numpy python module
00244     """
00245     try:
00246       if self.stamp is None:
00247         self.stamp = genpy.Time()
00248       end = 0
00249       _x = self
00250       start = end
00251       end += 12
00252       (_x.commandid, _x.stamp.secs, _x.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00253       start = end
00254       end += 4
00255       (length,) = _struct_I.unpack(str[start:end])
00256       start = end
00257       end += length
00258       if python3:
00259         self.output = str[start:end].decode('utf-8')
00260       else:
00261         self.output = str[start:end]
00262       self.stamp.canon()
00263       return self
00264     except struct.error as e:
00265       raise genpy.DeserializationError(e) #most likely buffer underfill
00266 
00267 _struct_I = genpy.struct_I
00268 _struct_3I = struct.Struct("<3I")
00269 class StartCustomString(object):
00270   _type          = 'openrave_msgs/StartCustomString'
00271   _md5sum = '9771c6125d127867a32768eadfab81a0'
00272   _request_class  = StartCustomStringRequest
00273   _response_class = StartCustomStringResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


openrave_msgs
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 14:07:55