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


openraveros
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 22:15:39