_RawTaxelArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from m3skin_ros/RawTaxelArray.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 RawTaxelArray(genpy.Message):
00009   _md5sum = "1078c899afa1bb5160db1c238588246d"
00010   _type = "m3skin_ros/RawTaxelArray"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32[] val_x
00013 int32[] val_y
00014 int32[] val_z
00015 """
00016   __slots__ = ['val_x','val_y','val_z']
00017   _slot_types = ['int32[]','int32[]','int32[]']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        val_x,val_y,val_z
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(RawTaxelArray, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.val_x is None:
00037         self.val_x = []
00038       if self.val_y is None:
00039         self.val_y = []
00040       if self.val_z is None:
00041         self.val_z = []
00042     else:
00043       self.val_x = []
00044       self.val_y = []
00045       self.val_z = []
00046 
00047   def _get_types(self):
00048     """
00049     internal API method
00050     """
00051     return self._slot_types
00052 
00053   def serialize(self, buff):
00054     """
00055     serialize message into buffer
00056     :param buff: buffer, ``StringIO``
00057     """
00058     try:
00059       length = len(self.val_x)
00060       buff.write(_struct_I.pack(length))
00061       pattern = '<%si'%length
00062       buff.write(struct.pack(pattern, *self.val_x))
00063       length = len(self.val_y)
00064       buff.write(_struct_I.pack(length))
00065       pattern = '<%si'%length
00066       buff.write(struct.pack(pattern, *self.val_y))
00067       length = len(self.val_z)
00068       buff.write(_struct_I.pack(length))
00069       pattern = '<%si'%length
00070       buff.write(struct.pack(pattern, *self.val_z))
00071     except struct.error as se: self._check_types(se)
00072     except TypeError as te: self._check_types(te)
00073 
00074   def deserialize(self, str):
00075     """
00076     unpack serialized message in str into this message instance
00077     :param str: byte array of serialized message, ``str``
00078     """
00079     try:
00080       end = 0
00081       start = end
00082       end += 4
00083       (length,) = _struct_I.unpack(str[start:end])
00084       pattern = '<%si'%length
00085       start = end
00086       end += struct.calcsize(pattern)
00087       self.val_x = struct.unpack(pattern, str[start:end])
00088       start = end
00089       end += 4
00090       (length,) = _struct_I.unpack(str[start:end])
00091       pattern = '<%si'%length
00092       start = end
00093       end += struct.calcsize(pattern)
00094       self.val_y = struct.unpack(pattern, str[start:end])
00095       start = end
00096       end += 4
00097       (length,) = _struct_I.unpack(str[start:end])
00098       pattern = '<%si'%length
00099       start = end
00100       end += struct.calcsize(pattern)
00101       self.val_z = struct.unpack(pattern, str[start:end])
00102       return self
00103     except struct.error as e:
00104       raise genpy.DeserializationError(e) #most likely buffer underfill
00105 
00106 
00107   def serialize_numpy(self, buff, numpy):
00108     """
00109     serialize message with numpy array types into buffer
00110     :param buff: buffer, ``StringIO``
00111     :param numpy: numpy python module
00112     """
00113     try:
00114       length = len(self.val_x)
00115       buff.write(_struct_I.pack(length))
00116       pattern = '<%si'%length
00117       buff.write(self.val_x.tostring())
00118       length = len(self.val_y)
00119       buff.write(_struct_I.pack(length))
00120       pattern = '<%si'%length
00121       buff.write(self.val_y.tostring())
00122       length = len(self.val_z)
00123       buff.write(_struct_I.pack(length))
00124       pattern = '<%si'%length
00125       buff.write(self.val_z.tostring())
00126     except struct.error as se: self._check_types(se)
00127     except TypeError as te: self._check_types(te)
00128 
00129   def deserialize_numpy(self, str, numpy):
00130     """
00131     unpack serialized message in str into this message instance using numpy for array types
00132     :param str: byte array of serialized message, ``str``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       end = 0
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       pattern = '<%si'%length
00141       start = end
00142       end += struct.calcsize(pattern)
00143       self.val_x = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00144       start = end
00145       end += 4
00146       (length,) = _struct_I.unpack(str[start:end])
00147       pattern = '<%si'%length
00148       start = end
00149       end += struct.calcsize(pattern)
00150       self.val_y = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00151       start = end
00152       end += 4
00153       (length,) = _struct_I.unpack(str[start:end])
00154       pattern = '<%si'%length
00155       start = end
00156       end += struct.calcsize(pattern)
00157       self.val_z = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 _struct_I = genpy.struct_I


m3skin_ros
Author(s): Meka Robotics
autogenerated on Wed Nov 27 2013 11:34:26