00001 """autogenerated by genpy from visp_camera_calibration/ImageAndPoints.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 sensor_msgs.msg
00008 import visp_camera_calibration.msg
00009 import std_msgs.msg
00010
00011 class ImageAndPoints(genpy.Message):
00012 _md5sum = "0fea5fc0844344ec4ec1adadebd18f75"
00013 _type = "visp_camera_calibration/ImageAndPoints"
00014 _has_header = True
00015 _full_text = """# An image with an array of 2D points selected in the image
00016
00017 Header header
00018
00019 sensor_msgs/Image image
00020 visp_camera_calibration/ImagePoint[] points
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: sensor_msgs/Image
00042 # This message contains an uncompressed image
00043 # (0, 0) is at top-left corner of image
00044 #
00045
00046 Header header # Header timestamp should be acquisition time of image
00047 # Header frame_id should be optical frame of camera
00048 # origin of frame should be optical center of cameara
00049 # +x should point to the right in the image
00050 # +y should point down in the image
00051 # +z should point into to plane of the image
00052 # If the frame_id here and the frame_id of the CameraInfo
00053 # message associated with the image conflict
00054 # the behavior is undefined
00055
00056 uint32 height # image height, that is, number of rows
00057 uint32 width # image width, that is, number of columns
00058
00059 # The legal values for encoding are in file src/image_encodings.cpp
00060 # If you want to standardize a new string format, join
00061 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00062
00063 string encoding # Encoding of pixels -- channel meaning, ordering, size
00064 # taken from the list of strings in src/image_encodings.cpp
00065
00066 uint8 is_bigendian # is this data bigendian?
00067 uint32 step # Full row length in bytes
00068 uint8[] data # actual matrix data, size is (step * rows)
00069
00070 ================================================================================
00071 MSG: visp_camera_calibration/ImagePoint
00072 # a point (pixel coordinates) selected in an image
00073
00074 int32 x
00075 int32 y
00076
00077 """
00078 __slots__ = ['header','image','points']
00079 _slot_types = ['std_msgs/Header','sensor_msgs/Image','visp_camera_calibration/ImagePoint[]']
00080
00081 def __init__(self, *args, **kwds):
00082 """
00083 Constructor. Any message fields that are implicitly/explicitly
00084 set to None will be assigned a default value. The recommend
00085 use is keyword arguments as this is more robust to future message
00086 changes. You cannot mix in-order arguments and keyword arguments.
00087
00088 The available fields are:
00089 header,image,points
00090
00091 :param args: complete set of field values, in .msg order
00092 :param kwds: use keyword arguments corresponding to message field names
00093 to set specific fields.
00094 """
00095 if args or kwds:
00096 super(ImageAndPoints, self).__init__(*args, **kwds)
00097
00098 if self.header is None:
00099 self.header = std_msgs.msg.Header()
00100 if self.image is None:
00101 self.image = sensor_msgs.msg.Image()
00102 if self.points is None:
00103 self.points = []
00104 else:
00105 self.header = std_msgs.msg.Header()
00106 self.image = sensor_msgs.msg.Image()
00107 self.points = []
00108
00109 def _get_types(self):
00110 """
00111 internal API method
00112 """
00113 return self._slot_types
00114
00115 def serialize(self, buff):
00116 """
00117 serialize message into buffer
00118 :param buff: buffer, ``StringIO``
00119 """
00120 try:
00121 _x = self
00122 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00123 _x = self.header.frame_id
00124 length = len(_x)
00125 if python3 or type(_x) == unicode:
00126 _x = _x.encode('utf-8')
00127 length = len(_x)
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 _x = self
00130 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00131 _x = self.image.header.frame_id
00132 length = len(_x)
00133 if python3 or type(_x) == unicode:
00134 _x = _x.encode('utf-8')
00135 length = len(_x)
00136 buff.write(struct.pack('<I%ss'%length, length, _x))
00137 _x = self
00138 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00139 _x = self.image.encoding
00140 length = len(_x)
00141 if python3 or type(_x) == unicode:
00142 _x = _x.encode('utf-8')
00143 length = len(_x)
00144 buff.write(struct.pack('<I%ss'%length, length, _x))
00145 _x = self
00146 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00147 _x = self.image.data
00148 length = len(_x)
00149
00150 if type(_x) in [list, tuple]:
00151 buff.write(struct.pack('<I%sB'%length, length, *_x))
00152 else:
00153 buff.write(struct.pack('<I%ss'%length, length, _x))
00154 length = len(self.points)
00155 buff.write(_struct_I.pack(length))
00156 for val1 in self.points:
00157 _x = val1
00158 buff.write(_struct_2i.pack(_x.x, _x.y))
00159 except struct.error as se: self._check_types(se)
00160 except TypeError as te: self._check_types(te)
00161
00162 def deserialize(self, str):
00163 """
00164 unpack serialized message in str into this message instance
00165 :param str: byte array of serialized message, ``str``
00166 """
00167 try:
00168 if self.header is None:
00169 self.header = std_msgs.msg.Header()
00170 if self.image is None:
00171 self.image = sensor_msgs.msg.Image()
00172 if self.points is None:
00173 self.points = None
00174 end = 0
00175 _x = self
00176 start = end
00177 end += 12
00178 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 self.header.frame_id = str[start:end].decode('utf-8')
00186 else:
00187 self.header.frame_id = str[start:end]
00188 _x = self
00189 start = end
00190 end += 12
00191 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 start = end
00196 end += length
00197 if python3:
00198 self.image.header.frame_id = str[start:end].decode('utf-8')
00199 else:
00200 self.image.header.frame_id = str[start:end]
00201 _x = self
00202 start = end
00203 end += 8
00204 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00205 start = end
00206 end += 4
00207 (length,) = _struct_I.unpack(str[start:end])
00208 start = end
00209 end += length
00210 if python3:
00211 self.image.encoding = str[start:end].decode('utf-8')
00212 else:
00213 self.image.encoding = str[start:end]
00214 _x = self
00215 start = end
00216 end += 5
00217 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 start = end
00222 end += length
00223 if python3:
00224 self.image.data = str[start:end].decode('utf-8')
00225 else:
00226 self.image.data = str[start:end]
00227 start = end
00228 end += 4
00229 (length,) = _struct_I.unpack(str[start:end])
00230 self.points = []
00231 for i in range(0, length):
00232 val1 = visp_camera_calibration.msg.ImagePoint()
00233 _x = val1
00234 start = end
00235 end += 8
00236 (_x.x, _x.y,) = _struct_2i.unpack(str[start:end])
00237 self.points.append(val1)
00238 return self
00239 except struct.error as e:
00240 raise genpy.DeserializationError(e)
00241
00242
00243 def serialize_numpy(self, buff, numpy):
00244 """
00245 serialize message with numpy array types into buffer
00246 :param buff: buffer, ``StringIO``
00247 :param numpy: numpy python module
00248 """
00249 try:
00250 _x = self
00251 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00252 _x = self.header.frame_id
00253 length = len(_x)
00254 if python3 or type(_x) == unicode:
00255 _x = _x.encode('utf-8')
00256 length = len(_x)
00257 buff.write(struct.pack('<I%ss'%length, length, _x))
00258 _x = self
00259 buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00260 _x = self.image.header.frame_id
00261 length = len(_x)
00262 if python3 or type(_x) == unicode:
00263 _x = _x.encode('utf-8')
00264 length = len(_x)
00265 buff.write(struct.pack('<I%ss'%length, length, _x))
00266 _x = self
00267 buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00268 _x = self.image.encoding
00269 length = len(_x)
00270 if python3 or type(_x) == unicode:
00271 _x = _x.encode('utf-8')
00272 length = len(_x)
00273 buff.write(struct.pack('<I%ss'%length, length, _x))
00274 _x = self
00275 buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00276 _x = self.image.data
00277 length = len(_x)
00278
00279 if type(_x) in [list, tuple]:
00280 buff.write(struct.pack('<I%sB'%length, length, *_x))
00281 else:
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 length = len(self.points)
00284 buff.write(_struct_I.pack(length))
00285 for val1 in self.points:
00286 _x = val1
00287 buff.write(_struct_2i.pack(_x.x, _x.y))
00288 except struct.error as se: self._check_types(se)
00289 except TypeError as te: self._check_types(te)
00290
00291 def deserialize_numpy(self, str, numpy):
00292 """
00293 unpack serialized message in str into this message instance using numpy for array types
00294 :param str: byte array of serialized message, ``str``
00295 :param numpy: numpy python module
00296 """
00297 try:
00298 if self.header is None:
00299 self.header = std_msgs.msg.Header()
00300 if self.image is None:
00301 self.image = sensor_msgs.msg.Image()
00302 if self.points is None:
00303 self.points = None
00304 end = 0
00305 _x = self
00306 start = end
00307 end += 12
00308 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00309 start = end
00310 end += 4
00311 (length,) = _struct_I.unpack(str[start:end])
00312 start = end
00313 end += length
00314 if python3:
00315 self.header.frame_id = str[start:end].decode('utf-8')
00316 else:
00317 self.header.frame_id = str[start:end]
00318 _x = self
00319 start = end
00320 end += 12
00321 (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00322 start = end
00323 end += 4
00324 (length,) = _struct_I.unpack(str[start:end])
00325 start = end
00326 end += length
00327 if python3:
00328 self.image.header.frame_id = str[start:end].decode('utf-8')
00329 else:
00330 self.image.header.frame_id = str[start:end]
00331 _x = self
00332 start = end
00333 end += 8
00334 (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00335 start = end
00336 end += 4
00337 (length,) = _struct_I.unpack(str[start:end])
00338 start = end
00339 end += length
00340 if python3:
00341 self.image.encoding = str[start:end].decode('utf-8')
00342 else:
00343 self.image.encoding = str[start:end]
00344 _x = self
00345 start = end
00346 end += 5
00347 (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00348 start = end
00349 end += 4
00350 (length,) = _struct_I.unpack(str[start:end])
00351 start = end
00352 end += length
00353 if python3:
00354 self.image.data = str[start:end].decode('utf-8')
00355 else:
00356 self.image.data = str[start:end]
00357 start = end
00358 end += 4
00359 (length,) = _struct_I.unpack(str[start:end])
00360 self.points = []
00361 for i in range(0, length):
00362 val1 = visp_camera_calibration.msg.ImagePoint()
00363 _x = val1
00364 start = end
00365 end += 8
00366 (_x.x, _x.y,) = _struct_2i.unpack(str[start:end])
00367 self.points.append(val1)
00368 return self
00369 except struct.error as e:
00370 raise genpy.DeserializationError(e)
00371
00372 _struct_I = genpy.struct_I
00373 _struct_2i = struct.Struct("<2i")
00374 _struct_3I = struct.Struct("<3I")
00375 _struct_2I = struct.Struct("<2I")
00376 _struct_BI = struct.Struct("<BI")