_ClusterPointIndices.py
Go to the documentation of this file.
00001 """autogenerated by genpy from jsk_perception/ClusterPointIndices.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 pcl.msg
00008 import std_msgs.msg
00009 
00010 class ClusterPointIndices(genpy.Message):
00011   _md5sum = "470faf76178d49ae75888f8f7e5c9707"
00012   _type = "jsk_perception/ClusterPointIndices"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """pcl/PointIndices[] cluster_indices 
00015 ================================================================================
00016 MSG: pcl/PointIndices
00017 Header header
00018 int32[] indices
00019 
00020 
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data 
00025 # in a particular coordinate frame.
00026 # 
00027 # sequence ID: consecutively increasing ID 
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038 
00039 """
00040   __slots__ = ['cluster_indices']
00041   _slot_types = ['pcl/PointIndices[]']
00042 
00043   def __init__(self, *args, **kwds):
00044     """
00045     Constructor. Any message fields that are implicitly/explicitly
00046     set to None will be assigned a default value. The recommend
00047     use is keyword arguments as this is more robust to future message
00048     changes.  You cannot mix in-order arguments and keyword arguments.
00049 
00050     The available fields are:
00051        cluster_indices
00052 
00053     :param args: complete set of field values, in .msg order
00054     :param kwds: use keyword arguments corresponding to message field names
00055     to set specific fields.
00056     """
00057     if args or kwds:
00058       super(ClusterPointIndices, self).__init__(*args, **kwds)
00059       #message fields cannot be None, assign default values for those that are
00060       if self.cluster_indices is None:
00061         self.cluster_indices = []
00062     else:
00063       self.cluster_indices = []
00064 
00065   def _get_types(self):
00066     """
00067     internal API method
00068     """
00069     return self._slot_types
00070 
00071   def serialize(self, buff):
00072     """
00073     serialize message into buffer
00074     :param buff: buffer, ``StringIO``
00075     """
00076     try:
00077       length = len(self.cluster_indices)
00078       buff.write(_struct_I.pack(length))
00079       for val1 in self.cluster_indices:
00080         _v1 = val1.header
00081         buff.write(_struct_I.pack(_v1.seq))
00082         _v2 = _v1.stamp
00083         _x = _v2
00084         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00085         _x = _v1.frame_id
00086         length = len(_x)
00087         if python3 or type(_x) == unicode:
00088           _x = _x.encode('utf-8')
00089           length = len(_x)
00090         buff.write(struct.pack('<I%ss'%length, length, _x))
00091         length = len(val1.indices)
00092         buff.write(_struct_I.pack(length))
00093         pattern = '<%si'%length
00094         buff.write(struct.pack(pattern, *val1.indices))
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as te: self._check_types(te)
00097 
00098   def deserialize(self, str):
00099     """
00100     unpack serialized message in str into this message instance
00101     :param str: byte array of serialized message, ``str``
00102     """
00103     try:
00104       if self.cluster_indices is None:
00105         self.cluster_indices = None
00106       end = 0
00107       start = end
00108       end += 4
00109       (length,) = _struct_I.unpack(str[start:end])
00110       self.cluster_indices = []
00111       for i in range(0, length):
00112         val1 = pcl.msg.PointIndices()
00113         _v3 = val1.header
00114         start = end
00115         end += 4
00116         (_v3.seq,) = _struct_I.unpack(str[start:end])
00117         _v4 = _v3.stamp
00118         _x = _v4
00119         start = end
00120         end += 8
00121         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00122         start = end
00123         end += 4
00124         (length,) = _struct_I.unpack(str[start:end])
00125         start = end
00126         end += length
00127         if python3:
00128           _v3.frame_id = str[start:end].decode('utf-8')
00129         else:
00130           _v3.frame_id = str[start:end]
00131         start = end
00132         end += 4
00133         (length,) = _struct_I.unpack(str[start:end])
00134         pattern = '<%si'%length
00135         start = end
00136         end += struct.calcsize(pattern)
00137         val1.indices = struct.unpack(pattern, str[start:end])
00138         self.cluster_indices.append(val1)
00139       return self
00140     except struct.error as e:
00141       raise genpy.DeserializationError(e) #most likely buffer underfill
00142 
00143 
00144   def serialize_numpy(self, buff, numpy):
00145     """
00146     serialize message with numpy array types into buffer
00147     :param buff: buffer, ``StringIO``
00148     :param numpy: numpy python module
00149     """
00150     try:
00151       length = len(self.cluster_indices)
00152       buff.write(_struct_I.pack(length))
00153       for val1 in self.cluster_indices:
00154         _v5 = val1.header
00155         buff.write(_struct_I.pack(_v5.seq))
00156         _v6 = _v5.stamp
00157         _x = _v6
00158         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00159         _x = _v5.frame_id
00160         length = len(_x)
00161         if python3 or type(_x) == unicode:
00162           _x = _x.encode('utf-8')
00163           length = len(_x)
00164         buff.write(struct.pack('<I%ss'%length, length, _x))
00165         length = len(val1.indices)
00166         buff.write(_struct_I.pack(length))
00167         pattern = '<%si'%length
00168         buff.write(val1.indices.tostring())
00169     except struct.error as se: self._check_types(se)
00170     except TypeError as te: self._check_types(te)
00171 
00172   def deserialize_numpy(self, str, numpy):
00173     """
00174     unpack serialized message in str into this message instance using numpy for array types
00175     :param str: byte array of serialized message, ``str``
00176     :param numpy: numpy python module
00177     """
00178     try:
00179       if self.cluster_indices is None:
00180         self.cluster_indices = None
00181       end = 0
00182       start = end
00183       end += 4
00184       (length,) = _struct_I.unpack(str[start:end])
00185       self.cluster_indices = []
00186       for i in range(0, length):
00187         val1 = pcl.msg.PointIndices()
00188         _v7 = val1.header
00189         start = end
00190         end += 4
00191         (_v7.seq,) = _struct_I.unpack(str[start:end])
00192         _v8 = _v7.stamp
00193         _x = _v8
00194         start = end
00195         end += 8
00196         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00197         start = end
00198         end += 4
00199         (length,) = _struct_I.unpack(str[start:end])
00200         start = end
00201         end += length
00202         if python3:
00203           _v7.frame_id = str[start:end].decode('utf-8')
00204         else:
00205           _v7.frame_id = str[start:end]
00206         start = end
00207         end += 4
00208         (length,) = _struct_I.unpack(str[start:end])
00209         pattern = '<%si'%length
00210         start = end
00211         end += struct.calcsize(pattern)
00212         val1.indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00213         self.cluster_indices.append(val1)
00214       return self
00215     except struct.error as e:
00216       raise genpy.DeserializationError(e) #most likely buffer underfill
00217 
00218 _struct_I = genpy.struct_I
00219 _struct_2I = struct.Struct("<2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


jsk_perception
Author(s): Manabu Saito
autogenerated on Sat Mar 23 2013 18:21:31