00001 """autogenerated by genpy from openraveros/env_getbodiesRequest.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 env_getbodiesRequest(genpy.Message):
00009 _md5sum = "9996321108452a956d6ad7dd8fe30cad"
00010 _type = "openraveros/env_getbodiesRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015 int32 bodyid
00016
00017
00018 uint16 options
00019
00020 """
00021 __slots__ = ['bodyid','options']
00022 _slot_types = ['int32','uint16']
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 bodyid,options
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(env_getbodiesRequest, self).__init__(*args, **kwds)
00040
00041 if self.bodyid is None:
00042 self.bodyid = 0
00043 if self.options is None:
00044 self.options = 0
00045 else:
00046 self.bodyid = 0
00047 self.options = 0
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 _x = self
00062 buff.write(_struct_iH.pack(_x.bodyid, _x.options))
00063 except struct.error as se: self._check_types(se)
00064 except TypeError as te: self._check_types(te)
00065
00066 def deserialize(self, str):
00067 """
00068 unpack serialized message in str into this message instance
00069 :param str: byte array of serialized message, ``str``
00070 """
00071 try:
00072 end = 0
00073 _x = self
00074 start = end
00075 end += 6
00076 (_x.bodyid, _x.options,) = _struct_iH.unpack(str[start:end])
00077 return self
00078 except struct.error as e:
00079 raise genpy.DeserializationError(e)
00080
00081
00082 def serialize_numpy(self, buff, numpy):
00083 """
00084 serialize message with numpy array types into buffer
00085 :param buff: buffer, ``StringIO``
00086 :param numpy: numpy python module
00087 """
00088 try:
00089 _x = self
00090 buff.write(_struct_iH.pack(_x.bodyid, _x.options))
00091 except struct.error as se: self._check_types(se)
00092 except TypeError as te: self._check_types(te)
00093
00094 def deserialize_numpy(self, str, numpy):
00095 """
00096 unpack serialized message in str into this message instance using numpy for array types
00097 :param str: byte array of serialized message, ``str``
00098 :param numpy: numpy python module
00099 """
00100 try:
00101 end = 0
00102 _x = self
00103 start = end
00104 end += 6
00105 (_x.bodyid, _x.options,) = _struct_iH.unpack(str[start:end])
00106 return self
00107 except struct.error as e:
00108 raise genpy.DeserializationError(e)
00109
00110 _struct_I = genpy.struct_I
00111 _struct_iH = struct.Struct("<iH")
00112 """autogenerated by genpy from openraveros/env_getbodiesResponse.msg. Do not edit."""
00113 import sys
00114 python3 = True if sys.hexversion > 0x03000000 else False
00115 import genpy
00116 import struct
00117
00118 import openraveros.msg
00119
00120 class env_getbodiesResponse(genpy.Message):
00121 _md5sum = "f70d26169f977465766c815382f0ddc3"
00122 _type = "openraveros/env_getbodiesResponse"
00123 _has_header = False
00124 _full_text = """BodyInfo[] bodies
00125
00126
00127 ================================================================================
00128 MSG: openraveros/BodyInfo
00129 # information about a body
00130 int32 bodyid
00131
00132 # current transformation
00133 AffineTransformMatrix transform
00134
00135 # degrees of freedom (number of joints)
00136 uint8 dof
00137
00138 # enabled status
00139 uint8 enabled
00140
00141
00142 # filename used to create body geometry
00143 string filename
00144
00145 # name of the body
00146 string name
00147
00148 # type of body
00149 string type
00150
00151 float32[] jointvalues
00152 AffineTransformMatrix[] links
00153 string[] linknames
00154 string[] jointnames
00155
00156 # joint limits
00157 float32[] lowerlimit
00158 float32[] upperlimit
00159
00160 # request information bitmasks, also holds robot specific request information (lower 8 bits)
00161 uint16 Req_JointValues=1
00162 uint16 Req_Links=2
00163 uint16 Req_LinkNames=4 # fills the linknames
00164 uint16 Req_JointLimits=8
00165 uint16 Req_Names=16 # if set, fills filename, name, and type
00166 uint16 Req_JointNames=32 # fills the jointnames
00167 ================================================================================
00168 MSG: openraveros/AffineTransformMatrix
00169 # column ordered 3x4 affine transformation, ie: the arrangement in memory is:
00170 # where the upper 3x3 matrix is orthonormal
00171 # [0] [3] [6] [9]
00172 # [1] [4] [7] [10]
00173 # [2] [5] [8] [11]
00174 float32[12] m
00175
00176 """
00177 __slots__ = ['bodies']
00178 _slot_types = ['openraveros/BodyInfo[]']
00179
00180 def __init__(self, *args, **kwds):
00181 """
00182 Constructor. Any message fields that are implicitly/explicitly
00183 set to None will be assigned a default value. The recommend
00184 use is keyword arguments as this is more robust to future message
00185 changes. You cannot mix in-order arguments and keyword arguments.
00186
00187 The available fields are:
00188 bodies
00189
00190 :param args: complete set of field values, in .msg order
00191 :param kwds: use keyword arguments corresponding to message field names
00192 to set specific fields.
00193 """
00194 if args or kwds:
00195 super(env_getbodiesResponse, self).__init__(*args, **kwds)
00196
00197 if self.bodies is None:
00198 self.bodies = []
00199 else:
00200 self.bodies = []
00201
00202 def _get_types(self):
00203 """
00204 internal API method
00205 """
00206 return self._slot_types
00207
00208 def serialize(self, buff):
00209 """
00210 serialize message into buffer
00211 :param buff: buffer, ``StringIO``
00212 """
00213 try:
00214 length = len(self.bodies)
00215 buff.write(_struct_I.pack(length))
00216 for val1 in self.bodies:
00217 buff.write(_struct_i.pack(val1.bodyid))
00218 _v1 = val1.transform
00219 buff.write(_struct_12f.pack(*_v1.m))
00220 _x = val1
00221 buff.write(_struct_2B.pack(_x.dof, _x.enabled))
00222 _x = val1.filename
00223 length = len(_x)
00224 if python3 or type(_x) == unicode:
00225 _x = _x.encode('utf-8')
00226 length = len(_x)
00227 buff.write(struct.pack('<I%ss'%length, length, _x))
00228 _x = val1.name
00229 length = len(_x)
00230 if python3 or type(_x) == unicode:
00231 _x = _x.encode('utf-8')
00232 length = len(_x)
00233 buff.write(struct.pack('<I%ss'%length, length, _x))
00234 _x = val1.type
00235 length = len(_x)
00236 if python3 or type(_x) == unicode:
00237 _x = _x.encode('utf-8')
00238 length = len(_x)
00239 buff.write(struct.pack('<I%ss'%length, length, _x))
00240 length = len(val1.jointvalues)
00241 buff.write(_struct_I.pack(length))
00242 pattern = '<%sf'%length
00243 buff.write(struct.pack(pattern, *val1.jointvalues))
00244 length = len(val1.links)
00245 buff.write(_struct_I.pack(length))
00246 for val2 in val1.links:
00247 buff.write(_struct_12f.pack(*val2.m))
00248 length = len(val1.linknames)
00249 buff.write(_struct_I.pack(length))
00250 for val2 in val1.linknames:
00251 length = len(val2)
00252 if python3 or type(val2) == unicode:
00253 val2 = val2.encode('utf-8')
00254 length = len(val2)
00255 buff.write(struct.pack('<I%ss'%length, length, val2))
00256 length = len(val1.jointnames)
00257 buff.write(_struct_I.pack(length))
00258 for val2 in val1.jointnames:
00259 length = len(val2)
00260 if python3 or type(val2) == unicode:
00261 val2 = val2.encode('utf-8')
00262 length = len(val2)
00263 buff.write(struct.pack('<I%ss'%length, length, val2))
00264 length = len(val1.lowerlimit)
00265 buff.write(_struct_I.pack(length))
00266 pattern = '<%sf'%length
00267 buff.write(struct.pack(pattern, *val1.lowerlimit))
00268 length = len(val1.upperlimit)
00269 buff.write(_struct_I.pack(length))
00270 pattern = '<%sf'%length
00271 buff.write(struct.pack(pattern, *val1.upperlimit))
00272 except struct.error as se: self._check_types(se)
00273 except TypeError as te: self._check_types(te)
00274
00275 def deserialize(self, str):
00276 """
00277 unpack serialized message in str into this message instance
00278 :param str: byte array of serialized message, ``str``
00279 """
00280 try:
00281 if self.bodies is None:
00282 self.bodies = None
00283 end = 0
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 self.bodies = []
00288 for i in range(0, length):
00289 val1 = openraveros.msg.BodyInfo()
00290 start = end
00291 end += 4
00292 (val1.bodyid,) = _struct_i.unpack(str[start:end])
00293 _v2 = val1.transform
00294 start = end
00295 end += 48
00296 _v2.m = _struct_12f.unpack(str[start:end])
00297 _x = val1
00298 start = end
00299 end += 2
00300 (_x.dof, _x.enabled,) = _struct_2B.unpack(str[start:end])
00301 start = end
00302 end += 4
00303 (length,) = _struct_I.unpack(str[start:end])
00304 start = end
00305 end += length
00306 if python3:
00307 val1.filename = str[start:end].decode('utf-8')
00308 else:
00309 val1.filename = str[start:end]
00310 start = end
00311 end += 4
00312 (length,) = _struct_I.unpack(str[start:end])
00313 start = end
00314 end += length
00315 if python3:
00316 val1.name = str[start:end].decode('utf-8')
00317 else:
00318 val1.name = str[start:end]
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 start = end
00323 end += length
00324 if python3:
00325 val1.type = str[start:end].decode('utf-8')
00326 else:
00327 val1.type = str[start:end]
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 pattern = '<%sf'%length
00332 start = end
00333 end += struct.calcsize(pattern)
00334 val1.jointvalues = struct.unpack(pattern, str[start:end])
00335 start = end
00336 end += 4
00337 (length,) = _struct_I.unpack(str[start:end])
00338 val1.links = []
00339 for i in range(0, length):
00340 val2 = openraveros.msg.AffineTransformMatrix()
00341 start = end
00342 end += 48
00343 val2.m = _struct_12f.unpack(str[start:end])
00344 val1.links.append(val2)
00345 start = end
00346 end += 4
00347 (length,) = _struct_I.unpack(str[start:end])
00348 val1.linknames = []
00349 for i in range(0, length):
00350 start = end
00351 end += 4
00352 (length,) = _struct_I.unpack(str[start:end])
00353 start = end
00354 end += length
00355 if python3:
00356 val2 = str[start:end].decode('utf-8')
00357 else:
00358 val2 = str[start:end]
00359 val1.linknames.append(val2)
00360 start = end
00361 end += 4
00362 (length,) = _struct_I.unpack(str[start:end])
00363 val1.jointnames = []
00364 for i in range(0, length):
00365 start = end
00366 end += 4
00367 (length,) = _struct_I.unpack(str[start:end])
00368 start = end
00369 end += length
00370 if python3:
00371 val2 = str[start:end].decode('utf-8')
00372 else:
00373 val2 = str[start:end]
00374 val1.jointnames.append(val2)
00375 start = end
00376 end += 4
00377 (length,) = _struct_I.unpack(str[start:end])
00378 pattern = '<%sf'%length
00379 start = end
00380 end += struct.calcsize(pattern)
00381 val1.lowerlimit = struct.unpack(pattern, str[start:end])
00382 start = end
00383 end += 4
00384 (length,) = _struct_I.unpack(str[start:end])
00385 pattern = '<%sf'%length
00386 start = end
00387 end += struct.calcsize(pattern)
00388 val1.upperlimit = struct.unpack(pattern, str[start:end])
00389 self.bodies.append(val1)
00390 return self
00391 except struct.error as e:
00392 raise genpy.DeserializationError(e)
00393
00394
00395 def serialize_numpy(self, buff, numpy):
00396 """
00397 serialize message with numpy array types into buffer
00398 :param buff: buffer, ``StringIO``
00399 :param numpy: numpy python module
00400 """
00401 try:
00402 length = len(self.bodies)
00403 buff.write(_struct_I.pack(length))
00404 for val1 in self.bodies:
00405 buff.write(_struct_i.pack(val1.bodyid))
00406 _v3 = val1.transform
00407 buff.write(_v3.m.tostring())
00408 _x = val1
00409 buff.write(_struct_2B.pack(_x.dof, _x.enabled))
00410 _x = val1.filename
00411 length = len(_x)
00412 if python3 or type(_x) == unicode:
00413 _x = _x.encode('utf-8')
00414 length = len(_x)
00415 buff.write(struct.pack('<I%ss'%length, length, _x))
00416 _x = val1.name
00417 length = len(_x)
00418 if python3 or type(_x) == unicode:
00419 _x = _x.encode('utf-8')
00420 length = len(_x)
00421 buff.write(struct.pack('<I%ss'%length, length, _x))
00422 _x = val1.type
00423 length = len(_x)
00424 if python3 or type(_x) == unicode:
00425 _x = _x.encode('utf-8')
00426 length = len(_x)
00427 buff.write(struct.pack('<I%ss'%length, length, _x))
00428 length = len(val1.jointvalues)
00429 buff.write(_struct_I.pack(length))
00430 pattern = '<%sf'%length
00431 buff.write(val1.jointvalues.tostring())
00432 length = len(val1.links)
00433 buff.write(_struct_I.pack(length))
00434 for val2 in val1.links:
00435 buff.write(val2.m.tostring())
00436 length = len(val1.linknames)
00437 buff.write(_struct_I.pack(length))
00438 for val2 in val1.linknames:
00439 length = len(val2)
00440 if python3 or type(val2) == unicode:
00441 val2 = val2.encode('utf-8')
00442 length = len(val2)
00443 buff.write(struct.pack('<I%ss'%length, length, val2))
00444 length = len(val1.jointnames)
00445 buff.write(_struct_I.pack(length))
00446 for val2 in val1.jointnames:
00447 length = len(val2)
00448 if python3 or type(val2) == unicode:
00449 val2 = val2.encode('utf-8')
00450 length = len(val2)
00451 buff.write(struct.pack('<I%ss'%length, length, val2))
00452 length = len(val1.lowerlimit)
00453 buff.write(_struct_I.pack(length))
00454 pattern = '<%sf'%length
00455 buff.write(val1.lowerlimit.tostring())
00456 length = len(val1.upperlimit)
00457 buff.write(_struct_I.pack(length))
00458 pattern = '<%sf'%length
00459 buff.write(val1.upperlimit.tostring())
00460 except struct.error as se: self._check_types(se)
00461 except TypeError as te: self._check_types(te)
00462
00463 def deserialize_numpy(self, str, numpy):
00464 """
00465 unpack serialized message in str into this message instance using numpy for array types
00466 :param str: byte array of serialized message, ``str``
00467 :param numpy: numpy python module
00468 """
00469 try:
00470 if self.bodies is None:
00471 self.bodies = None
00472 end = 0
00473 start = end
00474 end += 4
00475 (length,) = _struct_I.unpack(str[start:end])
00476 self.bodies = []
00477 for i in range(0, length):
00478 val1 = openraveros.msg.BodyInfo()
00479 start = end
00480 end += 4
00481 (val1.bodyid,) = _struct_i.unpack(str[start:end])
00482 _v4 = val1.transform
00483 start = end
00484 end += 48
00485 _v4.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00486 _x = val1
00487 start = end
00488 end += 2
00489 (_x.dof, _x.enabled,) = _struct_2B.unpack(str[start:end])
00490 start = end
00491 end += 4
00492 (length,) = _struct_I.unpack(str[start:end])
00493 start = end
00494 end += length
00495 if python3:
00496 val1.filename = str[start:end].decode('utf-8')
00497 else:
00498 val1.filename = str[start:end]
00499 start = end
00500 end += 4
00501 (length,) = _struct_I.unpack(str[start:end])
00502 start = end
00503 end += length
00504 if python3:
00505 val1.name = str[start:end].decode('utf-8')
00506 else:
00507 val1.name = str[start:end]
00508 start = end
00509 end += 4
00510 (length,) = _struct_I.unpack(str[start:end])
00511 start = end
00512 end += length
00513 if python3:
00514 val1.type = str[start:end].decode('utf-8')
00515 else:
00516 val1.type = str[start:end]
00517 start = end
00518 end += 4
00519 (length,) = _struct_I.unpack(str[start:end])
00520 pattern = '<%sf'%length
00521 start = end
00522 end += struct.calcsize(pattern)
00523 val1.jointvalues = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00524 start = end
00525 end += 4
00526 (length,) = _struct_I.unpack(str[start:end])
00527 val1.links = []
00528 for i in range(0, length):
00529 val2 = openraveros.msg.AffineTransformMatrix()
00530 start = end
00531 end += 48
00532 val2.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00533 val1.links.append(val2)
00534 start = end
00535 end += 4
00536 (length,) = _struct_I.unpack(str[start:end])
00537 val1.linknames = []
00538 for i in range(0, length):
00539 start = end
00540 end += 4
00541 (length,) = _struct_I.unpack(str[start:end])
00542 start = end
00543 end += length
00544 if python3:
00545 val2 = str[start:end].decode('utf-8')
00546 else:
00547 val2 = str[start:end]
00548 val1.linknames.append(val2)
00549 start = end
00550 end += 4
00551 (length,) = _struct_I.unpack(str[start:end])
00552 val1.jointnames = []
00553 for i in range(0, length):
00554 start = end
00555 end += 4
00556 (length,) = _struct_I.unpack(str[start:end])
00557 start = end
00558 end += length
00559 if python3:
00560 val2 = str[start:end].decode('utf-8')
00561 else:
00562 val2 = str[start:end]
00563 val1.jointnames.append(val2)
00564 start = end
00565 end += 4
00566 (length,) = _struct_I.unpack(str[start:end])
00567 pattern = '<%sf'%length
00568 start = end
00569 end += struct.calcsize(pattern)
00570 val1.lowerlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00571 start = end
00572 end += 4
00573 (length,) = _struct_I.unpack(str[start:end])
00574 pattern = '<%sf'%length
00575 start = end
00576 end += struct.calcsize(pattern)
00577 val1.upperlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00578 self.bodies.append(val1)
00579 return self
00580 except struct.error as e:
00581 raise genpy.DeserializationError(e)
00582
00583 _struct_I = genpy.struct_I
00584 _struct_i = struct.Struct("<i")
00585 _struct_2B = struct.Struct("<2B")
00586 _struct_12f = struct.Struct("<12f")
00587 class env_getbodies(object):
00588 _type = 'openraveros/env_getbodies'
00589 _md5sum = 'caddd98e3a44d0d059c9941276339e55'
00590 _request_class = env_getbodiesRequest
00591 _response_class = env_getbodiesResponse