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