00001 """autogenerated by genmsg_py from Triangle.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class Triangle(roslib.message.Message):
00007 _md5sum = "4e5bc1f7ab41ceb0f12378d17f3b763d"
00008 _type = "triangle_mesh_msgs/Triangle"
00009 _has_header = False
00010 _full_text = """int32 i
00011 int32 j
00012 int32 k
00013
00014
00015
00016 """
00017 __slots__ = ['i','j','k']
00018 _slot_types = ['int32','int32','int32']
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 i,j,k
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(Triangle, self).__init__(*args, **kwds)
00036
00037 if self.i is None:
00038 self.i = 0
00039 if self.j is None:
00040 self.j = 0
00041 if self.k is None:
00042 self.k = 0
00043 else:
00044 self.i = 0
00045 self.j = 0
00046 self.k = 0
00047
00048 def _get_types(self):
00049 """
00050 internal API method
00051 """
00052 return self._slot_types
00053
00054 def serialize(self, buff):
00055 """
00056 serialize message into buffer
00057 @param buff: buffer
00058 @type buff: StringIO
00059 """
00060 try:
00061 _x = self
00062 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00063 except struct.error, se: self._check_types(se)
00064 except TypeError, te: self._check_types(te)
00065
00066 def deserialize(self, str):
00067 """
00068 unpack serialized message in str into this message instance
00069 @param str: byte array of serialized message
00070 @type str: str
00071 """
00072 try:
00073 end = 0
00074 _x = self
00075 start = end
00076 end += 12
00077 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00078 return self
00079 except struct.error, e:
00080 raise roslib.message.DeserializationError(e)
00081
00082
00083 def serialize_numpy(self, buff, numpy):
00084 """
00085 serialize message with numpy array types into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 @param numpy: numpy python module
00089 @type numpy module
00090 """
00091 try:
00092 _x = self
00093 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00094 except struct.error, se: self._check_types(se)
00095 except TypeError, te: self._check_types(te)
00096
00097 def deserialize_numpy(self, str, numpy):
00098 """
00099 unpack serialized message in str into this message instance using numpy for array types
00100 @param str: byte array of serialized message
00101 @type str: str
00102 @param numpy: numpy python module
00103 @type numpy: module
00104 """
00105 try:
00106 end = 0
00107 _x = self
00108 start = end
00109 end += 12
00110 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00111 return self
00112 except struct.error, e:
00113 raise roslib.message.DeserializationError(e)
00114
00115 _struct_I = roslib.message.struct_I
00116 _struct_3i = struct.Struct("<3i")