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


vision_srvs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:48:11