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