$search
00001 """autogenerated by genmsg_py from cop_callRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import vision_msgs.msg 00006 00007 class cop_callRequest(roslib.message.Message): 00008 _md5sum = "8159879f6a0c16d501638a9c44ad2860" 00009 _type = "vision_srvs/cop_callRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """ 00012 00013 uint64 LOCATE = 0 00014 uint64 TRACK = 16 00015 uint64 REFINE = 256 00016 uint64 STOPTRACK = 2048 00017 uint64 STARTATTENT = 4096 00018 uint64 STOPATTENT = 8192 00019 uint64 LOOKUP = 25600 00020 uint64 LOOKUPALL = 25601 00021 00022 string outputtopic 00023 string[] object_classes 00024 uint64[] object_ids 00025 uint64 action_type 00026 uint64 number_of_objects 00027 vision_msgs/apriori_position[] list_of_poses 00028 00029 ================================================================================ 00030 MSG: vision_msgs/apriori_position 00031 #Tuple for cop call 00032 float64 probability # apriori probability of the position 00033 uint64 positionId # lo id of an position 00034 00035 """ 00036 # Pseudo-constants 00037 LOCATE = 0 00038 TRACK = 16 00039 REFINE = 256 00040 STOPTRACK = 2048 00041 STARTATTENT = 4096 00042 STOPATTENT = 8192 00043 LOOKUP = 25600 00044 LOOKUPALL = 25601 00045 00046 __slots__ = ['outputtopic','object_classes','object_ids','action_type','number_of_objects','list_of_poses'] 00047 _slot_types = ['string','string[]','uint64[]','uint64','uint64','vision_msgs/apriori_position[]'] 00048 00049 def __init__(self, *args, **kwds): 00050 """ 00051 Constructor. Any message fields that are implicitly/explicitly 00052 set to None will be assigned a default value. The recommend 00053 use is keyword arguments as this is more robust to future message 00054 changes. You cannot mix in-order arguments and keyword arguments. 00055 00056 The available fields are: 00057 outputtopic,object_classes,object_ids,action_type,number_of_objects,list_of_poses 00058 00059 @param args: complete set of field values, in .msg order 00060 @param kwds: use keyword arguments corresponding to message field names 00061 to set specific fields. 00062 """ 00063 if args or kwds: 00064 super(cop_callRequest, self).__init__(*args, **kwds) 00065 #message fields cannot be None, assign default values for those that are 00066 if self.outputtopic is None: 00067 self.outputtopic = '' 00068 if self.object_classes is None: 00069 self.object_classes = [] 00070 if self.object_ids is None: 00071 self.object_ids = [] 00072 if self.action_type is None: 00073 self.action_type = 0 00074 if self.number_of_objects is None: 00075 self.number_of_objects = 0 00076 if self.list_of_poses is None: 00077 self.list_of_poses = [] 00078 else: 00079 self.outputtopic = '' 00080 self.object_classes = [] 00081 self.object_ids = [] 00082 self.action_type = 0 00083 self.number_of_objects = 0 00084 self.list_of_poses = [] 00085 00086 def _get_types(self): 00087 """ 00088 internal API method 00089 """ 00090 return self._slot_types 00091 00092 def serialize(self, buff): 00093 """ 00094 serialize message into buffer 00095 @param buff: buffer 00096 @type buff: StringIO 00097 """ 00098 try: 00099 _x = self.outputtopic 00100 length = len(_x) 00101 buff.write(struct.pack('<I%ss'%length, length, _x)) 00102 length = len(self.object_classes) 00103 buff.write(_struct_I.pack(length)) 00104 for val1 in self.object_classes: 00105 length = len(val1) 00106 buff.write(struct.pack('<I%ss'%length, length, val1)) 00107 length = len(self.object_ids) 00108 buff.write(_struct_I.pack(length)) 00109 pattern = '<%sQ'%length 00110 buff.write(struct.pack(pattern, *self.object_ids)) 00111 _x = self 00112 buff.write(_struct_2Q.pack(_x.action_type, _x.number_of_objects)) 00113 length = len(self.list_of_poses) 00114 buff.write(_struct_I.pack(length)) 00115 for val1 in self.list_of_poses: 00116 _x = val1 00117 buff.write(_struct_dQ.pack(_x.probability, _x.positionId)) 00118 except struct.error as se: self._check_types(se) 00119 except TypeError as te: self._check_types(te) 00120 00121 def deserialize(self, str): 00122 """ 00123 unpack serialized message in str into this message instance 00124 @param str: byte array of serialized message 00125 @type str: str 00126 """ 00127 try: 00128 end = 0 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 start = end 00133 end += length 00134 self.outputtopic = str[start:end] 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 self.object_classes = [] 00139 for i in range(0, length): 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 start = end 00144 end += length 00145 val1 = str[start:end] 00146 self.object_classes.append(val1) 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 pattern = '<%sQ'%length 00151 start = end 00152 end += struct.calcsize(pattern) 00153 self.object_ids = struct.unpack(pattern, str[start:end]) 00154 _x = self 00155 start = end 00156 end += 16 00157 (_x.action_type, _x.number_of_objects,) = _struct_2Q.unpack(str[start:end]) 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 self.list_of_poses = [] 00162 for i in range(0, length): 00163 val1 = vision_msgs.msg.apriori_position() 00164 _x = val1 00165 start = end 00166 end += 16 00167 (_x.probability, _x.positionId,) = _struct_dQ.unpack(str[start:end]) 00168 self.list_of_poses.append(val1) 00169 return self 00170 except struct.error as e: 00171 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00172 00173 00174 def serialize_numpy(self, buff, numpy): 00175 """ 00176 serialize message with numpy array types into buffer 00177 @param buff: buffer 00178 @type buff: StringIO 00179 @param numpy: numpy python module 00180 @type numpy module 00181 """ 00182 try: 00183 _x = self.outputtopic 00184 length = len(_x) 00185 buff.write(struct.pack('<I%ss'%length, length, _x)) 00186 length = len(self.object_classes) 00187 buff.write(_struct_I.pack(length)) 00188 for val1 in self.object_classes: 00189 length = len(val1) 00190 buff.write(struct.pack('<I%ss'%length, length, val1)) 00191 length = len(self.object_ids) 00192 buff.write(_struct_I.pack(length)) 00193 pattern = '<%sQ'%length 00194 buff.write(self.object_ids.tostring()) 00195 _x = self 00196 buff.write(_struct_2Q.pack(_x.action_type, _x.number_of_objects)) 00197 length = len(self.list_of_poses) 00198 buff.write(_struct_I.pack(length)) 00199 for val1 in self.list_of_poses: 00200 _x = val1 00201 buff.write(_struct_dQ.pack(_x.probability, _x.positionId)) 00202 except struct.error as se: self._check_types(se) 00203 except TypeError as te: self._check_types(te) 00204 00205 def deserialize_numpy(self, str, numpy): 00206 """ 00207 unpack serialized message in str into this message instance using numpy for array types 00208 @param str: byte array of serialized message 00209 @type str: str 00210 @param numpy: numpy python module 00211 @type numpy: module 00212 """ 00213 try: 00214 end = 0 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 start = end 00219 end += length 00220 self.outputtopic = str[start:end] 00221 start = end 00222 end += 4 00223 (length,) = _struct_I.unpack(str[start:end]) 00224 self.object_classes = [] 00225 for i in range(0, length): 00226 start = end 00227 end += 4 00228 (length,) = _struct_I.unpack(str[start:end]) 00229 start = end 00230 end += length 00231 val1 = str[start:end] 00232 self.object_classes.append(val1) 00233 start = end 00234 end += 4 00235 (length,) = _struct_I.unpack(str[start:end]) 00236 pattern = '<%sQ'%length 00237 start = end 00238 end += struct.calcsize(pattern) 00239 self.object_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length) 00240 _x = self 00241 start = end 00242 end += 16 00243 (_x.action_type, _x.number_of_objects,) = _struct_2Q.unpack(str[start:end]) 00244 start = end 00245 end += 4 00246 (length,) = _struct_I.unpack(str[start:end]) 00247 self.list_of_poses = [] 00248 for i in range(0, length): 00249 val1 = vision_msgs.msg.apriori_position() 00250 _x = val1 00251 start = end 00252 end += 16 00253 (_x.probability, _x.positionId,) = _struct_dQ.unpack(str[start:end]) 00254 self.list_of_poses.append(val1) 00255 return self 00256 except struct.error as e: 00257 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00258 00259 _struct_I = roslib.message.struct_I 00260 _struct_2Q = struct.Struct("<2Q") 00261 _struct_dQ = struct.Struct("<dQ") 00262 """autogenerated by genmsg_py from cop_callResponse.msg. Do not edit.""" 00263 import roslib.message 00264 import struct 00265 00266 00267 class cop_callResponse(roslib.message.Message): 00268 _md5sum = "44338ff3890880904a6cc02046a2df09" 00269 _type = "vision_srvs/cop_callResponse" 00270 _has_header = False #flag to mark the presence of a Header object 00271 _full_text = """uint64 perception_primitive 00272 00273 """ 00274 __slots__ = ['perception_primitive'] 00275 _slot_types = ['uint64'] 00276 00277 def __init__(self, *args, **kwds): 00278 """ 00279 Constructor. Any message fields that are implicitly/explicitly 00280 set to None will be assigned a default value. The recommend 00281 use is keyword arguments as this is more robust to future message 00282 changes. You cannot mix in-order arguments and keyword arguments. 00283 00284 The available fields are: 00285 perception_primitive 00286 00287 @param args: complete set of field values, in .msg order 00288 @param kwds: use keyword arguments corresponding to message field names 00289 to set specific fields. 00290 """ 00291 if args or kwds: 00292 super(cop_callResponse, self).__init__(*args, **kwds) 00293 #message fields cannot be None, assign default values for those that are 00294 if self.perception_primitive is None: 00295 self.perception_primitive = 0 00296 else: 00297 self.perception_primitive = 0 00298 00299 def _get_types(self): 00300 """ 00301 internal API method 00302 """ 00303 return self._slot_types 00304 00305 def serialize(self, buff): 00306 """ 00307 serialize message into buffer 00308 @param buff: buffer 00309 @type buff: StringIO 00310 """ 00311 try: 00312 buff.write(_struct_Q.pack(self.perception_primitive)) 00313 except struct.error as se: self._check_types(se) 00314 except TypeError as te: self._check_types(te) 00315 00316 def deserialize(self, str): 00317 """ 00318 unpack serialized message in str into this message instance 00319 @param str: byte array of serialized message 00320 @type str: str 00321 """ 00322 try: 00323 end = 0 00324 start = end 00325 end += 8 00326 (self.perception_primitive,) = _struct_Q.unpack(str[start:end]) 00327 return self 00328 except struct.error as e: 00329 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00330 00331 00332 def serialize_numpy(self, buff, numpy): 00333 """ 00334 serialize message with numpy array types into buffer 00335 @param buff: buffer 00336 @type buff: StringIO 00337 @param numpy: numpy python module 00338 @type numpy module 00339 """ 00340 try: 00341 buff.write(_struct_Q.pack(self.perception_primitive)) 00342 except struct.error as se: self._check_types(se) 00343 except TypeError as te: self._check_types(te) 00344 00345 def deserialize_numpy(self, str, numpy): 00346 """ 00347 unpack serialized message in str into this message instance using numpy for array types 00348 @param str: byte array of serialized message 00349 @type str: str 00350 @param numpy: numpy python module 00351 @type numpy: module 00352 """ 00353 try: 00354 end = 0 00355 start = end 00356 end += 8 00357 (self.perception_primitive,) = _struct_Q.unpack(str[start:end]) 00358 return self 00359 except struct.error as e: 00360 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00361 00362 _struct_I = roslib.message.struct_I 00363 _struct_Q = struct.Struct("<Q") 00364 class cop_call(roslib.message.ServiceDefinition): 00365 _type = 'vision_srvs/cop_call' 00366 _md5sum = 'df853a883b53431ef52c184e4ff2b0b3' 00367 _request_class = cop_callRequest 00368 _response_class = cop_callResponse