00001 """autogenerated by genmsg_py from Vertices.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class Vertices(roslib.message.Message):
00007 _md5sum = "39bd7b1c23763ddd1b882b97cb7cfe11"
00008 _type = "pcl/Vertices"
00009 _has_header = False
00010 _full_text = """# List of point indices
00011 uint32[] vertices
00012
00013 """
00014 __slots__ = ['vertices']
00015 _slot_types = ['uint32[]']
00016
00017 def __init__(self, *args, **kwds):
00018 """
00019 Constructor. Any message fields that are implicitly/explicitly
00020 set to None will be assigned a default value. The recommend
00021 use is keyword arguments as this is more robust to future message
00022 changes. You cannot mix in-order arguments and keyword arguments.
00023
00024 The available fields are:
00025 vertices
00026
00027 @param args: complete set of field values, in .msg order
00028 @param kwds: use keyword arguments corresponding to message field names
00029 to set specific fields.
00030 """
00031 if args or kwds:
00032 super(Vertices, self).__init__(*args, **kwds)
00033
00034 if self.vertices is None:
00035 self.vertices = []
00036 else:
00037 self.vertices = []
00038
00039 def _get_types(self):
00040 """
00041 internal API method
00042 """
00043 return self._slot_types
00044
00045 def serialize(self, buff):
00046 """
00047 serialize message into buffer
00048 @param buff: buffer
00049 @type buff: StringIO
00050 """
00051 try:
00052 length = len(self.vertices)
00053 buff.write(_struct_I.pack(length))
00054 pattern = '<%sI'%length
00055 buff.write(struct.pack(pattern, *self.vertices))
00056 except struct.error, se: self._check_types(se)
00057 except TypeError, te: self._check_types(te)
00058
00059 def deserialize(self, str):
00060 """
00061 unpack serialized message in str into this message instance
00062 @param str: byte array of serialized message
00063 @type str: str
00064 """
00065 try:
00066 end = 0
00067 start = end
00068 end += 4
00069 (length,) = _struct_I.unpack(str[start:end])
00070 pattern = '<%sI'%length
00071 start = end
00072 end += struct.calcsize(pattern)
00073 self.vertices = struct.unpack(pattern, str[start:end])
00074 return self
00075 except struct.error, e:
00076 raise roslib.message.DeserializationError(e)
00077
00078
00079 def serialize_numpy(self, buff, numpy):
00080 """
00081 serialize message with numpy array types into buffer
00082 @param buff: buffer
00083 @type buff: StringIO
00084 @param numpy: numpy python module
00085 @type numpy module
00086 """
00087 try:
00088 length = len(self.vertices)
00089 buff.write(_struct_I.pack(length))
00090 pattern = '<%sI'%length
00091 buff.write(self.vertices.tostring())
00092 except struct.error, se: self._check_types(se)
00093 except TypeError, te: self._check_types(te)
00094
00095 def deserialize_numpy(self, str, numpy):
00096 """
00097 unpack serialized message in str into this message instance using numpy for array types
00098 @param str: byte array of serialized message
00099 @type str: str
00100 @param numpy: numpy python module
00101 @type numpy: module
00102 """
00103 try:
00104 end = 0
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 pattern = '<%sI'%length
00109 start = end
00110 end += struct.calcsize(pattern)
00111 self.vertices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00112 return self
00113 except struct.error, e:
00114 raise roslib.message.DeserializationError(e)
00115
00116 _struct_I = roslib.message.struct_I