00001 """autogenerated by genpy from openraveros/RobotInfo.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import openraveros.msg
00008
00009 class RobotInfo(genpy.Message):
00010 _md5sum = "fd0755be07c8600a7f1a81ef43e04b2c"
00011 _type = "openraveros/RobotInfo"
00012 _has_header = False
00013 _full_text = """# robot information
00014
00015 BodyInfo bodyinfo
00016 Manipulator[] manips
00017 AttachedSensor[] sensors
00018
00019 # total active dof
00020 uint8 activedof
00021
00022 # current active manipulator
00023 uint8 activemanip
00024
00025 # information about the active dofs
00026 ActiveDOFs active
00027
00028 # joint limits
00029 float32[] activelowerlimit
00030 float32[] activeupperlimit
00031
00032 # upper 8 bits
00033 uint16 Req_Manipulators=256
00034 uint16 Req_Sensors=512
00035 uint16 Req_ActiveDOFs=1024
00036 uint16 Req_ActiveLimits=2048
00037
00038 ================================================================================
00039 MSG: openraveros/BodyInfo
00040 # information about a body
00041 int32 bodyid
00042
00043 # current transformation
00044 AffineTransformMatrix transform
00045
00046 # degrees of freedom (number of joints)
00047 uint8 dof
00048
00049 # enabled status
00050 uint8 enabled
00051
00052
00053 # filename used to create body geometry
00054 string filename
00055
00056 # name of the body
00057 string name
00058
00059 # type of body
00060 string type
00061
00062 float32[] jointvalues
00063 AffineTransformMatrix[] links
00064 string[] linknames
00065 string[] jointnames
00066
00067 # joint limits
00068 float32[] lowerlimit
00069 float32[] upperlimit
00070
00071 # request information bitmasks, also holds robot specific request information (lower 8 bits)
00072 uint16 Req_JointValues=1
00073 uint16 Req_Links=2
00074 uint16 Req_LinkNames=4 # fills the linknames
00075 uint16 Req_JointLimits=8
00076 uint16 Req_Names=16 # if set, fills filename, name, and type
00077 uint16 Req_JointNames=32 # fills the jointnames
00078 ================================================================================
00079 MSG: openraveros/AffineTransformMatrix
00080 # column ordered 3x4 affine transformation, ie: the arrangement in memory is:
00081 # where the upper 3x3 matrix is orthonormal
00082 # [0] [3] [6] [9]
00083 # [1] [4] [7] [10]
00084 # [2] [5] [8] [11]
00085 float32[12] m
00086
00087 ================================================================================
00088 MSG: openraveros/Manipulator
00089 # information specific to a manipulator for a robot
00090
00091 # zero-based index of base link that manipulator is attached to
00092 int8 baselink
00093
00094 # zero-based index of link defining the end-effector
00095 int8 eelink
00096
00097 # 3x4 matrix of the grasp frame relative to the end-effector link
00098 AffineTransformMatrix tgrasp
00099
00100 # zero-based hand joint indices
00101 uint8[] handjoints
00102
00103 # zero-based arm joints indices (from base to end-effector)
00104 uint8[] armjoints
00105
00106 # name of ik solver using
00107 string iksolvername
00108
00109 # manipulator name
00110 string name
00111
00112 ================================================================================
00113 MSG: openraveros/AttachedSensor
00114 # information specific to an attached sensor for a robot
00115
00116 # name of sensor
00117 string name
00118
00119 # zero-based index of link sensor is attached to
00120 int8 attachedlink
00121
00122 # 3x4 matrix of the relative transform of the sensor frame with respect to the link frame
00123 AffineTransformMatrix trelative
00124
00125 # 3x4 matrix of the global transform of the sensor (ie, with link transform applied)
00126 AffineTransformMatrix tglobal
00127
00128 # type of sensor
00129 string type
00130
00131 ================================================================================
00132 MSG: openraveros/ActiveDOFs
00133 # specifies the active degrees of freedom of the robot
00134
00135 # mask of active base degrees of freedom
00136 uint32 affine
00137
00138 # active joints
00139 int32[] indices
00140
00141 float32[3] rotationaxis
00142
00143 # mask for affine dofs
00144 uint8 DOF_X = 1
00145 uint8 DOF_Y = 2
00146 uint8 DOF_Z = 4
00147 uint8 DOF_RotationAxis = 8
00148 uint8 DOF_Rotation3D = 16
00149 uint8 DOF_RotationQuat = 32
00150
00151 """
00152
00153 Req_Manipulators = 256
00154 Req_Sensors = 512
00155 Req_ActiveDOFs = 1024
00156 Req_ActiveLimits = 2048
00157
00158 __slots__ = ['bodyinfo','manips','sensors','activedof','activemanip','active','activelowerlimit','activeupperlimit']
00159 _slot_types = ['openraveros/BodyInfo','openraveros/Manipulator[]','openraveros/AttachedSensor[]','uint8','uint8','openraveros/ActiveDOFs','float32[]','float32[]']
00160
00161 def __init__(self, *args, **kwds):
00162 """
00163 Constructor. Any message fields that are implicitly/explicitly
00164 set to None will be assigned a default value. The recommend
00165 use is keyword arguments as this is more robust to future message
00166 changes. You cannot mix in-order arguments and keyword arguments.
00167
00168 The available fields are:
00169 bodyinfo,manips,sensors,activedof,activemanip,active,activelowerlimit,activeupperlimit
00170
00171 :param args: complete set of field values, in .msg order
00172 :param kwds: use keyword arguments corresponding to message field names
00173 to set specific fields.
00174 """
00175 if args or kwds:
00176 super(RobotInfo, self).__init__(*args, **kwds)
00177
00178 if self.bodyinfo is None:
00179 self.bodyinfo = openraveros.msg.BodyInfo()
00180 if self.manips is None:
00181 self.manips = []
00182 if self.sensors is None:
00183 self.sensors = []
00184 if self.activedof is None:
00185 self.activedof = 0
00186 if self.activemanip is None:
00187 self.activemanip = 0
00188 if self.active is None:
00189 self.active = openraveros.msg.ActiveDOFs()
00190 if self.activelowerlimit is None:
00191 self.activelowerlimit = []
00192 if self.activeupperlimit is None:
00193 self.activeupperlimit = []
00194 else:
00195 self.bodyinfo = openraveros.msg.BodyInfo()
00196 self.manips = []
00197 self.sensors = []
00198 self.activedof = 0
00199 self.activemanip = 0
00200 self.active = openraveros.msg.ActiveDOFs()
00201 self.activelowerlimit = []
00202 self.activeupperlimit = []
00203
00204 def _get_types(self):
00205 """
00206 internal API method
00207 """
00208 return self._slot_types
00209
00210 def serialize(self, buff):
00211 """
00212 serialize message into buffer
00213 :param buff: buffer, ``StringIO``
00214 """
00215 try:
00216 buff.write(_struct_i.pack(self.bodyinfo.bodyid))
00217 buff.write(_struct_12f.pack(*self.bodyinfo.transform.m))
00218 _x = self
00219 buff.write(_struct_2B.pack(_x.bodyinfo.dof, _x.bodyinfo.enabled))
00220 _x = self.bodyinfo.filename
00221 length = len(_x)
00222 if python3 or type(_x) == unicode:
00223 _x = _x.encode('utf-8')
00224 length = len(_x)
00225 buff.write(struct.pack('<I%ss'%length, length, _x))
00226 _x = self.bodyinfo.name
00227 length = len(_x)
00228 if python3 or type(_x) == unicode:
00229 _x = _x.encode('utf-8')
00230 length = len(_x)
00231 buff.write(struct.pack('<I%ss'%length, length, _x))
00232 _x = self.bodyinfo.type
00233 length = len(_x)
00234 if python3 or type(_x) == unicode:
00235 _x = _x.encode('utf-8')
00236 length = len(_x)
00237 buff.write(struct.pack('<I%ss'%length, length, _x))
00238 length = len(self.bodyinfo.jointvalues)
00239 buff.write(_struct_I.pack(length))
00240 pattern = '<%sf'%length
00241 buff.write(struct.pack(pattern, *self.bodyinfo.jointvalues))
00242 length = len(self.bodyinfo.links)
00243 buff.write(_struct_I.pack(length))
00244 for val1 in self.bodyinfo.links:
00245 buff.write(_struct_12f.pack(*val1.m))
00246 length = len(self.bodyinfo.linknames)
00247 buff.write(_struct_I.pack(length))
00248 for val1 in self.bodyinfo.linknames:
00249 length = len(val1)
00250 if python3 or type(val1) == unicode:
00251 val1 = val1.encode('utf-8')
00252 length = len(val1)
00253 buff.write(struct.pack('<I%ss'%length, length, val1))
00254 length = len(self.bodyinfo.jointnames)
00255 buff.write(_struct_I.pack(length))
00256 for val1 in self.bodyinfo.jointnames:
00257 length = len(val1)
00258 if python3 or type(val1) == unicode:
00259 val1 = val1.encode('utf-8')
00260 length = len(val1)
00261 buff.write(struct.pack('<I%ss'%length, length, val1))
00262 length = len(self.bodyinfo.lowerlimit)
00263 buff.write(_struct_I.pack(length))
00264 pattern = '<%sf'%length
00265 buff.write(struct.pack(pattern, *self.bodyinfo.lowerlimit))
00266 length = len(self.bodyinfo.upperlimit)
00267 buff.write(_struct_I.pack(length))
00268 pattern = '<%sf'%length
00269 buff.write(struct.pack(pattern, *self.bodyinfo.upperlimit))
00270 length = len(self.manips)
00271 buff.write(_struct_I.pack(length))
00272 for val1 in self.manips:
00273 _x = val1
00274 buff.write(_struct_2b.pack(_x.baselink, _x.eelink))
00275 _v1 = val1.tgrasp
00276 buff.write(_struct_12f.pack(*_v1.m))
00277 _x = val1.handjoints
00278 length = len(_x)
00279
00280 if type(_x) in [list, tuple]:
00281 buff.write(struct.pack('<I%sB'%length, length, *_x))
00282 else:
00283 buff.write(struct.pack('<I%ss'%length, length, _x))
00284 _x = val1.armjoints
00285 length = len(_x)
00286
00287 if type(_x) in [list, tuple]:
00288 buff.write(struct.pack('<I%sB'%length, length, *_x))
00289 else:
00290 buff.write(struct.pack('<I%ss'%length, length, _x))
00291 _x = val1.iksolvername
00292 length = len(_x)
00293 if python3 or type(_x) == unicode:
00294 _x = _x.encode('utf-8')
00295 length = len(_x)
00296 buff.write(struct.pack('<I%ss'%length, length, _x))
00297 _x = val1.name
00298 length = len(_x)
00299 if python3 or type(_x) == unicode:
00300 _x = _x.encode('utf-8')
00301 length = len(_x)
00302 buff.write(struct.pack('<I%ss'%length, length, _x))
00303 length = len(self.sensors)
00304 buff.write(_struct_I.pack(length))
00305 for val1 in self.sensors:
00306 _x = val1.name
00307 length = len(_x)
00308 if python3 or type(_x) == unicode:
00309 _x = _x.encode('utf-8')
00310 length = len(_x)
00311 buff.write(struct.pack('<I%ss'%length, length, _x))
00312 buff.write(_struct_b.pack(val1.attachedlink))
00313 _v2 = val1.trelative
00314 buff.write(_struct_12f.pack(*_v2.m))
00315 _v3 = val1.tglobal
00316 buff.write(_struct_12f.pack(*_v3.m))
00317 _x = val1.type
00318 length = len(_x)
00319 if python3 or type(_x) == unicode:
00320 _x = _x.encode('utf-8')
00321 length = len(_x)
00322 buff.write(struct.pack('<I%ss'%length, length, _x))
00323 _x = self
00324 buff.write(_struct_2BI.pack(_x.activedof, _x.activemanip, _x.active.affine))
00325 length = len(self.active.indices)
00326 buff.write(_struct_I.pack(length))
00327 pattern = '<%si'%length
00328 buff.write(struct.pack(pattern, *self.active.indices))
00329 buff.write(_struct_3f.pack(*self.active.rotationaxis))
00330 length = len(self.activelowerlimit)
00331 buff.write(_struct_I.pack(length))
00332 pattern = '<%sf'%length
00333 buff.write(struct.pack(pattern, *self.activelowerlimit))
00334 length = len(self.activeupperlimit)
00335 buff.write(_struct_I.pack(length))
00336 pattern = '<%sf'%length
00337 buff.write(struct.pack(pattern, *self.activeupperlimit))
00338 except struct.error as se: self._check_types(se)
00339 except TypeError as te: self._check_types(te)
00340
00341 def deserialize(self, str):
00342 """
00343 unpack serialized message in str into this message instance
00344 :param str: byte array of serialized message, ``str``
00345 """
00346 try:
00347 if self.bodyinfo is None:
00348 self.bodyinfo = openraveros.msg.BodyInfo()
00349 if self.manips is None:
00350 self.manips = None
00351 if self.sensors is None:
00352 self.sensors = None
00353 if self.active is None:
00354 self.active = openraveros.msg.ActiveDOFs()
00355 end = 0
00356 start = end
00357 end += 4
00358 (self.bodyinfo.bodyid,) = _struct_i.unpack(str[start:end])
00359 start = end
00360 end += 48
00361 self.bodyinfo.transform.m = _struct_12f.unpack(str[start:end])
00362 _x = self
00363 start = end
00364 end += 2
00365 (_x.bodyinfo.dof, _x.bodyinfo.enabled,) = _struct_2B.unpack(str[start:end])
00366 start = end
00367 end += 4
00368 (length,) = _struct_I.unpack(str[start:end])
00369 start = end
00370 end += length
00371 if python3:
00372 self.bodyinfo.filename = str[start:end].decode('utf-8')
00373 else:
00374 self.bodyinfo.filename = str[start:end]
00375 start = end
00376 end += 4
00377 (length,) = _struct_I.unpack(str[start:end])
00378 start = end
00379 end += length
00380 if python3:
00381 self.bodyinfo.name = str[start:end].decode('utf-8')
00382 else:
00383 self.bodyinfo.name = str[start:end]
00384 start = end
00385 end += 4
00386 (length,) = _struct_I.unpack(str[start:end])
00387 start = end
00388 end += length
00389 if python3:
00390 self.bodyinfo.type = str[start:end].decode('utf-8')
00391 else:
00392 self.bodyinfo.type = str[start:end]
00393 start = end
00394 end += 4
00395 (length,) = _struct_I.unpack(str[start:end])
00396 pattern = '<%sf'%length
00397 start = end
00398 end += struct.calcsize(pattern)
00399 self.bodyinfo.jointvalues = struct.unpack(pattern, str[start:end])
00400 start = end
00401 end += 4
00402 (length,) = _struct_I.unpack(str[start:end])
00403 self.bodyinfo.links = []
00404 for i in range(0, length):
00405 val1 = openraveros.msg.AffineTransformMatrix()
00406 start = end
00407 end += 48
00408 val1.m = _struct_12f.unpack(str[start:end])
00409 self.bodyinfo.links.append(val1)
00410 start = end
00411 end += 4
00412 (length,) = _struct_I.unpack(str[start:end])
00413 self.bodyinfo.linknames = []
00414 for i in range(0, length):
00415 start = end
00416 end += 4
00417 (length,) = _struct_I.unpack(str[start:end])
00418 start = end
00419 end += length
00420 if python3:
00421 val1 = str[start:end].decode('utf-8')
00422 else:
00423 val1 = str[start:end]
00424 self.bodyinfo.linknames.append(val1)
00425 start = end
00426 end += 4
00427 (length,) = _struct_I.unpack(str[start:end])
00428 self.bodyinfo.jointnames = []
00429 for i in range(0, length):
00430 start = end
00431 end += 4
00432 (length,) = _struct_I.unpack(str[start:end])
00433 start = end
00434 end += length
00435 if python3:
00436 val1 = str[start:end].decode('utf-8')
00437 else:
00438 val1 = str[start:end]
00439 self.bodyinfo.jointnames.append(val1)
00440 start = end
00441 end += 4
00442 (length,) = _struct_I.unpack(str[start:end])
00443 pattern = '<%sf'%length
00444 start = end
00445 end += struct.calcsize(pattern)
00446 self.bodyinfo.lowerlimit = struct.unpack(pattern, str[start:end])
00447 start = end
00448 end += 4
00449 (length,) = _struct_I.unpack(str[start:end])
00450 pattern = '<%sf'%length
00451 start = end
00452 end += struct.calcsize(pattern)
00453 self.bodyinfo.upperlimit = struct.unpack(pattern, str[start:end])
00454 start = end
00455 end += 4
00456 (length,) = _struct_I.unpack(str[start:end])
00457 self.manips = []
00458 for i in range(0, length):
00459 val1 = openraveros.msg.Manipulator()
00460 _x = val1
00461 start = end
00462 end += 2
00463 (_x.baselink, _x.eelink,) = _struct_2b.unpack(str[start:end])
00464 _v4 = val1.tgrasp
00465 start = end
00466 end += 48
00467 _v4.m = _struct_12f.unpack(str[start:end])
00468 start = end
00469 end += 4
00470 (length,) = _struct_I.unpack(str[start:end])
00471 start = end
00472 end += length
00473 if python3:
00474 val1.handjoints = str[start:end].decode('utf-8')
00475 else:
00476 val1.handjoints = str[start:end]
00477 start = end
00478 end += 4
00479 (length,) = _struct_I.unpack(str[start:end])
00480 start = end
00481 end += length
00482 if python3:
00483 val1.armjoints = str[start:end].decode('utf-8')
00484 else:
00485 val1.armjoints = str[start:end]
00486 start = end
00487 end += 4
00488 (length,) = _struct_I.unpack(str[start:end])
00489 start = end
00490 end += length
00491 if python3:
00492 val1.iksolvername = str[start:end].decode('utf-8')
00493 else:
00494 val1.iksolvername = str[start:end]
00495 start = end
00496 end += 4
00497 (length,) = _struct_I.unpack(str[start:end])
00498 start = end
00499 end += length
00500 if python3:
00501 val1.name = str[start:end].decode('utf-8')
00502 else:
00503 val1.name = str[start:end]
00504 self.manips.append(val1)
00505 start = end
00506 end += 4
00507 (length,) = _struct_I.unpack(str[start:end])
00508 self.sensors = []
00509 for i in range(0, length):
00510 val1 = openraveros.msg.AttachedSensor()
00511 start = end
00512 end += 4
00513 (length,) = _struct_I.unpack(str[start:end])
00514 start = end
00515 end += length
00516 if python3:
00517 val1.name = str[start:end].decode('utf-8')
00518 else:
00519 val1.name = str[start:end]
00520 start = end
00521 end += 1
00522 (val1.attachedlink,) = _struct_b.unpack(str[start:end])
00523 _v5 = val1.trelative
00524 start = end
00525 end += 48
00526 _v5.m = _struct_12f.unpack(str[start:end])
00527 _v6 = val1.tglobal
00528 start = end
00529 end += 48
00530 _v6.m = _struct_12f.unpack(str[start:end])
00531 start = end
00532 end += 4
00533 (length,) = _struct_I.unpack(str[start:end])
00534 start = end
00535 end += length
00536 if python3:
00537 val1.type = str[start:end].decode('utf-8')
00538 else:
00539 val1.type = str[start:end]
00540 self.sensors.append(val1)
00541 _x = self
00542 start = end
00543 end += 6
00544 (_x.activedof, _x.activemanip, _x.active.affine,) = _struct_2BI.unpack(str[start:end])
00545 start = end
00546 end += 4
00547 (length,) = _struct_I.unpack(str[start:end])
00548 pattern = '<%si'%length
00549 start = end
00550 end += struct.calcsize(pattern)
00551 self.active.indices = struct.unpack(pattern, str[start:end])
00552 start = end
00553 end += 12
00554 self.active.rotationaxis = _struct_3f.unpack(str[start:end])
00555 start = end
00556 end += 4
00557 (length,) = _struct_I.unpack(str[start:end])
00558 pattern = '<%sf'%length
00559 start = end
00560 end += struct.calcsize(pattern)
00561 self.activelowerlimit = struct.unpack(pattern, str[start:end])
00562 start = end
00563 end += 4
00564 (length,) = _struct_I.unpack(str[start:end])
00565 pattern = '<%sf'%length
00566 start = end
00567 end += struct.calcsize(pattern)
00568 self.activeupperlimit = struct.unpack(pattern, str[start:end])
00569 return self
00570 except struct.error as e:
00571 raise genpy.DeserializationError(e)
00572
00573
00574 def serialize_numpy(self, buff, numpy):
00575 """
00576 serialize message with numpy array types into buffer
00577 :param buff: buffer, ``StringIO``
00578 :param numpy: numpy python module
00579 """
00580 try:
00581 buff.write(_struct_i.pack(self.bodyinfo.bodyid))
00582 buff.write(self.bodyinfo.transform.m.tostring())
00583 _x = self
00584 buff.write(_struct_2B.pack(_x.bodyinfo.dof, _x.bodyinfo.enabled))
00585 _x = self.bodyinfo.filename
00586 length = len(_x)
00587 if python3 or type(_x) == unicode:
00588 _x = _x.encode('utf-8')
00589 length = len(_x)
00590 buff.write(struct.pack('<I%ss'%length, length, _x))
00591 _x = self.bodyinfo.name
00592 length = len(_x)
00593 if python3 or type(_x) == unicode:
00594 _x = _x.encode('utf-8')
00595 length = len(_x)
00596 buff.write(struct.pack('<I%ss'%length, length, _x))
00597 _x = self.bodyinfo.type
00598 length = len(_x)
00599 if python3 or type(_x) == unicode:
00600 _x = _x.encode('utf-8')
00601 length = len(_x)
00602 buff.write(struct.pack('<I%ss'%length, length, _x))
00603 length = len(self.bodyinfo.jointvalues)
00604 buff.write(_struct_I.pack(length))
00605 pattern = '<%sf'%length
00606 buff.write(self.bodyinfo.jointvalues.tostring())
00607 length = len(self.bodyinfo.links)
00608 buff.write(_struct_I.pack(length))
00609 for val1 in self.bodyinfo.links:
00610 buff.write(val1.m.tostring())
00611 length = len(self.bodyinfo.linknames)
00612 buff.write(_struct_I.pack(length))
00613 for val1 in self.bodyinfo.linknames:
00614 length = len(val1)
00615 if python3 or type(val1) == unicode:
00616 val1 = val1.encode('utf-8')
00617 length = len(val1)
00618 buff.write(struct.pack('<I%ss'%length, length, val1))
00619 length = len(self.bodyinfo.jointnames)
00620 buff.write(_struct_I.pack(length))
00621 for val1 in self.bodyinfo.jointnames:
00622 length = len(val1)
00623 if python3 or type(val1) == unicode:
00624 val1 = val1.encode('utf-8')
00625 length = len(val1)
00626 buff.write(struct.pack('<I%ss'%length, length, val1))
00627 length = len(self.bodyinfo.lowerlimit)
00628 buff.write(_struct_I.pack(length))
00629 pattern = '<%sf'%length
00630 buff.write(self.bodyinfo.lowerlimit.tostring())
00631 length = len(self.bodyinfo.upperlimit)
00632 buff.write(_struct_I.pack(length))
00633 pattern = '<%sf'%length
00634 buff.write(self.bodyinfo.upperlimit.tostring())
00635 length = len(self.manips)
00636 buff.write(_struct_I.pack(length))
00637 for val1 in self.manips:
00638 _x = val1
00639 buff.write(_struct_2b.pack(_x.baselink, _x.eelink))
00640 _v7 = val1.tgrasp
00641 buff.write(_v7.m.tostring())
00642 _x = val1.handjoints
00643 length = len(_x)
00644
00645 if type(_x) in [list, tuple]:
00646 buff.write(struct.pack('<I%sB'%length, length, *_x))
00647 else:
00648 buff.write(struct.pack('<I%ss'%length, length, _x))
00649 _x = val1.armjoints
00650 length = len(_x)
00651
00652 if type(_x) in [list, tuple]:
00653 buff.write(struct.pack('<I%sB'%length, length, *_x))
00654 else:
00655 buff.write(struct.pack('<I%ss'%length, length, _x))
00656 _x = val1.iksolvername
00657 length = len(_x)
00658 if python3 or type(_x) == unicode:
00659 _x = _x.encode('utf-8')
00660 length = len(_x)
00661 buff.write(struct.pack('<I%ss'%length, length, _x))
00662 _x = val1.name
00663 length = len(_x)
00664 if python3 or type(_x) == unicode:
00665 _x = _x.encode('utf-8')
00666 length = len(_x)
00667 buff.write(struct.pack('<I%ss'%length, length, _x))
00668 length = len(self.sensors)
00669 buff.write(_struct_I.pack(length))
00670 for val1 in self.sensors:
00671 _x = val1.name
00672 length = len(_x)
00673 if python3 or type(_x) == unicode:
00674 _x = _x.encode('utf-8')
00675 length = len(_x)
00676 buff.write(struct.pack('<I%ss'%length, length, _x))
00677 buff.write(_struct_b.pack(val1.attachedlink))
00678 _v8 = val1.trelative
00679 buff.write(_v8.m.tostring())
00680 _v9 = val1.tglobal
00681 buff.write(_v9.m.tostring())
00682 _x = val1.type
00683 length = len(_x)
00684 if python3 or type(_x) == unicode:
00685 _x = _x.encode('utf-8')
00686 length = len(_x)
00687 buff.write(struct.pack('<I%ss'%length, length, _x))
00688 _x = self
00689 buff.write(_struct_2BI.pack(_x.activedof, _x.activemanip, _x.active.affine))
00690 length = len(self.active.indices)
00691 buff.write(_struct_I.pack(length))
00692 pattern = '<%si'%length
00693 buff.write(self.active.indices.tostring())
00694 buff.write(self.active.rotationaxis.tostring())
00695 length = len(self.activelowerlimit)
00696 buff.write(_struct_I.pack(length))
00697 pattern = '<%sf'%length
00698 buff.write(self.activelowerlimit.tostring())
00699 length = len(self.activeupperlimit)
00700 buff.write(_struct_I.pack(length))
00701 pattern = '<%sf'%length
00702 buff.write(self.activeupperlimit.tostring())
00703 except struct.error as se: self._check_types(se)
00704 except TypeError as te: self._check_types(te)
00705
00706 def deserialize_numpy(self, str, numpy):
00707 """
00708 unpack serialized message in str into this message instance using numpy for array types
00709 :param str: byte array of serialized message, ``str``
00710 :param numpy: numpy python module
00711 """
00712 try:
00713 if self.bodyinfo is None:
00714 self.bodyinfo = openraveros.msg.BodyInfo()
00715 if self.manips is None:
00716 self.manips = None
00717 if self.sensors is None:
00718 self.sensors = None
00719 if self.active is None:
00720 self.active = openraveros.msg.ActiveDOFs()
00721 end = 0
00722 start = end
00723 end += 4
00724 (self.bodyinfo.bodyid,) = _struct_i.unpack(str[start:end])
00725 start = end
00726 end += 48
00727 self.bodyinfo.transform.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00728 _x = self
00729 start = end
00730 end += 2
00731 (_x.bodyinfo.dof, _x.bodyinfo.enabled,) = _struct_2B.unpack(str[start:end])
00732 start = end
00733 end += 4
00734 (length,) = _struct_I.unpack(str[start:end])
00735 start = end
00736 end += length
00737 if python3:
00738 self.bodyinfo.filename = str[start:end].decode('utf-8')
00739 else:
00740 self.bodyinfo.filename = str[start:end]
00741 start = end
00742 end += 4
00743 (length,) = _struct_I.unpack(str[start:end])
00744 start = end
00745 end += length
00746 if python3:
00747 self.bodyinfo.name = str[start:end].decode('utf-8')
00748 else:
00749 self.bodyinfo.name = str[start:end]
00750 start = end
00751 end += 4
00752 (length,) = _struct_I.unpack(str[start:end])
00753 start = end
00754 end += length
00755 if python3:
00756 self.bodyinfo.type = str[start:end].decode('utf-8')
00757 else:
00758 self.bodyinfo.type = str[start:end]
00759 start = end
00760 end += 4
00761 (length,) = _struct_I.unpack(str[start:end])
00762 pattern = '<%sf'%length
00763 start = end
00764 end += struct.calcsize(pattern)
00765 self.bodyinfo.jointvalues = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00766 start = end
00767 end += 4
00768 (length,) = _struct_I.unpack(str[start:end])
00769 self.bodyinfo.links = []
00770 for i in range(0, length):
00771 val1 = openraveros.msg.AffineTransformMatrix()
00772 start = end
00773 end += 48
00774 val1.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00775 self.bodyinfo.links.append(val1)
00776 start = end
00777 end += 4
00778 (length,) = _struct_I.unpack(str[start:end])
00779 self.bodyinfo.linknames = []
00780 for i in range(0, length):
00781 start = end
00782 end += 4
00783 (length,) = _struct_I.unpack(str[start:end])
00784 start = end
00785 end += length
00786 if python3:
00787 val1 = str[start:end].decode('utf-8')
00788 else:
00789 val1 = str[start:end]
00790 self.bodyinfo.linknames.append(val1)
00791 start = end
00792 end += 4
00793 (length,) = _struct_I.unpack(str[start:end])
00794 self.bodyinfo.jointnames = []
00795 for i in range(0, length):
00796 start = end
00797 end += 4
00798 (length,) = _struct_I.unpack(str[start:end])
00799 start = end
00800 end += length
00801 if python3:
00802 val1 = str[start:end].decode('utf-8')
00803 else:
00804 val1 = str[start:end]
00805 self.bodyinfo.jointnames.append(val1)
00806 start = end
00807 end += 4
00808 (length,) = _struct_I.unpack(str[start:end])
00809 pattern = '<%sf'%length
00810 start = end
00811 end += struct.calcsize(pattern)
00812 self.bodyinfo.lowerlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00813 start = end
00814 end += 4
00815 (length,) = _struct_I.unpack(str[start:end])
00816 pattern = '<%sf'%length
00817 start = end
00818 end += struct.calcsize(pattern)
00819 self.bodyinfo.upperlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00820 start = end
00821 end += 4
00822 (length,) = _struct_I.unpack(str[start:end])
00823 self.manips = []
00824 for i in range(0, length):
00825 val1 = openraveros.msg.Manipulator()
00826 _x = val1
00827 start = end
00828 end += 2
00829 (_x.baselink, _x.eelink,) = _struct_2b.unpack(str[start:end])
00830 _v10 = val1.tgrasp
00831 start = end
00832 end += 48
00833 _v10.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00834 start = end
00835 end += 4
00836 (length,) = _struct_I.unpack(str[start:end])
00837 start = end
00838 end += length
00839 if python3:
00840 val1.handjoints = str[start:end].decode('utf-8')
00841 else:
00842 val1.handjoints = str[start:end]
00843 start = end
00844 end += 4
00845 (length,) = _struct_I.unpack(str[start:end])
00846 start = end
00847 end += length
00848 if python3:
00849 val1.armjoints = str[start:end].decode('utf-8')
00850 else:
00851 val1.armjoints = str[start:end]
00852 start = end
00853 end += 4
00854 (length,) = _struct_I.unpack(str[start:end])
00855 start = end
00856 end += length
00857 if python3:
00858 val1.iksolvername = str[start:end].decode('utf-8')
00859 else:
00860 val1.iksolvername = str[start:end]
00861 start = end
00862 end += 4
00863 (length,) = _struct_I.unpack(str[start:end])
00864 start = end
00865 end += length
00866 if python3:
00867 val1.name = str[start:end].decode('utf-8')
00868 else:
00869 val1.name = str[start:end]
00870 self.manips.append(val1)
00871 start = end
00872 end += 4
00873 (length,) = _struct_I.unpack(str[start:end])
00874 self.sensors = []
00875 for i in range(0, length):
00876 val1 = openraveros.msg.AttachedSensor()
00877 start = end
00878 end += 4
00879 (length,) = _struct_I.unpack(str[start:end])
00880 start = end
00881 end += length
00882 if python3:
00883 val1.name = str[start:end].decode('utf-8')
00884 else:
00885 val1.name = str[start:end]
00886 start = end
00887 end += 1
00888 (val1.attachedlink,) = _struct_b.unpack(str[start:end])
00889 _v11 = val1.trelative
00890 start = end
00891 end += 48
00892 _v11.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00893 _v12 = val1.tglobal
00894 start = end
00895 end += 48
00896 _v12.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00897 start = end
00898 end += 4
00899 (length,) = _struct_I.unpack(str[start:end])
00900 start = end
00901 end += length
00902 if python3:
00903 val1.type = str[start:end].decode('utf-8')
00904 else:
00905 val1.type = str[start:end]
00906 self.sensors.append(val1)
00907 _x = self
00908 start = end
00909 end += 6
00910 (_x.activedof, _x.activemanip, _x.active.affine,) = _struct_2BI.unpack(str[start:end])
00911 start = end
00912 end += 4
00913 (length,) = _struct_I.unpack(str[start:end])
00914 pattern = '<%si'%length
00915 start = end
00916 end += struct.calcsize(pattern)
00917 self.active.indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00918 start = end
00919 end += 12
00920 self.active.rotationaxis = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00921 start = end
00922 end += 4
00923 (length,) = _struct_I.unpack(str[start:end])
00924 pattern = '<%sf'%length
00925 start = end
00926 end += struct.calcsize(pattern)
00927 self.activelowerlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00928 start = end
00929 end += 4
00930 (length,) = _struct_I.unpack(str[start:end])
00931 pattern = '<%sf'%length
00932 start = end
00933 end += struct.calcsize(pattern)
00934 self.activeupperlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00935 return self
00936 except struct.error as e:
00937 raise genpy.DeserializationError(e)
00938
00939 _struct_I = genpy.struct_I
00940 _struct_b = struct.Struct("<b")
00941 _struct_2B = struct.Struct("<2B")
00942 _struct_12f = struct.Struct("<12f")
00943 _struct_i = struct.Struct("<i")
00944 _struct_2b = struct.Struct("<2b")
00945 _struct_2BI = struct.Struct("<2BI")
00946 _struct_3f = struct.Struct("<3f")