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