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