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