Go to the documentation of this file.00001 """autogenerated by genpy from rve_msgs/TexCoord.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class TexCoord(genpy.Message):
00009 _md5sum = "9cffde96ab34ff718283d37bd870b6d4"
00010 _type = "rve_msgs/TexCoord"
00011 _has_header = False
00012 _full_text = """float32[3] uvw
00013 """
00014 __slots__ = ['uvw']
00015 _slot_types = ['float32[3]']
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 uvw
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(TexCoord, self).__init__(*args, **kwds)
00033
00034 if self.uvw is None:
00035 self.uvw = [0.,0.,0.]
00036 else:
00037 self.uvw = [0.,0.,0.]
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, ``StringIO``
00049 """
00050 try:
00051 buff.write(_struct_3f.pack(*self.uvw))
00052 except struct.error as se: self._check_types(se)
00053 except TypeError as te: self._check_types(te)
00054
00055 def deserialize(self, str):
00056 """
00057 unpack serialized message in str into this message instance
00058 :param str: byte array of serialized message, ``str``
00059 """
00060 try:
00061 end = 0
00062 start = end
00063 end += 12
00064 self.uvw = _struct_3f.unpack(str[start:end])
00065 return self
00066 except struct.error as e:
00067 raise genpy.DeserializationError(e)
00068
00069
00070 def serialize_numpy(self, buff, numpy):
00071 """
00072 serialize message with numpy array types into buffer
00073 :param buff: buffer, ``StringIO``
00074 :param numpy: numpy python module
00075 """
00076 try:
00077 buff.write(self.uvw.tostring())
00078 except struct.error as se: self._check_types(se)
00079 except TypeError as te: self._check_types(te)
00080
00081 def deserialize_numpy(self, str, numpy):
00082 """
00083 unpack serialized message in str into this message instance using numpy for array types
00084 :param str: byte array of serialized message, ``str``
00085 :param numpy: numpy python module
00086 """
00087 try:
00088 end = 0
00089 start = end
00090 end += 12
00091 self.uvw = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00092 return self
00093 except struct.error as e:
00094 raise genpy.DeserializationError(e)
00095
00096 _struct_I = genpy.struct_I
00097 _struct_3f = struct.Struct("<3f")