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