_markerCoords.py
Go to the documentation of this file.
00001 """autogenerated by genpy from youbot_overhead_vision/markerCoords.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 markerCoords(genpy.Message):
00009   _md5sum = "6adcba641c81e4270e82fb979abd382a"
00010   _type = "youbot_overhead_vision/markerCoords"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint32[] xCoords
00013 uint32[] yCoords
00014 
00015 """
00016   __slots__ = ['xCoords','yCoords']
00017   _slot_types = ['uint32[]','uint32[]']
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        xCoords,yCoords
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(markerCoords, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.xCoords is None:
00037         self.xCoords = []
00038       if self.yCoords is None:
00039         self.yCoords = []
00040     else:
00041       self.xCoords = []
00042       self.yCoords = []
00043 
00044   def _get_types(self):
00045     """
00046     internal API method
00047     """
00048     return self._slot_types
00049 
00050   def serialize(self, buff):
00051     """
00052     serialize message into buffer
00053     :param buff: buffer, ``StringIO``
00054     """
00055     try:
00056       length = len(self.xCoords)
00057       buff.write(_struct_I.pack(length))
00058       pattern = '<%sI'%length
00059       buff.write(struct.pack(pattern, *self.xCoords))
00060       length = len(self.yCoords)
00061       buff.write(_struct_I.pack(length))
00062       pattern = '<%sI'%length
00063       buff.write(struct.pack(pattern, *self.yCoords))
00064     except struct.error as se: self._check_types(se)
00065     except TypeError as te: self._check_types(te)
00066 
00067   def deserialize(self, str):
00068     """
00069     unpack serialized message in str into this message instance
00070     :param str: byte array of serialized message, ``str``
00071     """
00072     try:
00073       end = 0
00074       start = end
00075       end += 4
00076       (length,) = _struct_I.unpack(str[start:end])
00077       pattern = '<%sI'%length
00078       start = end
00079       end += struct.calcsize(pattern)
00080       self.xCoords = struct.unpack(pattern, str[start:end])
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.yCoords = struct.unpack(pattern, str[start:end])
00088       return self
00089     except struct.error as e:
00090       raise genpy.DeserializationError(e) #most likely buffer underfill
00091 
00092 
00093   def serialize_numpy(self, buff, numpy):
00094     """
00095     serialize message with numpy array types into buffer
00096     :param buff: buffer, ``StringIO``
00097     :param numpy: numpy python module
00098     """
00099     try:
00100       length = len(self.xCoords)
00101       buff.write(_struct_I.pack(length))
00102       pattern = '<%sI'%length
00103       buff.write(self.xCoords.tostring())
00104       length = len(self.yCoords)
00105       buff.write(_struct_I.pack(length))
00106       pattern = '<%sI'%length
00107       buff.write(self.yCoords.tostring())
00108     except struct.error as se: self._check_types(se)
00109     except TypeError as te: self._check_types(te)
00110 
00111   def deserialize_numpy(self, str, numpy):
00112     """
00113     unpack serialized message in str into this message instance using numpy for array types
00114     :param str: byte array of serialized message, ``str``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       end = 0
00119       start = end
00120       end += 4
00121       (length,) = _struct_I.unpack(str[start:end])
00122       pattern = '<%sI'%length
00123       start = end
00124       end += struct.calcsize(pattern)
00125       self.xCoords = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       pattern = '<%sI'%length
00130       start = end
00131       end += struct.calcsize(pattern)
00132       self.yCoords = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
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


youbot_overhead_vision
Author(s): Fred Clinckemaillie, Maintained by David Kent
autogenerated on Thu Jan 2 2014 12:14:12