Go to the documentation of this file.00001 """autogenerated by genpy from iri_perception_msgs/GeoVwSet.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 iri_perception_msgs.msg
00008
00009 class GeoVwSet(genpy.Message):
00010 _md5sum = "b756dd2b9516b315bb183bf5d4030e0b"
00011 _type = "iri_perception_msgs/GeoVwSet"
00012 _has_header = False
00013 _full_text = """iri_perception_msgs/GeoVw[] geo_vws
00014
00015 ================================================================================
00016 MSG: iri_perception_msgs/GeoVw
00017 uint32 x
00018 uint32 y
00019 uint32 word
00020 """
00021 __slots__ = ['geo_vws']
00022 _slot_types = ['iri_perception_msgs/GeoVw[]']
00023
00024 def __init__(self, *args, **kwds):
00025 """
00026 Constructor. Any message fields that are implicitly/explicitly
00027 set to None will be assigned a default value. The recommend
00028 use is keyword arguments as this is more robust to future message
00029 changes. You cannot mix in-order arguments and keyword arguments.
00030
00031 The available fields are:
00032 geo_vws
00033
00034 :param args: complete set of field values, in .msg order
00035 :param kwds: use keyword arguments corresponding to message field names
00036 to set specific fields.
00037 """
00038 if args or kwds:
00039 super(GeoVwSet, self).__init__(*args, **kwds)
00040
00041 if self.geo_vws is None:
00042 self.geo_vws = []
00043 else:
00044 self.geo_vws = []
00045
00046 def _get_types(self):
00047 """
00048 internal API method
00049 """
00050 return self._slot_types
00051
00052 def serialize(self, buff):
00053 """
00054 serialize message into buffer
00055 :param buff: buffer, ``StringIO``
00056 """
00057 try:
00058 length = len(self.geo_vws)
00059 buff.write(_struct_I.pack(length))
00060 for val1 in self.geo_vws:
00061 _x = val1
00062 buff.write(_struct_3I.pack(_x.x, _x.y, _x.word))
00063 except struct.error as se: self._check_types(se)
00064 except TypeError as 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, ``str``
00070 """
00071 try:
00072 if self.geo_vws is None:
00073 self.geo_vws = None
00074 end = 0
00075 start = end
00076 end += 4
00077 (length,) = _struct_I.unpack(str[start:end])
00078 self.geo_vws = []
00079 for i in range(0, length):
00080 val1 = iri_perception_msgs.msg.GeoVw()
00081 _x = val1
00082 start = end
00083 end += 12
00084 (_x.x, _x.y, _x.word,) = _struct_3I.unpack(str[start:end])
00085 self.geo_vws.append(val1)
00086 return self
00087 except struct.error as e:
00088 raise genpy.DeserializationError(e)
00089
00090
00091 def serialize_numpy(self, buff, numpy):
00092 """
00093 serialize message with numpy array types into buffer
00094 :param buff: buffer, ``StringIO``
00095 :param numpy: numpy python module
00096 """
00097 try:
00098 length = len(self.geo_vws)
00099 buff.write(_struct_I.pack(length))
00100 for val1 in self.geo_vws:
00101 _x = val1
00102 buff.write(_struct_3I.pack(_x.x, _x.y, _x.word))
00103 except struct.error as se: self._check_types(se)
00104 except TypeError as te: self._check_types(te)
00105
00106 def deserialize_numpy(self, str, numpy):
00107 """
00108 unpack serialized message in str into this message instance using numpy for array types
00109 :param str: byte array of serialized message, ``str``
00110 :param numpy: numpy python module
00111 """
00112 try:
00113 if self.geo_vws is None:
00114 self.geo_vws = None
00115 end = 0
00116 start = end
00117 end += 4
00118 (length,) = _struct_I.unpack(str[start:end])
00119 self.geo_vws = []
00120 for i in range(0, length):
00121 val1 = iri_perception_msgs.msg.GeoVw()
00122 _x = val1
00123 start = end
00124 end += 12
00125 (_x.x, _x.y, _x.word,) = _struct_3I.unpack(str[start:end])
00126 self.geo_vws.append(val1)
00127 return self
00128 except struct.error as e:
00129 raise genpy.DeserializationError(e)
00130
00131 _struct_I = genpy.struct_I
00132 _struct_3I = struct.Struct("<3I")