_CalibrationPattern.py
Go to the documentation of this file.
00001 """autogenerated by genpy from calibration_msgs/CalibrationPattern.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 geometry_msgs.msg
00008 import std_msgs.msg
00009 
00010 class CalibrationPattern(genpy.Message):
00011   _md5sum = "5854af5462e19a169f68917c875a6238"
00012   _type = "calibration_msgs/CalibrationPattern"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 geometry_msgs/Point[] object_points
00016 geometry_msgs/Point[] image_points
00017 uint8 success
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 ================================================================================
00038 MSG: geometry_msgs/Point
00039 # This contains the position of a point in free space
00040 float64 x
00041 float64 y
00042 float64 z
00043 
00044 """
00045   __slots__ = ['header','object_points','image_points','success']
00046   _slot_types = ['std_msgs/Header','geometry_msgs/Point[]','geometry_msgs/Point[]','uint8']
00047 
00048   def __init__(self, *args, **kwds):
00049     """
00050     Constructor. Any message fields that are implicitly/explicitly
00051     set to None will be assigned a default value. The recommend
00052     use is keyword arguments as this is more robust to future message
00053     changes.  You cannot mix in-order arguments and keyword arguments.
00054 
00055     The available fields are:
00056        header,object_points,image_points,success
00057 
00058     :param args: complete set of field values, in .msg order
00059     :param kwds: use keyword arguments corresponding to message field names
00060     to set specific fields.
00061     """
00062     if args or kwds:
00063       super(CalibrationPattern, self).__init__(*args, **kwds)
00064       #message fields cannot be None, assign default values for those that are
00065       if self.header is None:
00066         self.header = std_msgs.msg.Header()
00067       if self.object_points is None:
00068         self.object_points = []
00069       if self.image_points is None:
00070         self.image_points = []
00071       if self.success is None:
00072         self.success = 0
00073     else:
00074       self.header = std_msgs.msg.Header()
00075       self.object_points = []
00076       self.image_points = []
00077       self.success = 0
00078 
00079   def _get_types(self):
00080     """
00081     internal API method
00082     """
00083     return self._slot_types
00084 
00085   def serialize(self, buff):
00086     """
00087     serialize message into buffer
00088     :param buff: buffer, ``StringIO``
00089     """
00090     try:
00091       _x = self
00092       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00093       _x = self.header.frame_id
00094       length = len(_x)
00095       if python3 or type(_x) == unicode:
00096         _x = _x.encode('utf-8')
00097         length = len(_x)
00098       buff.write(struct.pack('<I%ss'%length, length, _x))
00099       length = len(self.object_points)
00100       buff.write(_struct_I.pack(length))
00101       for val1 in self.object_points:
00102         _x = val1
00103         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00104       length = len(self.image_points)
00105       buff.write(_struct_I.pack(length))
00106       for val1 in self.image_points:
00107         _x = val1
00108         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00109       buff.write(_struct_B.pack(self.success))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize(self, str):
00114     """
00115     unpack serialized message in str into this message instance
00116     :param str: byte array of serialized message, ``str``
00117     """
00118     try:
00119       if self.header is None:
00120         self.header = std_msgs.msg.Header()
00121       if self.object_points is None:
00122         self.object_points = None
00123       if self.image_points is None:
00124         self.image_points = None
00125       end = 0
00126       _x = self
00127       start = end
00128       end += 12
00129       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00130       start = end
00131       end += 4
00132       (length,) = _struct_I.unpack(str[start:end])
00133       start = end
00134       end += length
00135       if python3:
00136         self.header.frame_id = str[start:end].decode('utf-8')
00137       else:
00138         self.header.frame_id = str[start:end]
00139       start = end
00140       end += 4
00141       (length,) = _struct_I.unpack(str[start:end])
00142       self.object_points = []
00143       for i in range(0, length):
00144         val1 = geometry_msgs.msg.Point()
00145         _x = val1
00146         start = end
00147         end += 24
00148         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00149         self.object_points.append(val1)
00150       start = end
00151       end += 4
00152       (length,) = _struct_I.unpack(str[start:end])
00153       self.image_points = []
00154       for i in range(0, length):
00155         val1 = geometry_msgs.msg.Point()
00156         _x = val1
00157         start = end
00158         end += 24
00159         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00160         self.image_points.append(val1)
00161       start = end
00162       end += 1
00163       (self.success,) = _struct_B.unpack(str[start:end])
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 
00169   def serialize_numpy(self, buff, numpy):
00170     """
00171     serialize message with numpy array types into buffer
00172     :param buff: buffer, ``StringIO``
00173     :param numpy: numpy python module
00174     """
00175     try:
00176       _x = self
00177       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00178       _x = self.header.frame_id
00179       length = len(_x)
00180       if python3 or type(_x) == unicode:
00181         _x = _x.encode('utf-8')
00182         length = len(_x)
00183       buff.write(struct.pack('<I%ss'%length, length, _x))
00184       length = len(self.object_points)
00185       buff.write(_struct_I.pack(length))
00186       for val1 in self.object_points:
00187         _x = val1
00188         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00189       length = len(self.image_points)
00190       buff.write(_struct_I.pack(length))
00191       for val1 in self.image_points:
00192         _x = val1
00193         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00194       buff.write(_struct_B.pack(self.success))
00195     except struct.error as se: self._check_types(se)
00196     except TypeError as te: self._check_types(te)
00197 
00198   def deserialize_numpy(self, str, numpy):
00199     """
00200     unpack serialized message in str into this message instance using numpy for array types
00201     :param str: byte array of serialized message, ``str``
00202     :param numpy: numpy python module
00203     """
00204     try:
00205       if self.header is None:
00206         self.header = std_msgs.msg.Header()
00207       if self.object_points is None:
00208         self.object_points = None
00209       if self.image_points is None:
00210         self.image_points = None
00211       end = 0
00212       _x = self
00213       start = end
00214       end += 12
00215       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00216       start = end
00217       end += 4
00218       (length,) = _struct_I.unpack(str[start:end])
00219       start = end
00220       end += length
00221       if python3:
00222         self.header.frame_id = str[start:end].decode('utf-8')
00223       else:
00224         self.header.frame_id = str[start:end]
00225       start = end
00226       end += 4
00227       (length,) = _struct_I.unpack(str[start:end])
00228       self.object_points = []
00229       for i in range(0, length):
00230         val1 = geometry_msgs.msg.Point()
00231         _x = val1
00232         start = end
00233         end += 24
00234         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00235         self.object_points.append(val1)
00236       start = end
00237       end += 4
00238       (length,) = _struct_I.unpack(str[start:end])
00239       self.image_points = []
00240       for i in range(0, length):
00241         val1 = geometry_msgs.msg.Point()
00242         _x = val1
00243         start = end
00244         end += 24
00245         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00246         self.image_points.append(val1)
00247       start = end
00248       end += 1
00249       (self.success,) = _struct_B.unpack(str[start:end])
00250       return self
00251     except struct.error as e:
00252       raise genpy.DeserializationError(e) #most likely buffer underfill
00253 
00254 _struct_I = genpy.struct_I
00255 _struct_3I = struct.Struct("<3I")
00256 _struct_B = struct.Struct("<B")
00257 _struct_3d = struct.Struct("<3d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


calibration_msgs
Author(s): Vijay Pradeep
autogenerated on Thu Aug 15 2013 10:15:15