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