00001 """autogenerated by genmsg_py from PointIndices.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class PointIndices(roslib.message.Message):
00008 _md5sum = "458c7998b7eaf99908256472e273b3d4"
00009 _type = "pcl/PointIndices"
00010 _has_header = True
00011 _full_text = """Header header
00012 int32[] indices
00013
00014
00015 ================================================================================
00016 MSG: std_msgs/Header
00017 # Standard metadata for higher-level stamped data types.
00018 # This is generally used to communicate timestamped data
00019 # in a particular coordinate frame.
00020 #
00021 # sequence ID: consecutively increasing ID
00022 uint32 seq
00023 #Two-integer timestamp that is expressed as:
00024 # * stamp.secs: seconds (stamp_secs) since epoch
00025 # * stamp.nsecs: nanoseconds since stamp_secs
00026 # time-handling sugar is provided by the client library
00027 time stamp
00028 #Frame this data is associated with
00029 # 0: no frame
00030 # 1: global frame
00031 string frame_id
00032
00033 """
00034 __slots__ = ['header','indices']
00035 _slot_types = ['Header','int32[]']
00036
00037 def __init__(self, *args, **kwds):
00038 """
00039 Constructor. Any message fields that are implicitly/explicitly
00040 set to None will be assigned a default value. The recommend
00041 use is keyword arguments as this is more robust to future message
00042 changes. You cannot mix in-order arguments and keyword arguments.
00043
00044 The available fields are:
00045 header,indices
00046
00047 @param args: complete set of field values, in .msg order
00048 @param kwds: use keyword arguments corresponding to message field names
00049 to set specific fields.
00050 """
00051 if args or kwds:
00052 super(PointIndices, self).__init__(*args, **kwds)
00053
00054 if self.header is None:
00055 self.header = std_msgs.msg._Header.Header()
00056 if self.indices is None:
00057 self.indices = []
00058 else:
00059 self.header = std_msgs.msg._Header.Header()
00060 self.indices = []
00061
00062 def _get_types(self):
00063 """
00064 internal API method
00065 """
00066 return self._slot_types
00067
00068 def serialize(self, buff):
00069 """
00070 serialize message into buffer
00071 @param buff: buffer
00072 @type buff: StringIO
00073 """
00074 try:
00075 _x = self
00076 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00077 _x = self.header.frame_id
00078 length = len(_x)
00079 buff.write(struct.pack('<I%ss'%length, length, _x))
00080 length = len(self.indices)
00081 buff.write(_struct_I.pack(length))
00082 pattern = '<%si'%length
00083 buff.write(struct.pack(pattern, *self.indices))
00084 except struct.error, se: self._check_types(se)
00085 except TypeError, te: self._check_types(te)
00086
00087 def deserialize(self, str):
00088 """
00089 unpack serialized message in str into this message instance
00090 @param str: byte array of serialized message
00091 @type str: str
00092 """
00093 try:
00094 if self.header is None:
00095 self.header = std_msgs.msg._Header.Header()
00096 end = 0
00097 _x = self
00098 start = end
00099 end += 12
00100 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00101 start = end
00102 end += 4
00103 (length,) = _struct_I.unpack(str[start:end])
00104 start = end
00105 end += length
00106 self.header.frame_id = str[start:end]
00107 start = end
00108 end += 4
00109 (length,) = _struct_I.unpack(str[start:end])
00110 pattern = '<%si'%length
00111 start = end
00112 end += struct.calcsize(pattern)
00113 self.indices = struct.unpack(pattern, str[start:end])
00114 return self
00115 except struct.error, e:
00116 raise roslib.message.DeserializationError(e)
00117
00118
00119 def serialize_numpy(self, buff, numpy):
00120 """
00121 serialize message with numpy array types into buffer
00122 @param buff: buffer
00123 @type buff: StringIO
00124 @param numpy: numpy python module
00125 @type numpy module
00126 """
00127 try:
00128 _x = self
00129 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00130 _x = self.header.frame_id
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 length = len(self.indices)
00134 buff.write(_struct_I.pack(length))
00135 pattern = '<%si'%length
00136 buff.write(self.indices.tostring())
00137 except struct.error, se: self._check_types(se)
00138 except TypeError, te: self._check_types(te)
00139
00140 def deserialize_numpy(self, str, numpy):
00141 """
00142 unpack serialized message in str into this message instance using numpy for array types
00143 @param str: byte array of serialized message
00144 @type str: str
00145 @param numpy: numpy python module
00146 @type numpy: module
00147 """
00148 try:
00149 if self.header is None:
00150 self.header = std_msgs.msg._Header.Header()
00151 end = 0
00152 _x = self
00153 start = end
00154 end += 12
00155 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.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 self.header.frame_id = str[start:end]
00162 start = end
00163 end += 4
00164 (length,) = _struct_I.unpack(str[start:end])
00165 pattern = '<%si'%length
00166 start = end
00167 end += struct.calcsize(pattern)
00168 self.indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00169 return self
00170 except struct.error, e:
00171 raise roslib.message.DeserializationError(e)
00172
00173 _struct_I = roslib.message.struct_I
00174 _struct_3I = struct.Struct("<3I")