_Feature0DDetect.py
Go to the documentation of this file.
00001 """autogenerated by genpy from posedetection_msgs/Feature0DDetectRequest.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 std_msgs.msg
00008 import sensor_msgs.msg
00009 
00010 class Feature0DDetectRequest(genpy.Message):
00011   _md5sum = "b13d2865c5af2a64e6e30ab1b56e1dd5"
00012   _type = "posedetection_msgs/Feature0DDetectRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """sensor_msgs/Image image
00015 
00016 ================================================================================
00017 MSG: sensor_msgs/Image
00018 # This message contains an uncompressed image
00019 # (0, 0) is at top-left corner of image
00020 #
00021 
00022 Header header        # Header timestamp should be acquisition time of image
00023                      # Header frame_id should be optical frame of camera
00024                      # origin of frame should be optical center of cameara
00025                      # +x should point to the right in the image
00026                      # +y should point down in the image
00027                      # +z should point into to plane of the image
00028                      # If the frame_id here and the frame_id of the CameraInfo
00029                      # message associated with the image conflict
00030                      # the behavior is undefined
00031 
00032 uint32 height         # image height, that is, number of rows
00033 uint32 width          # image width, that is, number of columns
00034 
00035 # The legal values for encoding are in file src/image_encodings.cpp
00036 # If you want to standardize a new string format, join
00037 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00038 
00039 string encoding       # Encoding of pixels -- channel meaning, ordering, size
00040                       # taken from the list of strings in src/image_encodings.cpp
00041 
00042 uint8 is_bigendian    # is this data bigendian?
00043 uint32 step           # Full row length in bytes
00044 uint8[] data          # actual matrix data, size is (step * rows)
00045 
00046 ================================================================================
00047 MSG: std_msgs/Header
00048 # Standard metadata for higher-level stamped data types.
00049 # This is generally used to communicate timestamped data 
00050 # in a particular coordinate frame.
00051 # 
00052 # sequence ID: consecutively increasing ID 
00053 uint32 seq
00054 #Two-integer timestamp that is expressed as:
00055 # * stamp.secs: seconds (stamp_secs) since epoch
00056 # * stamp.nsecs: nanoseconds since stamp_secs
00057 # time-handling sugar is provided by the client library
00058 time stamp
00059 #Frame this data is associated with
00060 # 0: no frame
00061 # 1: global frame
00062 string frame_id
00063 
00064 """
00065   __slots__ = ['image']
00066   _slot_types = ['sensor_msgs/Image']
00067 
00068   def __init__(self, *args, **kwds):
00069     """
00070     Constructor. Any message fields that are implicitly/explicitly
00071     set to None will be assigned a default value. The recommend
00072     use is keyword arguments as this is more robust to future message
00073     changes.  You cannot mix in-order arguments and keyword arguments.
00074 
00075     The available fields are:
00076        image
00077 
00078     :param args: complete set of field values, in .msg order
00079     :param kwds: use keyword arguments corresponding to message field names
00080     to set specific fields.
00081     """
00082     if args or kwds:
00083       super(Feature0DDetectRequest, self).__init__(*args, **kwds)
00084       #message fields cannot be None, assign default values for those that are
00085       if self.image is None:
00086         self.image = sensor_msgs.msg.Image()
00087     else:
00088       self.image = sensor_msgs.msg.Image()
00089 
00090   def _get_types(self):
00091     """
00092     internal API method
00093     """
00094     return self._slot_types
00095 
00096   def serialize(self, buff):
00097     """
00098     serialize message into buffer
00099     :param buff: buffer, ``StringIO``
00100     """
00101     try:
00102       _x = self
00103       buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00104       _x = self.image.header.frame_id
00105       length = len(_x)
00106       if python3 or type(_x) == unicode:
00107         _x = _x.encode('utf-8')
00108         length = len(_x)
00109       buff.write(struct.pack('<I%ss'%length, length, _x))
00110       _x = self
00111       buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00112       _x = self.image.encoding
00113       length = len(_x)
00114       if python3 or type(_x) == unicode:
00115         _x = _x.encode('utf-8')
00116         length = len(_x)
00117       buff.write(struct.pack('<I%ss'%length, length, _x))
00118       _x = self
00119       buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00120       _x = self.image.data
00121       length = len(_x)
00122       # - if encoded as a list instead, serialize as bytes instead of string
00123       if type(_x) in [list, tuple]:
00124         buff.write(struct.pack('<I%sB'%length, length, *_x))
00125       else:
00126         buff.write(struct.pack('<I%ss'%length, length, _x))
00127     except struct.error as se: self._check_types(se)
00128     except TypeError as te: self._check_types(te)
00129 
00130   def deserialize(self, str):
00131     """
00132     unpack serialized message in str into this message instance
00133     :param str: byte array of serialized message, ``str``
00134     """
00135     try:
00136       if self.image is None:
00137         self.image = sensor_msgs.msg.Image()
00138       end = 0
00139       _x = self
00140       start = end
00141       end += 12
00142       (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00143       start = end
00144       end += 4
00145       (length,) = _struct_I.unpack(str[start:end])
00146       start = end
00147       end += length
00148       if python3:
00149         self.image.header.frame_id = str[start:end].decode('utf-8')
00150       else:
00151         self.image.header.frame_id = str[start:end]
00152       _x = self
00153       start = end
00154       end += 8
00155       (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00156       start = end
00157       end += 4
00158       (length,) = _struct_I.unpack(str[start:end])
00159       start = end
00160       end += length
00161       if python3:
00162         self.image.encoding = str[start:end].decode('utf-8')
00163       else:
00164         self.image.encoding = str[start:end]
00165       _x = self
00166       start = end
00167       end += 5
00168       (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00169       start = end
00170       end += 4
00171       (length,) = _struct_I.unpack(str[start:end])
00172       start = end
00173       end += length
00174       if python3:
00175         self.image.data = str[start:end].decode('utf-8')
00176       else:
00177         self.image.data = str[start:end]
00178       return self
00179     except struct.error as e:
00180       raise genpy.DeserializationError(e) #most likely buffer underfill
00181 
00182 
00183   def serialize_numpy(self, buff, numpy):
00184     """
00185     serialize message with numpy array types into buffer
00186     :param buff: buffer, ``StringIO``
00187     :param numpy: numpy python module
00188     """
00189     try:
00190       _x = self
00191       buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00192       _x = self.image.header.frame_id
00193       length = len(_x)
00194       if python3 or type(_x) == unicode:
00195         _x = _x.encode('utf-8')
00196         length = len(_x)
00197       buff.write(struct.pack('<I%ss'%length, length, _x))
00198       _x = self
00199       buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00200       _x = self.image.encoding
00201       length = len(_x)
00202       if python3 or type(_x) == unicode:
00203         _x = _x.encode('utf-8')
00204         length = len(_x)
00205       buff.write(struct.pack('<I%ss'%length, length, _x))
00206       _x = self
00207       buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00208       _x = self.image.data
00209       length = len(_x)
00210       # - if encoded as a list instead, serialize as bytes instead of string
00211       if type(_x) in [list, tuple]:
00212         buff.write(struct.pack('<I%sB'%length, length, *_x))
00213       else:
00214         buff.write(struct.pack('<I%ss'%length, length, _x))
00215     except struct.error as se: self._check_types(se)
00216     except TypeError as te: self._check_types(te)
00217 
00218   def deserialize_numpy(self, str, numpy):
00219     """
00220     unpack serialized message in str into this message instance using numpy for array types
00221     :param str: byte array of serialized message, ``str``
00222     :param numpy: numpy python module
00223     """
00224     try:
00225       if self.image is None:
00226         self.image = sensor_msgs.msg.Image()
00227       end = 0
00228       _x = self
00229       start = end
00230       end += 12
00231       (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00232       start = end
00233       end += 4
00234       (length,) = _struct_I.unpack(str[start:end])
00235       start = end
00236       end += length
00237       if python3:
00238         self.image.header.frame_id = str[start:end].decode('utf-8')
00239       else:
00240         self.image.header.frame_id = str[start:end]
00241       _x = self
00242       start = end
00243       end += 8
00244       (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00245       start = end
00246       end += 4
00247       (length,) = _struct_I.unpack(str[start:end])
00248       start = end
00249       end += length
00250       if python3:
00251         self.image.encoding = str[start:end].decode('utf-8')
00252       else:
00253         self.image.encoding = str[start:end]
00254       _x = self
00255       start = end
00256       end += 5
00257       (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00258       start = end
00259       end += 4
00260       (length,) = _struct_I.unpack(str[start:end])
00261       start = end
00262       end += length
00263       if python3:
00264         self.image.data = str[start:end].decode('utf-8')
00265       else:
00266         self.image.data = str[start:end]
00267       return self
00268     except struct.error as e:
00269       raise genpy.DeserializationError(e) #most likely buffer underfill
00270 
00271 _struct_I = genpy.struct_I
00272 _struct_3I = struct.Struct("<3I")
00273 _struct_2I = struct.Struct("<2I")
00274 _struct_BI = struct.Struct("<BI")
00275 """autogenerated by genpy from posedetection_msgs/Feature0DDetectResponse.msg. Do not edit."""
00276 import sys
00277 python3 = True if sys.hexversion > 0x03000000 else False
00278 import genpy
00279 import struct
00280 
00281 import posedetection_msgs.msg
00282 import std_msgs.msg
00283 
00284 class Feature0DDetectResponse(genpy.Message):
00285   _md5sum = "fa5677bbe36e6cfb2be31b9bbea8bcae"
00286   _type = "posedetection_msgs/Feature0DDetectResponse"
00287   _has_header = False #flag to mark the presence of a Header object
00288   _full_text = """posedetection_msgs/Feature0D features
00289 
00290 
00291 ================================================================================
00292 MSG: posedetection_msgs/Feature0D
00293 Header header
00294 float32[] positions # 2*N, 0-indexed
00295 float32[] scales # N, optional
00296 float32[] orientations # N, optional, along +X is 0
00297 float32[] confidences
00298 float32[] descriptors # N*descriptor_dim
00299 int32 descriptor_dim
00300 string type # type of feature
00301 
00302 ================================================================================
00303 MSG: std_msgs/Header
00304 # Standard metadata for higher-level stamped data types.
00305 # This is generally used to communicate timestamped data 
00306 # in a particular coordinate frame.
00307 # 
00308 # sequence ID: consecutively increasing ID 
00309 uint32 seq
00310 #Two-integer timestamp that is expressed as:
00311 # * stamp.secs: seconds (stamp_secs) since epoch
00312 # * stamp.nsecs: nanoseconds since stamp_secs
00313 # time-handling sugar is provided by the client library
00314 time stamp
00315 #Frame this data is associated with
00316 # 0: no frame
00317 # 1: global frame
00318 string frame_id
00319 
00320 """
00321   __slots__ = ['features']
00322   _slot_types = ['posedetection_msgs/Feature0D']
00323 
00324   def __init__(self, *args, **kwds):
00325     """
00326     Constructor. Any message fields that are implicitly/explicitly
00327     set to None will be assigned a default value. The recommend
00328     use is keyword arguments as this is more robust to future message
00329     changes.  You cannot mix in-order arguments and keyword arguments.
00330 
00331     The available fields are:
00332        features
00333 
00334     :param args: complete set of field values, in .msg order
00335     :param kwds: use keyword arguments corresponding to message field names
00336     to set specific fields.
00337     """
00338     if args or kwds:
00339       super(Feature0DDetectResponse, self).__init__(*args, **kwds)
00340       #message fields cannot be None, assign default values for those that are
00341       if self.features is None:
00342         self.features = posedetection_msgs.msg.Feature0D()
00343     else:
00344       self.features = posedetection_msgs.msg.Feature0D()
00345 
00346   def _get_types(self):
00347     """
00348     internal API method
00349     """
00350     return self._slot_types
00351 
00352   def serialize(self, buff):
00353     """
00354     serialize message into buffer
00355     :param buff: buffer, ``StringIO``
00356     """
00357     try:
00358       _x = self
00359       buff.write(_struct_3I.pack(_x.features.header.seq, _x.features.header.stamp.secs, _x.features.header.stamp.nsecs))
00360       _x = self.features.header.frame_id
00361       length = len(_x)
00362       if python3 or type(_x) == unicode:
00363         _x = _x.encode('utf-8')
00364         length = len(_x)
00365       buff.write(struct.pack('<I%ss'%length, length, _x))
00366       length = len(self.features.positions)
00367       buff.write(_struct_I.pack(length))
00368       pattern = '<%sf'%length
00369       buff.write(struct.pack(pattern, *self.features.positions))
00370       length = len(self.features.scales)
00371       buff.write(_struct_I.pack(length))
00372       pattern = '<%sf'%length
00373       buff.write(struct.pack(pattern, *self.features.scales))
00374       length = len(self.features.orientations)
00375       buff.write(_struct_I.pack(length))
00376       pattern = '<%sf'%length
00377       buff.write(struct.pack(pattern, *self.features.orientations))
00378       length = len(self.features.confidences)
00379       buff.write(_struct_I.pack(length))
00380       pattern = '<%sf'%length
00381       buff.write(struct.pack(pattern, *self.features.confidences))
00382       length = len(self.features.descriptors)
00383       buff.write(_struct_I.pack(length))
00384       pattern = '<%sf'%length
00385       buff.write(struct.pack(pattern, *self.features.descriptors))
00386       buff.write(_struct_i.pack(self.features.descriptor_dim))
00387       _x = self.features.type
00388       length = len(_x)
00389       if python3 or type(_x) == unicode:
00390         _x = _x.encode('utf-8')
00391         length = len(_x)
00392       buff.write(struct.pack('<I%ss'%length, length, _x))
00393     except struct.error as se: self._check_types(se)
00394     except TypeError as te: self._check_types(te)
00395 
00396   def deserialize(self, str):
00397     """
00398     unpack serialized message in str into this message instance
00399     :param str: byte array of serialized message, ``str``
00400     """
00401     try:
00402       if self.features is None:
00403         self.features = posedetection_msgs.msg.Feature0D()
00404       end = 0
00405       _x = self
00406       start = end
00407       end += 12
00408       (_x.features.header.seq, _x.features.header.stamp.secs, _x.features.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00409       start = end
00410       end += 4
00411       (length,) = _struct_I.unpack(str[start:end])
00412       start = end
00413       end += length
00414       if python3:
00415         self.features.header.frame_id = str[start:end].decode('utf-8')
00416       else:
00417         self.features.header.frame_id = str[start:end]
00418       start = end
00419       end += 4
00420       (length,) = _struct_I.unpack(str[start:end])
00421       pattern = '<%sf'%length
00422       start = end
00423       end += struct.calcsize(pattern)
00424       self.features.positions = struct.unpack(pattern, str[start:end])
00425       start = end
00426       end += 4
00427       (length,) = _struct_I.unpack(str[start:end])
00428       pattern = '<%sf'%length
00429       start = end
00430       end += struct.calcsize(pattern)
00431       self.features.scales = struct.unpack(pattern, str[start:end])
00432       start = end
00433       end += 4
00434       (length,) = _struct_I.unpack(str[start:end])
00435       pattern = '<%sf'%length
00436       start = end
00437       end += struct.calcsize(pattern)
00438       self.features.orientations = struct.unpack(pattern, str[start:end])
00439       start = end
00440       end += 4
00441       (length,) = _struct_I.unpack(str[start:end])
00442       pattern = '<%sf'%length
00443       start = end
00444       end += struct.calcsize(pattern)
00445       self.features.confidences = struct.unpack(pattern, str[start:end])
00446       start = end
00447       end += 4
00448       (length,) = _struct_I.unpack(str[start:end])
00449       pattern = '<%sf'%length
00450       start = end
00451       end += struct.calcsize(pattern)
00452       self.features.descriptors = struct.unpack(pattern, str[start:end])
00453       start = end
00454       end += 4
00455       (self.features.descriptor_dim,) = _struct_i.unpack(str[start:end])
00456       start = end
00457       end += 4
00458       (length,) = _struct_I.unpack(str[start:end])
00459       start = end
00460       end += length
00461       if python3:
00462         self.features.type = str[start:end].decode('utf-8')
00463       else:
00464         self.features.type = str[start:end]
00465       return self
00466     except struct.error as e:
00467       raise genpy.DeserializationError(e) #most likely buffer underfill
00468 
00469 
00470   def serialize_numpy(self, buff, numpy):
00471     """
00472     serialize message with numpy array types into buffer
00473     :param buff: buffer, ``StringIO``
00474     :param numpy: numpy python module
00475     """
00476     try:
00477       _x = self
00478       buff.write(_struct_3I.pack(_x.features.header.seq, _x.features.header.stamp.secs, _x.features.header.stamp.nsecs))
00479       _x = self.features.header.frame_id
00480       length = len(_x)
00481       if python3 or type(_x) == unicode:
00482         _x = _x.encode('utf-8')
00483         length = len(_x)
00484       buff.write(struct.pack('<I%ss'%length, length, _x))
00485       length = len(self.features.positions)
00486       buff.write(_struct_I.pack(length))
00487       pattern = '<%sf'%length
00488       buff.write(self.features.positions.tostring())
00489       length = len(self.features.scales)
00490       buff.write(_struct_I.pack(length))
00491       pattern = '<%sf'%length
00492       buff.write(self.features.scales.tostring())
00493       length = len(self.features.orientations)
00494       buff.write(_struct_I.pack(length))
00495       pattern = '<%sf'%length
00496       buff.write(self.features.orientations.tostring())
00497       length = len(self.features.confidences)
00498       buff.write(_struct_I.pack(length))
00499       pattern = '<%sf'%length
00500       buff.write(self.features.confidences.tostring())
00501       length = len(self.features.descriptors)
00502       buff.write(_struct_I.pack(length))
00503       pattern = '<%sf'%length
00504       buff.write(self.features.descriptors.tostring())
00505       buff.write(_struct_i.pack(self.features.descriptor_dim))
00506       _x = self.features.type
00507       length = len(_x)
00508       if python3 or type(_x) == unicode:
00509         _x = _x.encode('utf-8')
00510         length = len(_x)
00511       buff.write(struct.pack('<I%ss'%length, length, _x))
00512     except struct.error as se: self._check_types(se)
00513     except TypeError as te: self._check_types(te)
00514 
00515   def deserialize_numpy(self, str, numpy):
00516     """
00517     unpack serialized message in str into this message instance using numpy for array types
00518     :param str: byte array of serialized message, ``str``
00519     :param numpy: numpy python module
00520     """
00521     try:
00522       if self.features is None:
00523         self.features = posedetection_msgs.msg.Feature0D()
00524       end = 0
00525       _x = self
00526       start = end
00527       end += 12
00528       (_x.features.header.seq, _x.features.header.stamp.secs, _x.features.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00529       start = end
00530       end += 4
00531       (length,) = _struct_I.unpack(str[start:end])
00532       start = end
00533       end += length
00534       if python3:
00535         self.features.header.frame_id = str[start:end].decode('utf-8')
00536       else:
00537         self.features.header.frame_id = str[start:end]
00538       start = end
00539       end += 4
00540       (length,) = _struct_I.unpack(str[start:end])
00541       pattern = '<%sf'%length
00542       start = end
00543       end += struct.calcsize(pattern)
00544       self.features.positions = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00545       start = end
00546       end += 4
00547       (length,) = _struct_I.unpack(str[start:end])
00548       pattern = '<%sf'%length
00549       start = end
00550       end += struct.calcsize(pattern)
00551       self.features.scales = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00552       start = end
00553       end += 4
00554       (length,) = _struct_I.unpack(str[start:end])
00555       pattern = '<%sf'%length
00556       start = end
00557       end += struct.calcsize(pattern)
00558       self.features.orientations = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00559       start = end
00560       end += 4
00561       (length,) = _struct_I.unpack(str[start:end])
00562       pattern = '<%sf'%length
00563       start = end
00564       end += struct.calcsize(pattern)
00565       self.features.confidences = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00566       start = end
00567       end += 4
00568       (length,) = _struct_I.unpack(str[start:end])
00569       pattern = '<%sf'%length
00570       start = end
00571       end += struct.calcsize(pattern)
00572       self.features.descriptors = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00573       start = end
00574       end += 4
00575       (self.features.descriptor_dim,) = _struct_i.unpack(str[start:end])
00576       start = end
00577       end += 4
00578       (length,) = _struct_I.unpack(str[start:end])
00579       start = end
00580       end += length
00581       if python3:
00582         self.features.type = str[start:end].decode('utf-8')
00583       else:
00584         self.features.type = str[start:end]
00585       return self
00586     except struct.error as e:
00587       raise genpy.DeserializationError(e) #most likely buffer underfill
00588 
00589 _struct_I = genpy.struct_I
00590 _struct_i = struct.Struct("<i")
00591 _struct_3I = struct.Struct("<3I")
00592 class Feature0DDetect(object):
00593   _type          = 'posedetection_msgs/Feature0DDetect'
00594   _md5sum = 'abc004df074d18a6645a71894c243592'
00595   _request_class  = Feature0DDetectRequest
00596   _response_class = Feature0DDetectResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


posedetection_msgs
Author(s): Rosen Diankov
autogenerated on Sat Mar 23 2013 12:47:59