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


image_cb_detector
Author(s): Vijay Pradeep and Eitan Marder-Eppstein
autogenerated on Thu Aug 15 2013 10:15:24