_TexCoordChannel.py
Go to the documentation of this file.
00001 """autogenerated by genpy from rve_msgs/TexCoordChannel.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 rve_msgs.msg
00008 
00009 class TexCoordChannel(genpy.Message):
00010   _md5sum = "931fde2fd4dc53c4992d9c67dbdc11c3"
00011   _type = "rve_msgs/TexCoordChannel"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """uint8 dims
00014 TexCoord[] array
00015 
00016 ================================================================================
00017 MSG: rve_msgs/TexCoord
00018 float32[3] uvw
00019 """
00020   __slots__ = ['dims','array']
00021   _slot_types = ['uint8','rve_msgs/TexCoord[]']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        dims,array
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(TexCoordChannel, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.dims is None:
00041         self.dims = 0
00042       if self.array is None:
00043         self.array = []
00044     else:
00045       self.dims = 0
00046       self.array = []
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, ``StringIO``
00058     """
00059     try:
00060       buff.write(_struct_B.pack(self.dims))
00061       length = len(self.array)
00062       buff.write(_struct_I.pack(length))
00063       for val1 in self.array:
00064         buff.write(_struct_3f.pack(*val1.uvw))
00065     except struct.error as se: self._check_types(se)
00066     except TypeError as te: self._check_types(te)
00067 
00068   def deserialize(self, str):
00069     """
00070     unpack serialized message in str into this message instance
00071     :param str: byte array of serialized message, ``str``
00072     """
00073     try:
00074       if self.array is None:
00075         self.array = None
00076       end = 0
00077       start = end
00078       end += 1
00079       (self.dims,) = _struct_B.unpack(str[start:end])
00080       start = end
00081       end += 4
00082       (length,) = _struct_I.unpack(str[start:end])
00083       self.array = []
00084       for i in range(0, length):
00085         val1 = rve_msgs.msg.TexCoord()
00086         start = end
00087         end += 12
00088         val1.uvw = _struct_3f.unpack(str[start:end])
00089         self.array.append(val1)
00090       return self
00091     except struct.error as e:
00092       raise genpy.DeserializationError(e) #most likely buffer underfill
00093 
00094 
00095   def serialize_numpy(self, buff, numpy):
00096     """
00097     serialize message with numpy array types into buffer
00098     :param buff: buffer, ``StringIO``
00099     :param numpy: numpy python module
00100     """
00101     try:
00102       buff.write(_struct_B.pack(self.dims))
00103       length = len(self.array)
00104       buff.write(_struct_I.pack(length))
00105       for val1 in self.array:
00106         buff.write(val1.uvw.tostring())
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize_numpy(self, str, numpy):
00111     """
00112     unpack serialized message in str into this message instance using numpy for array types
00113     :param str: byte array of serialized message, ``str``
00114     :param numpy: numpy python module
00115     """
00116     try:
00117       if self.array is None:
00118         self.array = None
00119       end = 0
00120       start = end
00121       end += 1
00122       (self.dims,) = _struct_B.unpack(str[start:end])
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       self.array = []
00127       for i in range(0, length):
00128         val1 = rve_msgs.msg.TexCoord()
00129         start = end
00130         end += 12
00131         val1.uvw = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00132         self.array.append(val1)
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 _struct_I = genpy.struct_I
00138 _struct_B = struct.Struct("<B")
00139 _struct_3f = struct.Struct("<3f")


rve_msgs
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:30:38