_DescriptorsToVws.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_perception_msgs/DescriptorsToVwsRequest.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 geometry_msgs.msg
00008 import iri_perception_msgs.msg
00009 import std_msgs.msg
00010 
00011 class DescriptorsToVwsRequest(genpy.Message):
00012   _md5sum = "db5e12e66d3b02ca867728f150b58d69"
00013   _type = "iri_perception_msgs/DescriptorsToVwsRequest"
00014   _has_header = False #flag to mark the presence of a Header object
00015   _full_text = """
00016 iri_perception_msgs/DescriptorSet descriptor_set
00017 
00018 ================================================================================
00019 MSG: iri_perception_msgs/DescriptorSet
00020 Header header
00021 int32 num_orient_bins
00022 int32 num_spa_bins
00023 int32 num
00024 int32 len
00025 int32 width
00026 int32 height
00027 iri_perception_msgs/Descriptor[] descriptors
00028 
00029 ================================================================================
00030 MSG: std_msgs/Header
00031 # Standard metadata for higher-level stamped data types.
00032 # This is generally used to communicate timestamped data 
00033 # in a particular coordinate frame.
00034 # 
00035 # sequence ID: consecutively increasing ID 
00036 uint32 seq
00037 #Two-integer timestamp that is expressed as:
00038 # * stamp.secs: seconds (stamp_secs) since epoch
00039 # * stamp.nsecs: nanoseconds since stamp_secs
00040 # time-handling sugar is provided by the client library
00041 time stamp
00042 #Frame this data is associated with
00043 # 0: no frame
00044 # 1: global frame
00045 string frame_id
00046 
00047 ================================================================================
00048 MSG: iri_perception_msgs/Descriptor
00049 float32[] descriptor
00050 geometry_msgs/Vector3 point3d
00051 int32 u
00052 int32 v
00053 float32 orientation
00054 
00055 ================================================================================
00056 MSG: geometry_msgs/Vector3
00057 # This represents a vector in free space. 
00058 
00059 float64 x
00060 float64 y
00061 float64 z
00062 """
00063   __slots__ = ['descriptor_set']
00064   _slot_types = ['iri_perception_msgs/DescriptorSet']
00065 
00066   def __init__(self, *args, **kwds):
00067     """
00068     Constructor. Any message fields that are implicitly/explicitly
00069     set to None will be assigned a default value. The recommend
00070     use is keyword arguments as this is more robust to future message
00071     changes.  You cannot mix in-order arguments and keyword arguments.
00072 
00073     The available fields are:
00074        descriptor_set
00075 
00076     :param args: complete set of field values, in .msg order
00077     :param kwds: use keyword arguments corresponding to message field names
00078     to set specific fields.
00079     """
00080     if args or kwds:
00081       super(DescriptorsToVwsRequest, self).__init__(*args, **kwds)
00082       #message fields cannot be None, assign default values for those that are
00083       if self.descriptor_set is None:
00084         self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00085     else:
00086       self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
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
00101       buff.write(_struct_3I.pack(_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs))
00102       _x = self.descriptor_set.header.frame_id
00103       length = len(_x)
00104       if python3 or type(_x) == unicode:
00105         _x = _x.encode('utf-8')
00106         length = len(_x)
00107       buff.write(struct.pack('<I%ss'%length, length, _x))
00108       _x = self
00109       buff.write(_struct_6i.pack(_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height))
00110       length = len(self.descriptor_set.descriptors)
00111       buff.write(_struct_I.pack(length))
00112       for val1 in self.descriptor_set.descriptors:
00113         length = len(val1.descriptor)
00114         buff.write(_struct_I.pack(length))
00115         pattern = '<%sf'%length
00116         buff.write(struct.pack(pattern, *val1.descriptor))
00117         _v1 = val1.point3d
00118         _x = _v1
00119         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00120         _x = val1
00121         buff.write(_struct_2if.pack(_x.u, _x.v, _x.orientation))
00122     except struct.error as se: self._check_types(se)
00123     except TypeError as te: self._check_types(te)
00124 
00125   def deserialize(self, str):
00126     """
00127     unpack serialized message in str into this message instance
00128     :param str: byte array of serialized message, ``str``
00129     """
00130     try:
00131       if self.descriptor_set is None:
00132         self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00133       end = 0
00134       _x = self
00135       start = end
00136       end += 12
00137       (_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       start = end
00142       end += length
00143       if python3:
00144         self.descriptor_set.header.frame_id = str[start:end].decode('utf-8')
00145       else:
00146         self.descriptor_set.header.frame_id = str[start:end]
00147       _x = self
00148       start = end
00149       end += 24
00150       (_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height,) = _struct_6i.unpack(str[start:end])
00151       start = end
00152       end += 4
00153       (length,) = _struct_I.unpack(str[start:end])
00154       self.descriptor_set.descriptors = []
00155       for i in range(0, length):
00156         val1 = iri_perception_msgs.msg.Descriptor()
00157         start = end
00158         end += 4
00159         (length,) = _struct_I.unpack(str[start:end])
00160         pattern = '<%sf'%length
00161         start = end
00162         end += struct.calcsize(pattern)
00163         val1.descriptor = struct.unpack(pattern, str[start:end])
00164         _v2 = val1.point3d
00165         _x = _v2
00166         start = end
00167         end += 24
00168         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00169         _x = val1
00170         start = end
00171         end += 12
00172         (_x.u, _x.v, _x.orientation,) = _struct_2if.unpack(str[start:end])
00173         self.descriptor_set.descriptors.append(val1)
00174       return self
00175     except struct.error as e:
00176       raise genpy.DeserializationError(e) #most likely buffer underfill
00177 
00178 
00179   def serialize_numpy(self, buff, numpy):
00180     """
00181     serialize message with numpy array types into buffer
00182     :param buff: buffer, ``StringIO``
00183     :param numpy: numpy python module
00184     """
00185     try:
00186       _x = self
00187       buff.write(_struct_3I.pack(_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs))
00188       _x = self.descriptor_set.header.frame_id
00189       length = len(_x)
00190       if python3 or type(_x) == unicode:
00191         _x = _x.encode('utf-8')
00192         length = len(_x)
00193       buff.write(struct.pack('<I%ss'%length, length, _x))
00194       _x = self
00195       buff.write(_struct_6i.pack(_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height))
00196       length = len(self.descriptor_set.descriptors)
00197       buff.write(_struct_I.pack(length))
00198       for val1 in self.descriptor_set.descriptors:
00199         length = len(val1.descriptor)
00200         buff.write(_struct_I.pack(length))
00201         pattern = '<%sf'%length
00202         buff.write(val1.descriptor.tostring())
00203         _v3 = val1.point3d
00204         _x = _v3
00205         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00206         _x = val1
00207         buff.write(_struct_2if.pack(_x.u, _x.v, _x.orientation))
00208     except struct.error as se: self._check_types(se)
00209     except TypeError as te: self._check_types(te)
00210 
00211   def deserialize_numpy(self, str, numpy):
00212     """
00213     unpack serialized message in str into this message instance using numpy for array types
00214     :param str: byte array of serialized message, ``str``
00215     :param numpy: numpy python module
00216     """
00217     try:
00218       if self.descriptor_set is None:
00219         self.descriptor_set = iri_perception_msgs.msg.DescriptorSet()
00220       end = 0
00221       _x = self
00222       start = end
00223       end += 12
00224       (_x.descriptor_set.header.seq, _x.descriptor_set.header.stamp.secs, _x.descriptor_set.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00225       start = end
00226       end += 4
00227       (length,) = _struct_I.unpack(str[start:end])
00228       start = end
00229       end += length
00230       if python3:
00231         self.descriptor_set.header.frame_id = str[start:end].decode('utf-8')
00232       else:
00233         self.descriptor_set.header.frame_id = str[start:end]
00234       _x = self
00235       start = end
00236       end += 24
00237       (_x.descriptor_set.num_orient_bins, _x.descriptor_set.num_spa_bins, _x.descriptor_set.num, _x.descriptor_set.len, _x.descriptor_set.width, _x.descriptor_set.height,) = _struct_6i.unpack(str[start:end])
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       self.descriptor_set.descriptors = []
00242       for i in range(0, length):
00243         val1 = iri_perception_msgs.msg.Descriptor()
00244         start = end
00245         end += 4
00246         (length,) = _struct_I.unpack(str[start:end])
00247         pattern = '<%sf'%length
00248         start = end
00249         end += struct.calcsize(pattern)
00250         val1.descriptor = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00251         _v4 = val1.point3d
00252         _x = _v4
00253         start = end
00254         end += 24
00255         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00256         _x = val1
00257         start = end
00258         end += 12
00259         (_x.u, _x.v, _x.orientation,) = _struct_2if.unpack(str[start:end])
00260         self.descriptor_set.descriptors.append(val1)
00261       return self
00262     except struct.error as e:
00263       raise genpy.DeserializationError(e) #most likely buffer underfill
00264 
00265 _struct_I = genpy.struct_I
00266 _struct_2if = struct.Struct("<2if")
00267 _struct_6i = struct.Struct("<6i")
00268 _struct_3I = struct.Struct("<3I")
00269 _struct_3d = struct.Struct("<3d")
00270 """autogenerated by genpy from iri_perception_msgs/DescriptorsToVwsResponse.msg. Do not edit."""
00271 import sys
00272 python3 = True if sys.hexversion > 0x03000000 else False
00273 import genpy
00274 import struct
00275 
00276 import iri_perception_msgs.msg
00277 
00278 class DescriptorsToVwsResponse(genpy.Message):
00279   _md5sum = "fbaeb4cf1b5d7cd6619b89880488beae"
00280   _type = "iri_perception_msgs/DescriptorsToVwsResponse"
00281   _has_header = False #flag to mark the presence of a Header object
00282   _full_text = """
00283 iri_perception_msgs/GeoVwSet geo_vw_set
00284 
00285 
00286 ================================================================================
00287 MSG: iri_perception_msgs/GeoVwSet
00288 iri_perception_msgs/GeoVw[] geo_vws
00289 
00290 ================================================================================
00291 MSG: iri_perception_msgs/GeoVw
00292 uint32 x
00293 uint32 y
00294 uint32 word
00295 """
00296   __slots__ = ['geo_vw_set']
00297   _slot_types = ['iri_perception_msgs/GeoVwSet']
00298 
00299   def __init__(self, *args, **kwds):
00300     """
00301     Constructor. Any message fields that are implicitly/explicitly
00302     set to None will be assigned a default value. The recommend
00303     use is keyword arguments as this is more robust to future message
00304     changes.  You cannot mix in-order arguments and keyword arguments.
00305 
00306     The available fields are:
00307        geo_vw_set
00308 
00309     :param args: complete set of field values, in .msg order
00310     :param kwds: use keyword arguments corresponding to message field names
00311     to set specific fields.
00312     """
00313     if args or kwds:
00314       super(DescriptorsToVwsResponse, self).__init__(*args, **kwds)
00315       #message fields cannot be None, assign default values for those that are
00316       if self.geo_vw_set is None:
00317         self.geo_vw_set = iri_perception_msgs.msg.GeoVwSet()
00318     else:
00319       self.geo_vw_set = iri_perception_msgs.msg.GeoVwSet()
00320 
00321   def _get_types(self):
00322     """
00323     internal API method
00324     """
00325     return self._slot_types
00326 
00327   def serialize(self, buff):
00328     """
00329     serialize message into buffer
00330     :param buff: buffer, ``StringIO``
00331     """
00332     try:
00333       length = len(self.geo_vw_set.geo_vws)
00334       buff.write(_struct_I.pack(length))
00335       for val1 in self.geo_vw_set.geo_vws:
00336         _x = val1
00337         buff.write(_struct_3I.pack(_x.x, _x.y, _x.word))
00338     except struct.error as se: self._check_types(se)
00339     except TypeError as te: self._check_types(te)
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       if self.geo_vw_set is None:
00348         self.geo_vw_set = iri_perception_msgs.msg.GeoVwSet()
00349       end = 0
00350       start = end
00351       end += 4
00352       (length,) = _struct_I.unpack(str[start:end])
00353       self.geo_vw_set.geo_vws = []
00354       for i in range(0, length):
00355         val1 = iri_perception_msgs.msg.GeoVw()
00356         _x = val1
00357         start = end
00358         end += 12
00359         (_x.x, _x.y, _x.word,) = _struct_3I.unpack(str[start:end])
00360         self.geo_vw_set.geo_vws.append(val1)
00361       return self
00362     except struct.error as e:
00363       raise genpy.DeserializationError(e) #most likely buffer underfill
00364 
00365 
00366   def serialize_numpy(self, buff, numpy):
00367     """
00368     serialize message with numpy array types into buffer
00369     :param buff: buffer, ``StringIO``
00370     :param numpy: numpy python module
00371     """
00372     try:
00373       length = len(self.geo_vw_set.geo_vws)
00374       buff.write(_struct_I.pack(length))
00375       for val1 in self.geo_vw_set.geo_vws:
00376         _x = val1
00377         buff.write(_struct_3I.pack(_x.x, _x.y, _x.word))
00378     except struct.error as se: self._check_types(se)
00379     except TypeError as te: self._check_types(te)
00380 
00381   def deserialize_numpy(self, str, numpy):
00382     """
00383     unpack serialized message in str into this message instance using numpy for array types
00384     :param str: byte array of serialized message, ``str``
00385     :param numpy: numpy python module
00386     """
00387     try:
00388       if self.geo_vw_set is None:
00389         self.geo_vw_set = iri_perception_msgs.msg.GeoVwSet()
00390       end = 0
00391       start = end
00392       end += 4
00393       (length,) = _struct_I.unpack(str[start:end])
00394       self.geo_vw_set.geo_vws = []
00395       for i in range(0, length):
00396         val1 = iri_perception_msgs.msg.GeoVw()
00397         _x = val1
00398         start = end
00399         end += 12
00400         (_x.x, _x.y, _x.word,) = _struct_3I.unpack(str[start:end])
00401         self.geo_vw_set.geo_vws.append(val1)
00402       return self
00403     except struct.error as e:
00404       raise genpy.DeserializationError(e) #most likely buffer underfill
00405 
00406 _struct_I = genpy.struct_I
00407 _struct_3I = struct.Struct("<3I")
00408 class DescriptorsToVws(object):
00409   _type          = 'iri_perception_msgs/DescriptorsToVws'
00410   _md5sum = '22b3d75b6de6a8033e791170a75fab55'
00411   _request_class  = DescriptorsToVwsRequest
00412   _response_class = DescriptorsToVwsResponse


iri_perception_msgs
Author(s):
autogenerated on Fri Dec 6 2013 20:02:15