00001 """autogenerated by genpy from vision_srvs/cop_add_collisionRequest.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 cop_add_collisionRequest(genpy.Message):
00009 _md5sum = "039cdc2e4e021929b349f87d86d0ea70"
00010 _type = "vision_srvs/cop_add_collisionRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014 uint64 object_id
00015
00016 """
00017 __slots__ = ['object_id']
00018 _slot_types = ['uint64']
00019
00020 def __init__(self, *args, **kwds):
00021 """
00022 Constructor. Any message fields that are implicitly/explicitly
00023 set to None will be assigned a default value. The recommend
00024 use is keyword arguments as this is more robust to future message
00025 changes. You cannot mix in-order arguments and keyword arguments.
00026
00027 The available fields are:
00028 object_id
00029
00030 :param args: complete set of field values, in .msg order
00031 :param kwds: use keyword arguments corresponding to message field names
00032 to set specific fields.
00033 """
00034 if args or kwds:
00035 super(cop_add_collisionRequest, self).__init__(*args, **kwds)
00036
00037 if self.object_id is None:
00038 self.object_id = 0
00039 else:
00040 self.object_id = 0
00041
00042 def _get_types(self):
00043 """
00044 internal API method
00045 """
00046 return self._slot_types
00047
00048 def serialize(self, buff):
00049 """
00050 serialize message into buffer
00051 :param buff: buffer, ``StringIO``
00052 """
00053 try:
00054 buff.write(_struct_Q.pack(self.object_id))
00055 except struct.error as se: self._check_types(se)
00056 except TypeError as 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, ``str``
00062 """
00063 try:
00064 end = 0
00065 start = end
00066 end += 8
00067 (self.object_id,) = _struct_Q.unpack(str[start:end])
00068 return self
00069 except struct.error as e:
00070 raise genpy.DeserializationError(e)
00071
00072
00073 def serialize_numpy(self, buff, numpy):
00074 """
00075 serialize message with numpy array types into buffer
00076 :param buff: buffer, ``StringIO``
00077 :param numpy: numpy python module
00078 """
00079 try:
00080 buff.write(_struct_Q.pack(self.object_id))
00081 except struct.error as se: self._check_types(se)
00082 except TypeError as te: self._check_types(te)
00083
00084 def deserialize_numpy(self, str, numpy):
00085 """
00086 unpack serialized message in str into this message instance using numpy for array types
00087 :param str: byte array of serialized message, ``str``
00088 :param numpy: numpy python module
00089 """
00090 try:
00091 end = 0
00092 start = end
00093 end += 8
00094 (self.object_id,) = _struct_Q.unpack(str[start:end])
00095 return self
00096 except struct.error as e:
00097 raise genpy.DeserializationError(e)
00098
00099 _struct_I = genpy.struct_I
00100 _struct_Q = struct.Struct("<Q")
00101 """autogenerated by genpy from vision_srvs/cop_add_collisionResponse.msg. Do not edit."""
00102 import sys
00103 python3 = True if sys.hexversion > 0x03000000 else False
00104 import genpy
00105 import struct
00106
00107 import arm_navigation_msgs.msg
00108 import geometry_msgs.msg
00109 import std_msgs.msg
00110
00111 class cop_add_collisionResponse(genpy.Message):
00112 _md5sum = "66d3c9bb4e74eca84445fb8e469ca2cb"
00113 _type = "vision_srvs/cop_add_collisionResponse"
00114 _has_header = False
00115 _full_text = """string collisionname
00116 arm_navigation_msgs/CollisionObject added_object
00117
00118
00119 ================================================================================
00120 MSG: arm_navigation_msgs/CollisionObject
00121 # a header, used for interpreting the poses
00122 Header header
00123
00124 # the id of the object
00125 string id
00126
00127 # The padding used for filtering points near the object.
00128 # This does not affect collision checking for the object.
00129 # Set to negative to get zero padding.
00130 float32 padding
00131
00132 #This contains what is to be done with the object
00133 CollisionObjectOperation operation
00134
00135 #the shapes associated with the object
00136 arm_navigation_msgs/Shape[] shapes
00137
00138 #the poses associated with the shapes - will be transformed using the header
00139 geometry_msgs/Pose[] poses
00140
00141 ================================================================================
00142 MSG: std_msgs/Header
00143 # Standard metadata for higher-level stamped data types.
00144 # This is generally used to communicate timestamped data
00145 # in a particular coordinate frame.
00146 #
00147 # sequence ID: consecutively increasing ID
00148 uint32 seq
00149 #Two-integer timestamp that is expressed as:
00150 # * stamp.secs: seconds (stamp_secs) since epoch
00151 # * stamp.nsecs: nanoseconds since stamp_secs
00152 # time-handling sugar is provided by the client library
00153 time stamp
00154 #Frame this data is associated with
00155 # 0: no frame
00156 # 1: global frame
00157 string frame_id
00158
00159 ================================================================================
00160 MSG: arm_navigation_msgs/CollisionObjectOperation
00161 #Puts the object into the environment
00162 #or updates the object if already added
00163 byte ADD=0
00164
00165 #Removes the object from the environment entirely
00166 byte REMOVE=1
00167
00168 #Only valid within the context of a CollisionAttachedObject message
00169 #Will be ignored if sent with an CollisionObject message
00170 #Takes an attached object, detaches from the attached link
00171 #But adds back in as regular object
00172 byte DETACH_AND_ADD_AS_OBJECT=2
00173
00174 #Only valid within the context of a CollisionAttachedObject message
00175 #Will be ignored if sent with an CollisionObject message
00176 #Takes current object in the environment and removes it as
00177 #a regular object
00178 byte ATTACH_AND_REMOVE_AS_OBJECT=3
00179
00180 # Byte code for operation
00181 byte operation
00182
00183 ================================================================================
00184 MSG: arm_navigation_msgs/Shape
00185 byte SPHERE=0
00186 byte BOX=1
00187 byte CYLINDER=2
00188 byte MESH=3
00189
00190 byte type
00191
00192
00193 #### define sphere, box, cylinder ####
00194 # the origin of each shape is considered at the shape's center
00195
00196 # for sphere
00197 # radius := dimensions[0]
00198
00199 # for cylinder
00200 # radius := dimensions[0]
00201 # length := dimensions[1]
00202 # the length is along the Z axis
00203
00204 # for box
00205 # size_x := dimensions[0]
00206 # size_y := dimensions[1]
00207 # size_z := dimensions[2]
00208 float64[] dimensions
00209
00210
00211 #### define mesh ####
00212
00213 # list of triangles; triangle k is defined by tre vertices located
00214 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00215 int32[] triangles
00216 geometry_msgs/Point[] vertices
00217
00218 ================================================================================
00219 MSG: geometry_msgs/Point
00220 # This contains the position of a point in free space
00221 float64 x
00222 float64 y
00223 float64 z
00224
00225 ================================================================================
00226 MSG: geometry_msgs/Pose
00227 # A representation of pose in free space, composed of postion and orientation.
00228 Point position
00229 Quaternion orientation
00230
00231 ================================================================================
00232 MSG: geometry_msgs/Quaternion
00233 # This represents an orientation in free space in quaternion form.
00234
00235 float64 x
00236 float64 y
00237 float64 z
00238 float64 w
00239
00240 """
00241 __slots__ = ['collisionname','added_object']
00242 _slot_types = ['string','arm_navigation_msgs/CollisionObject']
00243
00244 def __init__(self, *args, **kwds):
00245 """
00246 Constructor. Any message fields that are implicitly/explicitly
00247 set to None will be assigned a default value. The recommend
00248 use is keyword arguments as this is more robust to future message
00249 changes. You cannot mix in-order arguments and keyword arguments.
00250
00251 The available fields are:
00252 collisionname,added_object
00253
00254 :param args: complete set of field values, in .msg order
00255 :param kwds: use keyword arguments corresponding to message field names
00256 to set specific fields.
00257 """
00258 if args or kwds:
00259 super(cop_add_collisionResponse, self).__init__(*args, **kwds)
00260
00261 if self.collisionname is None:
00262 self.collisionname = ''
00263 if self.added_object is None:
00264 self.added_object = arm_navigation_msgs.msg.CollisionObject()
00265 else:
00266 self.collisionname = ''
00267 self.added_object = arm_navigation_msgs.msg.CollisionObject()
00268
00269 def _get_types(self):
00270 """
00271 internal API method
00272 """
00273 return self._slot_types
00274
00275 def serialize(self, buff):
00276 """
00277 serialize message into buffer
00278 :param buff: buffer, ``StringIO``
00279 """
00280 try:
00281 _x = self.collisionname
00282 length = len(_x)
00283 if python3 or type(_x) == unicode:
00284 _x = _x.encode('utf-8')
00285 length = len(_x)
00286 buff.write(struct.pack('<I%ss'%length, length, _x))
00287 _x = self
00288 buff.write(_struct_3I.pack(_x.added_object.header.seq, _x.added_object.header.stamp.secs, _x.added_object.header.stamp.nsecs))
00289 _x = self.added_object.header.frame_id
00290 length = len(_x)
00291 if python3 or type(_x) == unicode:
00292 _x = _x.encode('utf-8')
00293 length = len(_x)
00294 buff.write(struct.pack('<I%ss'%length, length, _x))
00295 _x = self.added_object.id
00296 length = len(_x)
00297 if python3 or type(_x) == unicode:
00298 _x = _x.encode('utf-8')
00299 length = len(_x)
00300 buff.write(struct.pack('<I%ss'%length, length, _x))
00301 _x = self
00302 buff.write(_struct_fb.pack(_x.added_object.padding, _x.added_object.operation.operation))
00303 length = len(self.added_object.shapes)
00304 buff.write(_struct_I.pack(length))
00305 for val1 in self.added_object.shapes:
00306 buff.write(_struct_b.pack(val1.type))
00307 length = len(val1.dimensions)
00308 buff.write(_struct_I.pack(length))
00309 pattern = '<%sd'%length
00310 buff.write(struct.pack(pattern, *val1.dimensions))
00311 length = len(val1.triangles)
00312 buff.write(_struct_I.pack(length))
00313 pattern = '<%si'%length
00314 buff.write(struct.pack(pattern, *val1.triangles))
00315 length = len(val1.vertices)
00316 buff.write(_struct_I.pack(length))
00317 for val2 in val1.vertices:
00318 _x = val2
00319 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00320 length = len(self.added_object.poses)
00321 buff.write(_struct_I.pack(length))
00322 for val1 in self.added_object.poses:
00323 _v1 = val1.position
00324 _x = _v1
00325 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00326 _v2 = val1.orientation
00327 _x = _v2
00328 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00329 except struct.error as se: self._check_types(se)
00330 except TypeError as te: self._check_types(te)
00331
00332 def deserialize(self, str):
00333 """
00334 unpack serialized message in str into this message instance
00335 :param str: byte array of serialized message, ``str``
00336 """
00337 try:
00338 if self.added_object is None:
00339 self.added_object = arm_navigation_msgs.msg.CollisionObject()
00340 end = 0
00341 start = end
00342 end += 4
00343 (length,) = _struct_I.unpack(str[start:end])
00344 start = end
00345 end += length
00346 if python3:
00347 self.collisionname = str[start:end].decode('utf-8')
00348 else:
00349 self.collisionname = str[start:end]
00350 _x = self
00351 start = end
00352 end += 12
00353 (_x.added_object.header.seq, _x.added_object.header.stamp.secs, _x.added_object.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00354 start = end
00355 end += 4
00356 (length,) = _struct_I.unpack(str[start:end])
00357 start = end
00358 end += length
00359 if python3:
00360 self.added_object.header.frame_id = str[start:end].decode('utf-8')
00361 else:
00362 self.added_object.header.frame_id = str[start:end]
00363 start = end
00364 end += 4
00365 (length,) = _struct_I.unpack(str[start:end])
00366 start = end
00367 end += length
00368 if python3:
00369 self.added_object.id = str[start:end].decode('utf-8')
00370 else:
00371 self.added_object.id = str[start:end]
00372 _x = self
00373 start = end
00374 end += 5
00375 (_x.added_object.padding, _x.added_object.operation.operation,) = _struct_fb.unpack(str[start:end])
00376 start = end
00377 end += 4
00378 (length,) = _struct_I.unpack(str[start:end])
00379 self.added_object.shapes = []
00380 for i in range(0, length):
00381 val1 = arm_navigation_msgs.msg.Shape()
00382 start = end
00383 end += 1
00384 (val1.type,) = _struct_b.unpack(str[start:end])
00385 start = end
00386 end += 4
00387 (length,) = _struct_I.unpack(str[start:end])
00388 pattern = '<%sd'%length
00389 start = end
00390 end += struct.calcsize(pattern)
00391 val1.dimensions = struct.unpack(pattern, str[start:end])
00392 start = end
00393 end += 4
00394 (length,) = _struct_I.unpack(str[start:end])
00395 pattern = '<%si'%length
00396 start = end
00397 end += struct.calcsize(pattern)
00398 val1.triangles = struct.unpack(pattern, str[start:end])
00399 start = end
00400 end += 4
00401 (length,) = _struct_I.unpack(str[start:end])
00402 val1.vertices = []
00403 for i in range(0, length):
00404 val2 = geometry_msgs.msg.Point()
00405 _x = val2
00406 start = end
00407 end += 24
00408 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00409 val1.vertices.append(val2)
00410 self.added_object.shapes.append(val1)
00411 start = end
00412 end += 4
00413 (length,) = _struct_I.unpack(str[start:end])
00414 self.added_object.poses = []
00415 for i in range(0, length):
00416 val1 = geometry_msgs.msg.Pose()
00417 _v3 = val1.position
00418 _x = _v3
00419 start = end
00420 end += 24
00421 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00422 _v4 = val1.orientation
00423 _x = _v4
00424 start = end
00425 end += 32
00426 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00427 self.added_object.poses.append(val1)
00428 return self
00429 except struct.error as e:
00430 raise genpy.DeserializationError(e)
00431
00432
00433 def serialize_numpy(self, buff, numpy):
00434 """
00435 serialize message with numpy array types into buffer
00436 :param buff: buffer, ``StringIO``
00437 :param numpy: numpy python module
00438 """
00439 try:
00440 _x = self.collisionname
00441 length = len(_x)
00442 if python3 or type(_x) == unicode:
00443 _x = _x.encode('utf-8')
00444 length = len(_x)
00445 buff.write(struct.pack('<I%ss'%length, length, _x))
00446 _x = self
00447 buff.write(_struct_3I.pack(_x.added_object.header.seq, _x.added_object.header.stamp.secs, _x.added_object.header.stamp.nsecs))
00448 _x = self.added_object.header.frame_id
00449 length = len(_x)
00450 if python3 or type(_x) == unicode:
00451 _x = _x.encode('utf-8')
00452 length = len(_x)
00453 buff.write(struct.pack('<I%ss'%length, length, _x))
00454 _x = self.added_object.id
00455 length = len(_x)
00456 if python3 or type(_x) == unicode:
00457 _x = _x.encode('utf-8')
00458 length = len(_x)
00459 buff.write(struct.pack('<I%ss'%length, length, _x))
00460 _x = self
00461 buff.write(_struct_fb.pack(_x.added_object.padding, _x.added_object.operation.operation))
00462 length = len(self.added_object.shapes)
00463 buff.write(_struct_I.pack(length))
00464 for val1 in self.added_object.shapes:
00465 buff.write(_struct_b.pack(val1.type))
00466 length = len(val1.dimensions)
00467 buff.write(_struct_I.pack(length))
00468 pattern = '<%sd'%length
00469 buff.write(val1.dimensions.tostring())
00470 length = len(val1.triangles)
00471 buff.write(_struct_I.pack(length))
00472 pattern = '<%si'%length
00473 buff.write(val1.triangles.tostring())
00474 length = len(val1.vertices)
00475 buff.write(_struct_I.pack(length))
00476 for val2 in val1.vertices:
00477 _x = val2
00478 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00479 length = len(self.added_object.poses)
00480 buff.write(_struct_I.pack(length))
00481 for val1 in self.added_object.poses:
00482 _v5 = val1.position
00483 _x = _v5
00484 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00485 _v6 = val1.orientation
00486 _x = _v6
00487 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00488 except struct.error as se: self._check_types(se)
00489 except TypeError as te: self._check_types(te)
00490
00491 def deserialize_numpy(self, str, numpy):
00492 """
00493 unpack serialized message in str into this message instance using numpy for array types
00494 :param str: byte array of serialized message, ``str``
00495 :param numpy: numpy python module
00496 """
00497 try:
00498 if self.added_object is None:
00499 self.added_object = arm_navigation_msgs.msg.CollisionObject()
00500 end = 0
00501 start = end
00502 end += 4
00503 (length,) = _struct_I.unpack(str[start:end])
00504 start = end
00505 end += length
00506 if python3:
00507 self.collisionname = str[start:end].decode('utf-8')
00508 else:
00509 self.collisionname = str[start:end]
00510 _x = self
00511 start = end
00512 end += 12
00513 (_x.added_object.header.seq, _x.added_object.header.stamp.secs, _x.added_object.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00514 start = end
00515 end += 4
00516 (length,) = _struct_I.unpack(str[start:end])
00517 start = end
00518 end += length
00519 if python3:
00520 self.added_object.header.frame_id = str[start:end].decode('utf-8')
00521 else:
00522 self.added_object.header.frame_id = str[start:end]
00523 start = end
00524 end += 4
00525 (length,) = _struct_I.unpack(str[start:end])
00526 start = end
00527 end += length
00528 if python3:
00529 self.added_object.id = str[start:end].decode('utf-8')
00530 else:
00531 self.added_object.id = str[start:end]
00532 _x = self
00533 start = end
00534 end += 5
00535 (_x.added_object.padding, _x.added_object.operation.operation,) = _struct_fb.unpack(str[start:end])
00536 start = end
00537 end += 4
00538 (length,) = _struct_I.unpack(str[start:end])
00539 self.added_object.shapes = []
00540 for i in range(0, length):
00541 val1 = arm_navigation_msgs.msg.Shape()
00542 start = end
00543 end += 1
00544 (val1.type,) = _struct_b.unpack(str[start:end])
00545 start = end
00546 end += 4
00547 (length,) = _struct_I.unpack(str[start:end])
00548 pattern = '<%sd'%length
00549 start = end
00550 end += struct.calcsize(pattern)
00551 val1.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00552 start = end
00553 end += 4
00554 (length,) = _struct_I.unpack(str[start:end])
00555 pattern = '<%si'%length
00556 start = end
00557 end += struct.calcsize(pattern)
00558 val1.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00559 start = end
00560 end += 4
00561 (length,) = _struct_I.unpack(str[start:end])
00562 val1.vertices = []
00563 for i in range(0, length):
00564 val2 = geometry_msgs.msg.Point()
00565 _x = val2
00566 start = end
00567 end += 24
00568 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00569 val1.vertices.append(val2)
00570 self.added_object.shapes.append(val1)
00571 start = end
00572 end += 4
00573 (length,) = _struct_I.unpack(str[start:end])
00574 self.added_object.poses = []
00575 for i in range(0, length):
00576 val1 = geometry_msgs.msg.Pose()
00577 _v7 = val1.position
00578 _x = _v7
00579 start = end
00580 end += 24
00581 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00582 _v8 = val1.orientation
00583 _x = _v8
00584 start = end
00585 end += 32
00586 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00587 self.added_object.poses.append(val1)
00588 return self
00589 except struct.error as e:
00590 raise genpy.DeserializationError(e)
00591
00592 _struct_I = genpy.struct_I
00593 _struct_4d = struct.Struct("<4d")
00594 _struct_3I = struct.Struct("<3I")
00595 _struct_b = struct.Struct("<b")
00596 _struct_fb = struct.Struct("<fb")
00597 _struct_3d = struct.Struct("<3d")
00598 class cop_add_collision(object):
00599 _type = 'vision_srvs/cop_add_collision'
00600 _md5sum = '119055ba7d9102720f55afbcc4f26f14'
00601 _request_class = cop_add_collisionRequest
00602 _response_class = cop_add_collisionResponse