00001 """autogenerated by genmsg_py from GetCollisionObjectsRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class GetCollisionObjectsRequest(roslib.message.Message):
00007 _md5sum = "3ae7288b23c84452d229e442c1673708"
00008 _type = "planning_environment_msgs/GetCollisionObjectsRequest"
00009 _has_header = False
00010 _full_text = """
00011
00012
00013 bool include_points
00014
00015 """
00016 __slots__ = ['include_points']
00017 _slot_types = ['bool']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 include_points
00028
00029 @param args: complete set of field values, in .msg order
00030 @param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(GetCollisionObjectsRequest, self).__init__(*args, **kwds)
00035
00036 if self.include_points is None:
00037 self.include_points = False
00038 else:
00039 self.include_points = False
00040
00041 def _get_types(self):
00042 """
00043 internal API method
00044 """
00045 return self._slot_types
00046
00047 def serialize(self, buff):
00048 """
00049 serialize message into buffer
00050 @param buff: buffer
00051 @type buff: StringIO
00052 """
00053 try:
00054 buff.write(_struct_B.pack(self.include_points))
00055 except struct.error, se: self._check_types(se)
00056 except TypeError, te: self._check_types(te)
00057
00058 def deserialize(self, str):
00059 """
00060 unpack serialized message in str into this message instance
00061 @param str: byte array of serialized message
00062 @type str: str
00063 """
00064 try:
00065 end = 0
00066 start = end
00067 end += 1
00068 (self.include_points,) = _struct_B.unpack(str[start:end])
00069 self.include_points = bool(self.include_points)
00070 return self
00071 except struct.error, e:
00072 raise roslib.message.DeserializationError(e)
00073
00074
00075 def serialize_numpy(self, buff, numpy):
00076 """
00077 serialize message with numpy array types into buffer
00078 @param buff: buffer
00079 @type buff: StringIO
00080 @param numpy: numpy python module
00081 @type numpy module
00082 """
00083 try:
00084 buff.write(_struct_B.pack(self.include_points))
00085 except struct.error, se: self._check_types(se)
00086 except TypeError, te: self._check_types(te)
00087
00088 def deserialize_numpy(self, str, numpy):
00089 """
00090 unpack serialized message in str into this message instance using numpy for array types
00091 @param str: byte array of serialized message
00092 @type str: str
00093 @param numpy: numpy python module
00094 @type numpy: module
00095 """
00096 try:
00097 end = 0
00098 start = end
00099 end += 1
00100 (self.include_points,) = _struct_B.unpack(str[start:end])
00101 self.include_points = bool(self.include_points)
00102 return self
00103 except struct.error, e:
00104 raise roslib.message.DeserializationError(e)
00105
00106 _struct_I = roslib.message.struct_I
00107 _struct_B = struct.Struct("<B")
00108 """autogenerated by genmsg_py from GetCollisionObjectsResponse.msg. Do not edit."""
00109 import roslib.message
00110 import struct
00111
00112 import mapping_msgs.msg
00113 import geometry_msgs.msg
00114 import geometric_shapes_msgs.msg
00115 import std_msgs.msg
00116
00117 class GetCollisionObjectsResponse(roslib.message.Message):
00118 _md5sum = "c9101c21d974637e34677dde51cc79e1"
00119 _type = "planning_environment_msgs/GetCollisionObjectsResponse"
00120 _has_header = False
00121 _full_text = """
00122 mapping_msgs/CollisionMap points
00123
00124 mapping_msgs/CollisionObject[] collision_objects
00125
00126 mapping_msgs/AttachedCollisionObject[] attached_collision_objects
00127
00128
00129 ================================================================================
00130 MSG: mapping_msgs/CollisionMap
00131 #header for interpreting box positions
00132 Header header
00133
00134 #boxes for use in collision testing
00135 OrientedBoundingBox[] boxes
00136
00137 ================================================================================
00138 MSG: std_msgs/Header
00139 # Standard metadata for higher-level stamped data types.
00140 # This is generally used to communicate timestamped data
00141 # in a particular coordinate frame.
00142 #
00143 # sequence ID: consecutively increasing ID
00144 uint32 seq
00145 #Two-integer timestamp that is expressed as:
00146 # * stamp.secs: seconds (stamp_secs) since epoch
00147 # * stamp.nsecs: nanoseconds since stamp_secs
00148 # time-handling sugar is provided by the client library
00149 time stamp
00150 #Frame this data is associated with
00151 # 0: no frame
00152 # 1: global frame
00153 string frame_id
00154
00155 ================================================================================
00156 MSG: mapping_msgs/OrientedBoundingBox
00157 #the center of the box
00158 geometry_msgs/Point32 center
00159
00160 #the extents of the box, assuming the center is at the point
00161 geometry_msgs/Point32 extents
00162
00163 #the axis of the box
00164 geometry_msgs/Point32 axis
00165
00166 #the angle of rotation around the axis
00167 float32 angle
00168
00169 ================================================================================
00170 MSG: geometry_msgs/Point32
00171 # This contains the position of a point in free space(with 32 bits of precision).
00172 # It is recommeded to use Point wherever possible instead of Point32.
00173 #
00174 # This recommendation is to promote interoperability.
00175 #
00176 # This message is designed to take up less space when sending
00177 # lots of points at once, as in the case of a PointCloud.
00178
00179 float32 x
00180 float32 y
00181 float32 z
00182 ================================================================================
00183 MSG: mapping_msgs/CollisionObject
00184 # a header, used for interpreting the poses
00185 Header header
00186
00187 # the id of the object
00188 string id
00189
00190 #This contains what is to be done with the object
00191 CollisionObjectOperation operation
00192
00193 #the shapes associated with the object
00194 geometric_shapes_msgs/Shape[] shapes
00195
00196 #the poses associated with the shapes - will be transformed using the header
00197 geometry_msgs/Pose[] poses
00198
00199 ================================================================================
00200 MSG: mapping_msgs/CollisionObjectOperation
00201 #Puts the object into the environment
00202 #or updates the object if already added
00203 byte ADD=0
00204
00205 #Removes the object from the environment entirely
00206 byte REMOVE=1
00207
00208 #Only valid within the context of a CollisionAttachedObject message
00209 #Will be ignored if sent with an CollisionObject message
00210 #Takes an attached object, detaches from the attached link
00211 #But adds back in as regular object
00212 byte DETACH_AND_ADD_AS_OBJECT=2
00213
00214 #Only valid within the context of a CollisionAttachedObject message
00215 #Will be ignored if sent with an CollisionObject message
00216 #Takes current object in the environment and removes it as
00217 #a regular object
00218 byte ATTACH_AND_REMOVE_AS_OBJECT=3
00219
00220 # Byte code for operation
00221 byte operation
00222
00223 ================================================================================
00224 MSG: geometric_shapes_msgs/Shape
00225 byte SPHERE=0
00226 byte BOX=1
00227 byte CYLINDER=2
00228 byte MESH=3
00229
00230 byte type
00231
00232
00233 #### define sphere, box, cylinder ####
00234 # the origin of each shape is considered at the shape's center
00235
00236 # for sphere
00237 # radius := dimensions[0]
00238
00239 # for cylinder
00240 # radius := dimensions[0]
00241 # length := dimensions[1]
00242 # the length is along the Z axis
00243
00244 # for box
00245 # size_x := dimensions[0]
00246 # size_y := dimensions[1]
00247 # size_z := dimensions[2]
00248 float64[] dimensions
00249
00250
00251 #### define mesh ####
00252
00253 # list of triangles; triangle k is defined by tre vertices located
00254 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00255 int32[] triangles
00256 geometry_msgs/Point[] vertices
00257
00258 ================================================================================
00259 MSG: geometry_msgs/Point
00260 # This contains the position of a point in free space
00261 float64 x
00262 float64 y
00263 float64 z
00264
00265 ================================================================================
00266 MSG: geometry_msgs/Pose
00267 # A representation of pose in free space, composed of postion and orientation.
00268 Point position
00269 Quaternion orientation
00270
00271 ================================================================================
00272 MSG: geometry_msgs/Quaternion
00273 # This represents an orientation in free space in quaternion form.
00274
00275 float64 x
00276 float64 y
00277 float64 z
00278 float64 w
00279
00280 ================================================================================
00281 MSG: mapping_msgs/AttachedCollisionObject
00282 # The CollisionObject will be attached with a fixed joint to this link
00283 # If link name is set to REMOVE_ALL_ATTACHED_OBJECTS and object.operation
00284 # is set to REMOVE will remove all attached bodies attached to any object
00285 string link_name
00286
00287 #Reserved for indicating that all attached objects should be removed
00288 string REMOVE_ALL_ATTACHED_OBJECTS = "all"
00289
00290 #This contains the actual shapes and poses for the CollisionObject
00291 #to be attached to the link
00292 #If action is remove and no object.id is set, all objects
00293 #attached to the link indicated by link_name will be removed
00294 CollisionObject object
00295
00296 # The set of links that the attached objects are allowed to touch
00297 # by default - the link_name is included by default
00298 string[] touch_links
00299
00300 """
00301 __slots__ = ['points','collision_objects','attached_collision_objects']
00302 _slot_types = ['mapping_msgs/CollisionMap','mapping_msgs/CollisionObject[]','mapping_msgs/AttachedCollisionObject[]']
00303
00304 def __init__(self, *args, **kwds):
00305 """
00306 Constructor. Any message fields that are implicitly/explicitly
00307 set to None will be assigned a default value. The recommend
00308 use is keyword arguments as this is more robust to future message
00309 changes. You cannot mix in-order arguments and keyword arguments.
00310
00311 The available fields are:
00312 points,collision_objects,attached_collision_objects
00313
00314 @param args: complete set of field values, in .msg order
00315 @param kwds: use keyword arguments corresponding to message field names
00316 to set specific fields.
00317 """
00318 if args or kwds:
00319 super(GetCollisionObjectsResponse, self).__init__(*args, **kwds)
00320
00321 if self.points is None:
00322 self.points = mapping_msgs.msg.CollisionMap()
00323 if self.collision_objects is None:
00324 self.collision_objects = []
00325 if self.attached_collision_objects is None:
00326 self.attached_collision_objects = []
00327 else:
00328 self.points = mapping_msgs.msg.CollisionMap()
00329 self.collision_objects = []
00330 self.attached_collision_objects = []
00331
00332 def _get_types(self):
00333 """
00334 internal API method
00335 """
00336 return self._slot_types
00337
00338 def serialize(self, buff):
00339 """
00340 serialize message into buffer
00341 @param buff: buffer
00342 @type buff: StringIO
00343 """
00344 try:
00345 _x = self
00346 buff.write(_struct_3I.pack(_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs))
00347 _x = self.points.header.frame_id
00348 length = len(_x)
00349 buff.write(struct.pack('<I%ss'%length, length, _x))
00350 length = len(self.points.boxes)
00351 buff.write(_struct_I.pack(length))
00352 for val1 in self.points.boxes:
00353 _v1 = val1.center
00354 _x = _v1
00355 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00356 _v2 = val1.extents
00357 _x = _v2
00358 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00359 _v3 = val1.axis
00360 _x = _v3
00361 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00362 buff.write(_struct_f.pack(val1.angle))
00363 length = len(self.collision_objects)
00364 buff.write(_struct_I.pack(length))
00365 for val1 in self.collision_objects:
00366 _v4 = val1.header
00367 buff.write(_struct_I.pack(_v4.seq))
00368 _v5 = _v4.stamp
00369 _x = _v5
00370 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00371 _x = _v4.frame_id
00372 length = len(_x)
00373 buff.write(struct.pack('<I%ss'%length, length, _x))
00374 _x = val1.id
00375 length = len(_x)
00376 buff.write(struct.pack('<I%ss'%length, length, _x))
00377 _v6 = val1.operation
00378 buff.write(_struct_b.pack(_v6.operation))
00379 length = len(val1.shapes)
00380 buff.write(_struct_I.pack(length))
00381 for val2 in val1.shapes:
00382 buff.write(_struct_b.pack(val2.type))
00383 length = len(val2.dimensions)
00384 buff.write(_struct_I.pack(length))
00385 pattern = '<%sd'%length
00386 buff.write(struct.pack(pattern, *val2.dimensions))
00387 length = len(val2.triangles)
00388 buff.write(_struct_I.pack(length))
00389 pattern = '<%si'%length
00390 buff.write(struct.pack(pattern, *val2.triangles))
00391 length = len(val2.vertices)
00392 buff.write(_struct_I.pack(length))
00393 for val3 in val2.vertices:
00394 _x = val3
00395 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00396 length = len(val1.poses)
00397 buff.write(_struct_I.pack(length))
00398 for val2 in val1.poses:
00399 _v7 = val2.position
00400 _x = _v7
00401 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00402 _v8 = val2.orientation
00403 _x = _v8
00404 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00405 length = len(self.attached_collision_objects)
00406 buff.write(_struct_I.pack(length))
00407 for val1 in self.attached_collision_objects:
00408 _x = val1.link_name
00409 length = len(_x)
00410 buff.write(struct.pack('<I%ss'%length, length, _x))
00411 _v9 = val1.object
00412 _v10 = _v9.header
00413 buff.write(_struct_I.pack(_v10.seq))
00414 _v11 = _v10.stamp
00415 _x = _v11
00416 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00417 _x = _v10.frame_id
00418 length = len(_x)
00419 buff.write(struct.pack('<I%ss'%length, length, _x))
00420 _x = _v9.id
00421 length = len(_x)
00422 buff.write(struct.pack('<I%ss'%length, length, _x))
00423 _v12 = _v9.operation
00424 buff.write(_struct_b.pack(_v12.operation))
00425 length = len(_v9.shapes)
00426 buff.write(_struct_I.pack(length))
00427 for val3 in _v9.shapes:
00428 buff.write(_struct_b.pack(val3.type))
00429 length = len(val3.dimensions)
00430 buff.write(_struct_I.pack(length))
00431 pattern = '<%sd'%length
00432 buff.write(struct.pack(pattern, *val3.dimensions))
00433 length = len(val3.triangles)
00434 buff.write(_struct_I.pack(length))
00435 pattern = '<%si'%length
00436 buff.write(struct.pack(pattern, *val3.triangles))
00437 length = len(val3.vertices)
00438 buff.write(_struct_I.pack(length))
00439 for val4 in val3.vertices:
00440 _x = val4
00441 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00442 length = len(_v9.poses)
00443 buff.write(_struct_I.pack(length))
00444 for val3 in _v9.poses:
00445 _v13 = val3.position
00446 _x = _v13
00447 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00448 _v14 = val3.orientation
00449 _x = _v14
00450 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00451 length = len(val1.touch_links)
00452 buff.write(_struct_I.pack(length))
00453 for val2 in val1.touch_links:
00454 length = len(val2)
00455 buff.write(struct.pack('<I%ss'%length, length, val2))
00456 except struct.error, se: self._check_types(se)
00457 except TypeError, te: self._check_types(te)
00458
00459 def deserialize(self, str):
00460 """
00461 unpack serialized message in str into this message instance
00462 @param str: byte array of serialized message
00463 @type str: str
00464 """
00465 try:
00466 if self.points is None:
00467 self.points = mapping_msgs.msg.CollisionMap()
00468 end = 0
00469 _x = self
00470 start = end
00471 end += 12
00472 (_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00473 start = end
00474 end += 4
00475 (length,) = _struct_I.unpack(str[start:end])
00476 start = end
00477 end += length
00478 self.points.header.frame_id = str[start:end]
00479 start = end
00480 end += 4
00481 (length,) = _struct_I.unpack(str[start:end])
00482 self.points.boxes = []
00483 for i in xrange(0, length):
00484 val1 = mapping_msgs.msg.OrientedBoundingBox()
00485 _v15 = val1.center
00486 _x = _v15
00487 start = end
00488 end += 12
00489 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00490 _v16 = val1.extents
00491 _x = _v16
00492 start = end
00493 end += 12
00494 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00495 _v17 = val1.axis
00496 _x = _v17
00497 start = end
00498 end += 12
00499 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00500 start = end
00501 end += 4
00502 (val1.angle,) = _struct_f.unpack(str[start:end])
00503 self.points.boxes.append(val1)
00504 start = end
00505 end += 4
00506 (length,) = _struct_I.unpack(str[start:end])
00507 self.collision_objects = []
00508 for i in xrange(0, length):
00509 val1 = mapping_msgs.msg.CollisionObject()
00510 _v18 = val1.header
00511 start = end
00512 end += 4
00513 (_v18.seq,) = _struct_I.unpack(str[start:end])
00514 _v19 = _v18.stamp
00515 _x = _v19
00516 start = end
00517 end += 8
00518 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00519 start = end
00520 end += 4
00521 (length,) = _struct_I.unpack(str[start:end])
00522 start = end
00523 end += length
00524 _v18.frame_id = str[start:end]
00525 start = end
00526 end += 4
00527 (length,) = _struct_I.unpack(str[start:end])
00528 start = end
00529 end += length
00530 val1.id = str[start:end]
00531 _v20 = val1.operation
00532 start = end
00533 end += 1
00534 (_v20.operation,) = _struct_b.unpack(str[start:end])
00535 start = end
00536 end += 4
00537 (length,) = _struct_I.unpack(str[start:end])
00538 val1.shapes = []
00539 for i in xrange(0, length):
00540 val2 = geometric_shapes_msgs.msg.Shape()
00541 start = end
00542 end += 1
00543 (val2.type,) = _struct_b.unpack(str[start:end])
00544 start = end
00545 end += 4
00546 (length,) = _struct_I.unpack(str[start:end])
00547 pattern = '<%sd'%length
00548 start = end
00549 end += struct.calcsize(pattern)
00550 val2.dimensions = struct.unpack(pattern, str[start:end])
00551 start = end
00552 end += 4
00553 (length,) = _struct_I.unpack(str[start:end])
00554 pattern = '<%si'%length
00555 start = end
00556 end += struct.calcsize(pattern)
00557 val2.triangles = struct.unpack(pattern, str[start:end])
00558 start = end
00559 end += 4
00560 (length,) = _struct_I.unpack(str[start:end])
00561 val2.vertices = []
00562 for i in xrange(0, length):
00563 val3 = geometry_msgs.msg.Point()
00564 _x = val3
00565 start = end
00566 end += 24
00567 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00568 val2.vertices.append(val3)
00569 val1.shapes.append(val2)
00570 start = end
00571 end += 4
00572 (length,) = _struct_I.unpack(str[start:end])
00573 val1.poses = []
00574 for i in xrange(0, length):
00575 val2 = geometry_msgs.msg.Pose()
00576 _v21 = val2.position
00577 _x = _v21
00578 start = end
00579 end += 24
00580 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00581 _v22 = val2.orientation
00582 _x = _v22
00583 start = end
00584 end += 32
00585 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00586 val1.poses.append(val2)
00587 self.collision_objects.append(val1)
00588 start = end
00589 end += 4
00590 (length,) = _struct_I.unpack(str[start:end])
00591 self.attached_collision_objects = []
00592 for i in xrange(0, length):
00593 val1 = mapping_msgs.msg.AttachedCollisionObject()
00594 start = end
00595 end += 4
00596 (length,) = _struct_I.unpack(str[start:end])
00597 start = end
00598 end += length
00599 val1.link_name = str[start:end]
00600 _v23 = val1.object
00601 _v24 = _v23.header
00602 start = end
00603 end += 4
00604 (_v24.seq,) = _struct_I.unpack(str[start:end])
00605 _v25 = _v24.stamp
00606 _x = _v25
00607 start = end
00608 end += 8
00609 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00610 start = end
00611 end += 4
00612 (length,) = _struct_I.unpack(str[start:end])
00613 start = end
00614 end += length
00615 _v24.frame_id = str[start:end]
00616 start = end
00617 end += 4
00618 (length,) = _struct_I.unpack(str[start:end])
00619 start = end
00620 end += length
00621 _v23.id = str[start:end]
00622 _v26 = _v23.operation
00623 start = end
00624 end += 1
00625 (_v26.operation,) = _struct_b.unpack(str[start:end])
00626 start = end
00627 end += 4
00628 (length,) = _struct_I.unpack(str[start:end])
00629 _v23.shapes = []
00630 for i in xrange(0, length):
00631 val3 = geometric_shapes_msgs.msg.Shape()
00632 start = end
00633 end += 1
00634 (val3.type,) = _struct_b.unpack(str[start:end])
00635 start = end
00636 end += 4
00637 (length,) = _struct_I.unpack(str[start:end])
00638 pattern = '<%sd'%length
00639 start = end
00640 end += struct.calcsize(pattern)
00641 val3.dimensions = struct.unpack(pattern, str[start:end])
00642 start = end
00643 end += 4
00644 (length,) = _struct_I.unpack(str[start:end])
00645 pattern = '<%si'%length
00646 start = end
00647 end += struct.calcsize(pattern)
00648 val3.triangles = struct.unpack(pattern, str[start:end])
00649 start = end
00650 end += 4
00651 (length,) = _struct_I.unpack(str[start:end])
00652 val3.vertices = []
00653 for i in xrange(0, length):
00654 val4 = geometry_msgs.msg.Point()
00655 _x = val4
00656 start = end
00657 end += 24
00658 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00659 val3.vertices.append(val4)
00660 _v23.shapes.append(val3)
00661 start = end
00662 end += 4
00663 (length,) = _struct_I.unpack(str[start:end])
00664 _v23.poses = []
00665 for i in xrange(0, length):
00666 val3 = geometry_msgs.msg.Pose()
00667 _v27 = val3.position
00668 _x = _v27
00669 start = end
00670 end += 24
00671 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00672 _v28 = val3.orientation
00673 _x = _v28
00674 start = end
00675 end += 32
00676 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00677 _v23.poses.append(val3)
00678 start = end
00679 end += 4
00680 (length,) = _struct_I.unpack(str[start:end])
00681 val1.touch_links = []
00682 for i in xrange(0, length):
00683 start = end
00684 end += 4
00685 (length,) = _struct_I.unpack(str[start:end])
00686 start = end
00687 end += length
00688 val2 = str[start:end]
00689 val1.touch_links.append(val2)
00690 self.attached_collision_objects.append(val1)
00691 return self
00692 except struct.error, e:
00693 raise roslib.message.DeserializationError(e)
00694
00695
00696 def serialize_numpy(self, buff, numpy):
00697 """
00698 serialize message with numpy array types into buffer
00699 @param buff: buffer
00700 @type buff: StringIO
00701 @param numpy: numpy python module
00702 @type numpy module
00703 """
00704 try:
00705 _x = self
00706 buff.write(_struct_3I.pack(_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs))
00707 _x = self.points.header.frame_id
00708 length = len(_x)
00709 buff.write(struct.pack('<I%ss'%length, length, _x))
00710 length = len(self.points.boxes)
00711 buff.write(_struct_I.pack(length))
00712 for val1 in self.points.boxes:
00713 _v29 = val1.center
00714 _x = _v29
00715 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00716 _v30 = val1.extents
00717 _x = _v30
00718 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00719 _v31 = val1.axis
00720 _x = _v31
00721 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00722 buff.write(_struct_f.pack(val1.angle))
00723 length = len(self.collision_objects)
00724 buff.write(_struct_I.pack(length))
00725 for val1 in self.collision_objects:
00726 _v32 = val1.header
00727 buff.write(_struct_I.pack(_v32.seq))
00728 _v33 = _v32.stamp
00729 _x = _v33
00730 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00731 _x = _v32.frame_id
00732 length = len(_x)
00733 buff.write(struct.pack('<I%ss'%length, length, _x))
00734 _x = val1.id
00735 length = len(_x)
00736 buff.write(struct.pack('<I%ss'%length, length, _x))
00737 _v34 = val1.operation
00738 buff.write(_struct_b.pack(_v34.operation))
00739 length = len(val1.shapes)
00740 buff.write(_struct_I.pack(length))
00741 for val2 in val1.shapes:
00742 buff.write(_struct_b.pack(val2.type))
00743 length = len(val2.dimensions)
00744 buff.write(_struct_I.pack(length))
00745 pattern = '<%sd'%length
00746 buff.write(val2.dimensions.tostring())
00747 length = len(val2.triangles)
00748 buff.write(_struct_I.pack(length))
00749 pattern = '<%si'%length
00750 buff.write(val2.triangles.tostring())
00751 length = len(val2.vertices)
00752 buff.write(_struct_I.pack(length))
00753 for val3 in val2.vertices:
00754 _x = val3
00755 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00756 length = len(val1.poses)
00757 buff.write(_struct_I.pack(length))
00758 for val2 in val1.poses:
00759 _v35 = val2.position
00760 _x = _v35
00761 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00762 _v36 = val2.orientation
00763 _x = _v36
00764 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00765 length = len(self.attached_collision_objects)
00766 buff.write(_struct_I.pack(length))
00767 for val1 in self.attached_collision_objects:
00768 _x = val1.link_name
00769 length = len(_x)
00770 buff.write(struct.pack('<I%ss'%length, length, _x))
00771 _v37 = val1.object
00772 _v38 = _v37.header
00773 buff.write(_struct_I.pack(_v38.seq))
00774 _v39 = _v38.stamp
00775 _x = _v39
00776 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00777 _x = _v38.frame_id
00778 length = len(_x)
00779 buff.write(struct.pack('<I%ss'%length, length, _x))
00780 _x = _v37.id
00781 length = len(_x)
00782 buff.write(struct.pack('<I%ss'%length, length, _x))
00783 _v40 = _v37.operation
00784 buff.write(_struct_b.pack(_v40.operation))
00785 length = len(_v37.shapes)
00786 buff.write(_struct_I.pack(length))
00787 for val3 in _v37.shapes:
00788 buff.write(_struct_b.pack(val3.type))
00789 length = len(val3.dimensions)
00790 buff.write(_struct_I.pack(length))
00791 pattern = '<%sd'%length
00792 buff.write(val3.dimensions.tostring())
00793 length = len(val3.triangles)
00794 buff.write(_struct_I.pack(length))
00795 pattern = '<%si'%length
00796 buff.write(val3.triangles.tostring())
00797 length = len(val3.vertices)
00798 buff.write(_struct_I.pack(length))
00799 for val4 in val3.vertices:
00800 _x = val4
00801 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00802 length = len(_v37.poses)
00803 buff.write(_struct_I.pack(length))
00804 for val3 in _v37.poses:
00805 _v41 = val3.position
00806 _x = _v41
00807 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00808 _v42 = val3.orientation
00809 _x = _v42
00810 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00811 length = len(val1.touch_links)
00812 buff.write(_struct_I.pack(length))
00813 for val2 in val1.touch_links:
00814 length = len(val2)
00815 buff.write(struct.pack('<I%ss'%length, length, val2))
00816 except struct.error, se: self._check_types(se)
00817 except TypeError, te: self._check_types(te)
00818
00819 def deserialize_numpy(self, str, numpy):
00820 """
00821 unpack serialized message in str into this message instance using numpy for array types
00822 @param str: byte array of serialized message
00823 @type str: str
00824 @param numpy: numpy python module
00825 @type numpy: module
00826 """
00827 try:
00828 if self.points is None:
00829 self.points = mapping_msgs.msg.CollisionMap()
00830 end = 0
00831 _x = self
00832 start = end
00833 end += 12
00834 (_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00835 start = end
00836 end += 4
00837 (length,) = _struct_I.unpack(str[start:end])
00838 start = end
00839 end += length
00840 self.points.header.frame_id = str[start:end]
00841 start = end
00842 end += 4
00843 (length,) = _struct_I.unpack(str[start:end])
00844 self.points.boxes = []
00845 for i in xrange(0, length):
00846 val1 = mapping_msgs.msg.OrientedBoundingBox()
00847 _v43 = val1.center
00848 _x = _v43
00849 start = end
00850 end += 12
00851 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00852 _v44 = val1.extents
00853 _x = _v44
00854 start = end
00855 end += 12
00856 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00857 _v45 = val1.axis
00858 _x = _v45
00859 start = end
00860 end += 12
00861 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00862 start = end
00863 end += 4
00864 (val1.angle,) = _struct_f.unpack(str[start:end])
00865 self.points.boxes.append(val1)
00866 start = end
00867 end += 4
00868 (length,) = _struct_I.unpack(str[start:end])
00869 self.collision_objects = []
00870 for i in xrange(0, length):
00871 val1 = mapping_msgs.msg.CollisionObject()
00872 _v46 = val1.header
00873 start = end
00874 end += 4
00875 (_v46.seq,) = _struct_I.unpack(str[start:end])
00876 _v47 = _v46.stamp
00877 _x = _v47
00878 start = end
00879 end += 8
00880 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00881 start = end
00882 end += 4
00883 (length,) = _struct_I.unpack(str[start:end])
00884 start = end
00885 end += length
00886 _v46.frame_id = str[start:end]
00887 start = end
00888 end += 4
00889 (length,) = _struct_I.unpack(str[start:end])
00890 start = end
00891 end += length
00892 val1.id = str[start:end]
00893 _v48 = val1.operation
00894 start = end
00895 end += 1
00896 (_v48.operation,) = _struct_b.unpack(str[start:end])
00897 start = end
00898 end += 4
00899 (length,) = _struct_I.unpack(str[start:end])
00900 val1.shapes = []
00901 for i in xrange(0, length):
00902 val2 = geometric_shapes_msgs.msg.Shape()
00903 start = end
00904 end += 1
00905 (val2.type,) = _struct_b.unpack(str[start:end])
00906 start = end
00907 end += 4
00908 (length,) = _struct_I.unpack(str[start:end])
00909 pattern = '<%sd'%length
00910 start = end
00911 end += struct.calcsize(pattern)
00912 val2.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00913 start = end
00914 end += 4
00915 (length,) = _struct_I.unpack(str[start:end])
00916 pattern = '<%si'%length
00917 start = end
00918 end += struct.calcsize(pattern)
00919 val2.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00920 start = end
00921 end += 4
00922 (length,) = _struct_I.unpack(str[start:end])
00923 val2.vertices = []
00924 for i in xrange(0, length):
00925 val3 = geometry_msgs.msg.Point()
00926 _x = val3
00927 start = end
00928 end += 24
00929 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00930 val2.vertices.append(val3)
00931 val1.shapes.append(val2)
00932 start = end
00933 end += 4
00934 (length,) = _struct_I.unpack(str[start:end])
00935 val1.poses = []
00936 for i in xrange(0, length):
00937 val2 = geometry_msgs.msg.Pose()
00938 _v49 = val2.position
00939 _x = _v49
00940 start = end
00941 end += 24
00942 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00943 _v50 = val2.orientation
00944 _x = _v50
00945 start = end
00946 end += 32
00947 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00948 val1.poses.append(val2)
00949 self.collision_objects.append(val1)
00950 start = end
00951 end += 4
00952 (length,) = _struct_I.unpack(str[start:end])
00953 self.attached_collision_objects = []
00954 for i in xrange(0, length):
00955 val1 = mapping_msgs.msg.AttachedCollisionObject()
00956 start = end
00957 end += 4
00958 (length,) = _struct_I.unpack(str[start:end])
00959 start = end
00960 end += length
00961 val1.link_name = str[start:end]
00962 _v51 = val1.object
00963 _v52 = _v51.header
00964 start = end
00965 end += 4
00966 (_v52.seq,) = _struct_I.unpack(str[start:end])
00967 _v53 = _v52.stamp
00968 _x = _v53
00969 start = end
00970 end += 8
00971 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00972 start = end
00973 end += 4
00974 (length,) = _struct_I.unpack(str[start:end])
00975 start = end
00976 end += length
00977 _v52.frame_id = str[start:end]
00978 start = end
00979 end += 4
00980 (length,) = _struct_I.unpack(str[start:end])
00981 start = end
00982 end += length
00983 _v51.id = str[start:end]
00984 _v54 = _v51.operation
00985 start = end
00986 end += 1
00987 (_v54.operation,) = _struct_b.unpack(str[start:end])
00988 start = end
00989 end += 4
00990 (length,) = _struct_I.unpack(str[start:end])
00991 _v51.shapes = []
00992 for i in xrange(0, length):
00993 val3 = geometric_shapes_msgs.msg.Shape()
00994 start = end
00995 end += 1
00996 (val3.type,) = _struct_b.unpack(str[start:end])
00997 start = end
00998 end += 4
00999 (length,) = _struct_I.unpack(str[start:end])
01000 pattern = '<%sd'%length
01001 start = end
01002 end += struct.calcsize(pattern)
01003 val3.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
01004 start = end
01005 end += 4
01006 (length,) = _struct_I.unpack(str[start:end])
01007 pattern = '<%si'%length
01008 start = end
01009 end += struct.calcsize(pattern)
01010 val3.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
01011 start = end
01012 end += 4
01013 (length,) = _struct_I.unpack(str[start:end])
01014 val3.vertices = []
01015 for i in xrange(0, length):
01016 val4 = geometry_msgs.msg.Point()
01017 _x = val4
01018 start = end
01019 end += 24
01020 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01021 val3.vertices.append(val4)
01022 _v51.shapes.append(val3)
01023 start = end
01024 end += 4
01025 (length,) = _struct_I.unpack(str[start:end])
01026 _v51.poses = []
01027 for i in xrange(0, length):
01028 val3 = geometry_msgs.msg.Pose()
01029 _v55 = val3.position
01030 _x = _v55
01031 start = end
01032 end += 24
01033 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01034 _v56 = val3.orientation
01035 _x = _v56
01036 start = end
01037 end += 32
01038 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01039 _v51.poses.append(val3)
01040 start = end
01041 end += 4
01042 (length,) = _struct_I.unpack(str[start:end])
01043 val1.touch_links = []
01044 for i in xrange(0, length):
01045 start = end
01046 end += 4
01047 (length,) = _struct_I.unpack(str[start:end])
01048 start = end
01049 end += length
01050 val2 = str[start:end]
01051 val1.touch_links.append(val2)
01052 self.attached_collision_objects.append(val1)
01053 return self
01054 except struct.error, e:
01055 raise roslib.message.DeserializationError(e)
01056
01057 _struct_I = roslib.message.struct_I
01058 _struct_b = struct.Struct("<b")
01059 _struct_f = struct.Struct("<f")
01060 _struct_2I = struct.Struct("<2I")
01061 _struct_3I = struct.Struct("<3I")
01062 _struct_4d = struct.Struct("<4d")
01063 _struct_3f = struct.Struct("<3f")
01064 _struct_3d = struct.Struct("<3d")
01065 class GetCollisionObjects(roslib.message.ServiceDefinition):
01066 _type = 'planning_environment_msgs/GetCollisionObjects'
01067 _md5sum = '52e374308dcfa795e0a319af5ada16c0'
01068 _request_class = GetCollisionObjectsRequest
01069 _response_class = GetCollisionObjectsResponse