00001 """autogenerated by genmsg_py from FaceDetectorResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import people_msgs.msg
00006 import geometry_msgs.msg
00007 import std_msgs.msg
00008
00009 class FaceDetectorResult(roslib.message.Message):
00010 _md5sum = "b5dc843df183dbab7f0ab2f5ef5b6f9d"
00011 _type = "face_detector/FaceDetectorResult"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 #result
00015 people_msgs/PositionMeasurement[] face_positions
00016
00017 ================================================================================
00018 MSG: people_msgs/PositionMeasurement
00019 Header header
00020 string name
00021 string object_id
00022 geometry_msgs/Point pos
00023 float64 reliability
00024 float64[9] covariance
00025 byte initialization
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data
00030 # in a particular coordinate frame.
00031 #
00032 # sequence ID: consecutively increasing ID
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043
00044 ================================================================================
00045 MSG: geometry_msgs/Point
00046 # This contains the position of a point in free space
00047 float64 x
00048 float64 y
00049 float64 z
00050
00051 """
00052 __slots__ = ['face_positions']
00053 _slot_types = ['people_msgs/PositionMeasurement[]']
00054
00055 def __init__(self, *args, **kwds):
00056 """
00057 Constructor. Any message fields that are implicitly/explicitly
00058 set to None will be assigned a default value. The recommend
00059 use is keyword arguments as this is more robust to future message
00060 changes. You cannot mix in-order arguments and keyword arguments.
00061
00062 The available fields are:
00063 face_positions
00064
00065 @param args: complete set of field values, in .msg order
00066 @param kwds: use keyword arguments corresponding to message field names
00067 to set specific fields.
00068 """
00069 if args or kwds:
00070 super(FaceDetectorResult, self).__init__(*args, **kwds)
00071
00072 if self.face_positions is None:
00073 self.face_positions = []
00074 else:
00075 self.face_positions = []
00076
00077 def _get_types(self):
00078 """
00079 internal API method
00080 """
00081 return self._slot_types
00082
00083 def serialize(self, buff):
00084 """
00085 serialize message into buffer
00086 @param buff: buffer
00087 @type buff: StringIO
00088 """
00089 try:
00090 length = len(self.face_positions)
00091 buff.write(_struct_I.pack(length))
00092 for val1 in self.face_positions:
00093 _v1 = val1.header
00094 buff.write(_struct_I.pack(_v1.seq))
00095 _v2 = _v1.stamp
00096 _x = _v2
00097 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00098 _x = _v1.frame_id
00099 length = len(_x)
00100 buff.write(struct.pack('<I%ss'%length, length, _x))
00101 _x = val1.name
00102 length = len(_x)
00103 buff.write(struct.pack('<I%ss'%length, length, _x))
00104 _x = val1.object_id
00105 length = len(_x)
00106 buff.write(struct.pack('<I%ss'%length, length, _x))
00107 _v3 = val1.pos
00108 _x = _v3
00109 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00110 buff.write(_struct_d.pack(val1.reliability))
00111 buff.write(_struct_9d.pack(*val1.covariance))
00112 buff.write(_struct_b.pack(val1.initialization))
00113 except struct.error, se: self._check_types(se)
00114 except TypeError, te: self._check_types(te)
00115
00116 def deserialize(self, str):
00117 """
00118 unpack serialized message in str into this message instance
00119 @param str: byte array of serialized message
00120 @type str: str
00121 """
00122 try:
00123 end = 0
00124 start = end
00125 end += 4
00126 (length,) = _struct_I.unpack(str[start:end])
00127 self.face_positions = []
00128 for i in xrange(0, length):
00129 val1 = people_msgs.msg.PositionMeasurement()
00130 _v4 = val1.header
00131 start = end
00132 end += 4
00133 (_v4.seq,) = _struct_I.unpack(str[start:end])
00134 _v5 = _v4.stamp
00135 _x = _v5
00136 start = end
00137 end += 8
00138 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00139 start = end
00140 end += 4
00141 (length,) = _struct_I.unpack(str[start:end])
00142 start = end
00143 end += length
00144 _v4.frame_id = str[start:end]
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 val1.name = str[start:end]
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 val1.object_id = str[start:end]
00157 _v6 = val1.pos
00158 _x = _v6
00159 start = end
00160 end += 24
00161 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00162 start = end
00163 end += 8
00164 (val1.reliability,) = _struct_d.unpack(str[start:end])
00165 start = end
00166 end += 72
00167 val1.covariance = _struct_9d.unpack(str[start:end])
00168 start = end
00169 end += 1
00170 (val1.initialization,) = _struct_b.unpack(str[start:end])
00171 self.face_positions.append(val1)
00172 return self
00173 except struct.error, e:
00174 raise roslib.message.DeserializationError(e)
00175
00176
00177 def serialize_numpy(self, buff, numpy):
00178 """
00179 serialize message with numpy array types into buffer
00180 @param buff: buffer
00181 @type buff: StringIO
00182 @param numpy: numpy python module
00183 @type numpy module
00184 """
00185 try:
00186 length = len(self.face_positions)
00187 buff.write(_struct_I.pack(length))
00188 for val1 in self.face_positions:
00189 _v7 = val1.header
00190 buff.write(_struct_I.pack(_v7.seq))
00191 _v8 = _v7.stamp
00192 _x = _v8
00193 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00194 _x = _v7.frame_id
00195 length = len(_x)
00196 buff.write(struct.pack('<I%ss'%length, length, _x))
00197 _x = val1.name
00198 length = len(_x)
00199 buff.write(struct.pack('<I%ss'%length, length, _x))
00200 _x = val1.object_id
00201 length = len(_x)
00202 buff.write(struct.pack('<I%ss'%length, length, _x))
00203 _v9 = val1.pos
00204 _x = _v9
00205 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00206 buff.write(_struct_d.pack(val1.reliability))
00207 buff.write(val1.covariance.tostring())
00208 buff.write(_struct_b.pack(val1.initialization))
00209 except struct.error, se: self._check_types(se)
00210 except TypeError, te: self._check_types(te)
00211
00212 def deserialize_numpy(self, str, numpy):
00213 """
00214 unpack serialized message in str into this message instance using numpy for array types
00215 @param str: byte array of serialized message
00216 @type str: str
00217 @param numpy: numpy python module
00218 @type numpy: module
00219 """
00220 try:
00221 end = 0
00222 start = end
00223 end += 4
00224 (length,) = _struct_I.unpack(str[start:end])
00225 self.face_positions = []
00226 for i in xrange(0, length):
00227 val1 = people_msgs.msg.PositionMeasurement()
00228 _v10 = val1.header
00229 start = end
00230 end += 4
00231 (_v10.seq,) = _struct_I.unpack(str[start:end])
00232 _v11 = _v10.stamp
00233 _x = _v11
00234 start = end
00235 end += 8
00236 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 start = end
00241 end += length
00242 _v10.frame_id = str[start:end]
00243 start = end
00244 end += 4
00245 (length,) = _struct_I.unpack(str[start:end])
00246 start = end
00247 end += length
00248 val1.name = str[start:end]
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 val1.object_id = str[start:end]
00255 _v12 = val1.pos
00256 _x = _v12
00257 start = end
00258 end += 24
00259 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00260 start = end
00261 end += 8
00262 (val1.reliability,) = _struct_d.unpack(str[start:end])
00263 start = end
00264 end += 72
00265 val1.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00266 start = end
00267 end += 1
00268 (val1.initialization,) = _struct_b.unpack(str[start:end])
00269 self.face_positions.append(val1)
00270 return self
00271 except struct.error, e:
00272 raise roslib.message.DeserializationError(e)
00273
00274 _struct_I = roslib.message.struct_I
00275 _struct_b = struct.Struct("<b")
00276 _struct_d = struct.Struct("<d")
00277 _struct_9d = struct.Struct("<9d")
00278 _struct_2I = struct.Struct("<2I")
00279 _struct_3d = struct.Struct("<3d")