_WrinkledMap.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_bow_object_detector/WrinkledMap.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class WrinkledMap(genpy.Message):
00009   _md5sum = "731afabcd74c0c172f1477d740d8aa06"
00010   _type = "iri_bow_object_detector/WrinkledMap"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float32[] h
00013 float32[] x
00014 float32[] y
00015 float32[] z
00016 """
00017   __slots__ = ['h','x','y','z']
00018   _slot_types = ['float32[]','float32[]','float32[]','float32[]']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        h,x,y,z
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(WrinkledMap, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.h is None:
00038         self.h = []
00039       if self.x is None:
00040         self.x = []
00041       if self.y is None:
00042         self.y = []
00043       if self.z is None:
00044         self.z = []
00045     else:
00046       self.h = []
00047       self.x = []
00048       self.y = []
00049       self.z = []
00050 
00051   def _get_types(self):
00052     """
00053     internal API method
00054     """
00055     return self._slot_types
00056 
00057   def serialize(self, buff):
00058     """
00059     serialize message into buffer
00060     :param buff: buffer, ``StringIO``
00061     """
00062     try:
00063       length = len(self.h)
00064       buff.write(_struct_I.pack(length))
00065       pattern = '<%sf'%length
00066       buff.write(struct.pack(pattern, *self.h))
00067       length = len(self.x)
00068       buff.write(_struct_I.pack(length))
00069       pattern = '<%sf'%length
00070       buff.write(struct.pack(pattern, *self.x))
00071       length = len(self.y)
00072       buff.write(_struct_I.pack(length))
00073       pattern = '<%sf'%length
00074       buff.write(struct.pack(pattern, *self.y))
00075       length = len(self.z)
00076       buff.write(_struct_I.pack(length))
00077       pattern = '<%sf'%length
00078       buff.write(struct.pack(pattern, *self.z))
00079     except struct.error as se: self._check_types(se)
00080     except TypeError as te: self._check_types(te)
00081 
00082   def deserialize(self, str):
00083     """
00084     unpack serialized message in str into this message instance
00085     :param str: byte array of serialized message, ``str``
00086     """
00087     try:
00088       end = 0
00089       start = end
00090       end += 4
00091       (length,) = _struct_I.unpack(str[start:end])
00092       pattern = '<%sf'%length
00093       start = end
00094       end += struct.calcsize(pattern)
00095       self.h = struct.unpack(pattern, str[start:end])
00096       start = end
00097       end += 4
00098       (length,) = _struct_I.unpack(str[start:end])
00099       pattern = '<%sf'%length
00100       start = end
00101       end += struct.calcsize(pattern)
00102       self.x = struct.unpack(pattern, str[start:end])
00103       start = end
00104       end += 4
00105       (length,) = _struct_I.unpack(str[start:end])
00106       pattern = '<%sf'%length
00107       start = end
00108       end += struct.calcsize(pattern)
00109       self.y = struct.unpack(pattern, str[start:end])
00110       start = end
00111       end += 4
00112       (length,) = _struct_I.unpack(str[start:end])
00113       pattern = '<%sf'%length
00114       start = end
00115       end += struct.calcsize(pattern)
00116       self.z = struct.unpack(pattern, str[start:end])
00117       return self
00118     except struct.error as e:
00119       raise genpy.DeserializationError(e) #most likely buffer underfill
00120 
00121 
00122   def serialize_numpy(self, buff, numpy):
00123     """
00124     serialize message with numpy array types into buffer
00125     :param buff: buffer, ``StringIO``
00126     :param numpy: numpy python module
00127     """
00128     try:
00129       length = len(self.h)
00130       buff.write(_struct_I.pack(length))
00131       pattern = '<%sf'%length
00132       buff.write(self.h.tostring())
00133       length = len(self.x)
00134       buff.write(_struct_I.pack(length))
00135       pattern = '<%sf'%length
00136       buff.write(self.x.tostring())
00137       length = len(self.y)
00138       buff.write(_struct_I.pack(length))
00139       pattern = '<%sf'%length
00140       buff.write(self.y.tostring())
00141       length = len(self.z)
00142       buff.write(_struct_I.pack(length))
00143       pattern = '<%sf'%length
00144       buff.write(self.z.tostring())
00145     except struct.error as se: self._check_types(se)
00146     except TypeError as te: self._check_types(te)
00147 
00148   def deserialize_numpy(self, str, numpy):
00149     """
00150     unpack serialized message in str into this message instance using numpy for array types
00151     :param str: byte array of serialized message, ``str``
00152     :param numpy: numpy python module
00153     """
00154     try:
00155       end = 0
00156       start = end
00157       end += 4
00158       (length,) = _struct_I.unpack(str[start:end])
00159       pattern = '<%sf'%length
00160       start = end
00161       end += struct.calcsize(pattern)
00162       self.h = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00163       start = end
00164       end += 4
00165       (length,) = _struct_I.unpack(str[start:end])
00166       pattern = '<%sf'%length
00167       start = end
00168       end += struct.calcsize(pattern)
00169       self.x = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00170       start = end
00171       end += 4
00172       (length,) = _struct_I.unpack(str[start:end])
00173       pattern = '<%sf'%length
00174       start = end
00175       end += struct.calcsize(pattern)
00176       self.y = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00177       start = end
00178       end += 4
00179       (length,) = _struct_I.unpack(str[start:end])
00180       pattern = '<%sf'%length
00181       start = end
00182       end += struct.calcsize(pattern)
00183       self.z = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00184       return self
00185     except struct.error as e:
00186       raise genpy.DeserializationError(e) #most likely buffer underfill
00187 
00188 _struct_I = genpy.struct_I


iri_bow_object_detector
Author(s): dmartinez
autogenerated on Fri Dec 6 2013 22:45:45