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