_ndesc_pc.py
Go to the documentation of this file.
00001 """autogenerated by genpy from normal_descriptor_node/ndesc_pc.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 normal_descriptor_node.msg
00009 import std_msgs.msg
00010 
00011 class ndesc_pc(genpy.Message):
00012   _md5sum = "c679de87ba14c801c3867289ca709eb0"
00013   _type = "normal_descriptor_node/ndesc_pc"
00014   _has_header = True #flag to mark the presence of a Header object
00015   _full_text = """Header header
00016 int32 num_orient_bins
00017 int32 num_spa_bins
00018 int32 num
00019 int32 len
00020 int32 width
00021 int32 height
00022 normal_descriptor_node/ndesc[] descriptors
00023 
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data 
00028 # in a particular coordinate frame.
00029 # 
00030 # sequence ID: consecutively increasing ID 
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041 
00042 ================================================================================
00043 MSG: normal_descriptor_node/ndesc
00044 float32[] descriptor
00045 geometry_msgs/Vector3 point3d
00046 int32 u
00047 int32 v
00048 float32 ori
00049 ================================================================================
00050 MSG: geometry_msgs/Vector3
00051 # This represents a vector in free space. 
00052 
00053 float64 x
00054 float64 y
00055 float64 z
00056 """
00057   __slots__ = ['header','num_orient_bins','num_spa_bins','num','len','width','height','descriptors']
00058   _slot_types = ['std_msgs/Header','int32','int32','int32','int32','int32','int32','normal_descriptor_node/ndesc[]']
00059 
00060   def __init__(self, *args, **kwds):
00061     """
00062     Constructor. Any message fields that are implicitly/explicitly
00063     set to None will be assigned a default value. The recommend
00064     use is keyword arguments as this is more robust to future message
00065     changes.  You cannot mix in-order arguments and keyword arguments.
00066 
00067     The available fields are:
00068        header,num_orient_bins,num_spa_bins,num,len,width,height,descriptors
00069 
00070     :param args: complete set of field values, in .msg order
00071     :param kwds: use keyword arguments corresponding to message field names
00072     to set specific fields.
00073     """
00074     if args or kwds:
00075       super(ndesc_pc, self).__init__(*args, **kwds)
00076       #message fields cannot be None, assign default values for those that are
00077       if self.header is None:
00078         self.header = std_msgs.msg.Header()
00079       if self.num_orient_bins is None:
00080         self.num_orient_bins = 0
00081       if self.num_spa_bins is None:
00082         self.num_spa_bins = 0
00083       if self.num is None:
00084         self.num = 0
00085       if self.len is None:
00086         self.len = 0
00087       if self.width is None:
00088         self.width = 0
00089       if self.height is None:
00090         self.height = 0
00091       if self.descriptors is None:
00092         self.descriptors = []
00093     else:
00094       self.header = std_msgs.msg.Header()
00095       self.num_orient_bins = 0
00096       self.num_spa_bins = 0
00097       self.num = 0
00098       self.len = 0
00099       self.width = 0
00100       self.height = 0
00101       self.descriptors = []
00102 
00103   def _get_types(self):
00104     """
00105     internal API method
00106     """
00107     return self._slot_types
00108 
00109   def serialize(self, buff):
00110     """
00111     serialize message into buffer
00112     :param buff: buffer, ``StringIO``
00113     """
00114     try:
00115       _x = self
00116       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00117       _x = self.header.frame_id
00118       length = len(_x)
00119       if python3 or type(_x) == unicode:
00120         _x = _x.encode('utf-8')
00121         length = len(_x)
00122       buff.write(struct.pack('<I%ss'%length, length, _x))
00123       _x = self
00124       buff.write(_struct_6i.pack(_x.num_orient_bins, _x.num_spa_bins, _x.num, _x.len, _x.width, _x.height))
00125       length = len(self.descriptors)
00126       buff.write(_struct_I.pack(length))
00127       for val1 in self.descriptors:
00128         length = len(val1.descriptor)
00129         buff.write(_struct_I.pack(length))
00130         pattern = '<%sf'%length
00131         buff.write(struct.pack(pattern, *val1.descriptor))
00132         _v1 = val1.point3d
00133         _x = _v1
00134         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00135         _x = val1
00136         buff.write(_struct_2if.pack(_x.u, _x.v, _x.ori))
00137     except struct.error as se: self._check_types(se)
00138     except TypeError as te: self._check_types(te)
00139 
00140   def deserialize(self, str):
00141     """
00142     unpack serialized message in str into this message instance
00143     :param str: byte array of serialized message, ``str``
00144     """
00145     try:
00146       if self.header is None:
00147         self.header = std_msgs.msg.Header()
00148       if self.descriptors is None:
00149         self.descriptors = None
00150       end = 0
00151       _x = self
00152       start = end
00153       end += 12
00154       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00155       start = end
00156       end += 4
00157       (length,) = _struct_I.unpack(str[start:end])
00158       start = end
00159       end += length
00160       if python3:
00161         self.header.frame_id = str[start:end].decode('utf-8')
00162       else:
00163         self.header.frame_id = str[start:end]
00164       _x = self
00165       start = end
00166       end += 24
00167       (_x.num_orient_bins, _x.num_spa_bins, _x.num, _x.len, _x.width, _x.height,) = _struct_6i.unpack(str[start:end])
00168       start = end
00169       end += 4
00170       (length,) = _struct_I.unpack(str[start:end])
00171       self.descriptors = []
00172       for i in range(0, length):
00173         val1 = normal_descriptor_node.msg.ndesc()
00174         start = end
00175         end += 4
00176         (length,) = _struct_I.unpack(str[start:end])
00177         pattern = '<%sf'%length
00178         start = end
00179         end += struct.calcsize(pattern)
00180         val1.descriptor = struct.unpack(pattern, str[start:end])
00181         _v2 = val1.point3d
00182         _x = _v2
00183         start = end
00184         end += 24
00185         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00186         _x = val1
00187         start = end
00188         end += 12
00189         (_x.u, _x.v, _x.ori,) = _struct_2if.unpack(str[start:end])
00190         self.descriptors.append(val1)
00191       return self
00192     except struct.error as e:
00193       raise genpy.DeserializationError(e) #most likely buffer underfill
00194 
00195 
00196   def serialize_numpy(self, buff, numpy):
00197     """
00198     serialize message with numpy array types into buffer
00199     :param buff: buffer, ``StringIO``
00200     :param numpy: numpy python module
00201     """
00202     try:
00203       _x = self
00204       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00205       _x = self.header.frame_id
00206       length = len(_x)
00207       if python3 or type(_x) == unicode:
00208         _x = _x.encode('utf-8')
00209         length = len(_x)
00210       buff.write(struct.pack('<I%ss'%length, length, _x))
00211       _x = self
00212       buff.write(_struct_6i.pack(_x.num_orient_bins, _x.num_spa_bins, _x.num, _x.len, _x.width, _x.height))
00213       length = len(self.descriptors)
00214       buff.write(_struct_I.pack(length))
00215       for val1 in self.descriptors:
00216         length = len(val1.descriptor)
00217         buff.write(_struct_I.pack(length))
00218         pattern = '<%sf'%length
00219         buff.write(val1.descriptor.tostring())
00220         _v3 = val1.point3d
00221         _x = _v3
00222         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00223         _x = val1
00224         buff.write(_struct_2if.pack(_x.u, _x.v, _x.ori))
00225     except struct.error as se: self._check_types(se)
00226     except TypeError as te: self._check_types(te)
00227 
00228   def deserialize_numpy(self, str, numpy):
00229     """
00230     unpack serialized message in str into this message instance using numpy for array types
00231     :param str: byte array of serialized message, ``str``
00232     :param numpy: numpy python module
00233     """
00234     try:
00235       if self.header is None:
00236         self.header = std_msgs.msg.Header()
00237       if self.descriptors is None:
00238         self.descriptors = None
00239       end = 0
00240       _x = self
00241       start = end
00242       end += 12
00243       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00244       start = end
00245       end += 4
00246       (length,) = _struct_I.unpack(str[start:end])
00247       start = end
00248       end += length
00249       if python3:
00250         self.header.frame_id = str[start:end].decode('utf-8')
00251       else:
00252         self.header.frame_id = str[start:end]
00253       _x = self
00254       start = end
00255       end += 24
00256       (_x.num_orient_bins, _x.num_spa_bins, _x.num, _x.len, _x.width, _x.height,) = _struct_6i.unpack(str[start:end])
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       self.descriptors = []
00261       for i in range(0, length):
00262         val1 = normal_descriptor_node.msg.ndesc()
00263         start = end
00264         end += 4
00265         (length,) = _struct_I.unpack(str[start:end])
00266         pattern = '<%sf'%length
00267         start = end
00268         end += struct.calcsize(pattern)
00269         val1.descriptor = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00270         _v4 = val1.point3d
00271         _x = _v4
00272         start = end
00273         end += 24
00274         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00275         _x = val1
00276         start = end
00277         end += 12
00278         (_x.u, _x.v, _x.ori,) = _struct_2if.unpack(str[start:end])
00279         self.descriptors.append(val1)
00280       return self
00281     except struct.error as e:
00282       raise genpy.DeserializationError(e) #most likely buffer underfill
00283 
00284 _struct_I = genpy.struct_I
00285 _struct_2if = struct.Struct("<2if")
00286 _struct_6i = struct.Struct("<6i")
00287 _struct_3I = struct.Struct("<3I")
00288 _struct_3d = struct.Struct("<3d")


normal_descriptor_node
Author(s): Arnau Ramisa
autogenerated on Fri Dec 6 2013 20:19:55