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