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