_FaceDetectorActionResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from face_detector/FaceDetectorActionResult.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 people_msgs.msg
00008 import actionlib_msgs.msg
00009 import geometry_msgs.msg
00010 import genpy
00011 import face_detector.msg
00012 import std_msgs.msg
00013 
00014 class FaceDetectorActionResult(genpy.Message):
00015   _md5sum = "d3986ecc4dd47eb1142da1c68ce02ae7"
00016   _type = "face_detector/FaceDetectorActionResult"
00017   _has_header = True #flag to mark the presence of a Header object
00018   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00019 
00020 Header header
00021 actionlib_msgs/GoalStatus status
00022 FaceDetectorResult result
00023 
00024 ================================================================================
00025 MSG: std_msgs/Header
00026 # Standard metadata for higher-level stamped data types.
00027 # This is generally used to communicate timestamped data 
00028 # in a particular coordinate frame.
00029 # 
00030 # sequence ID: consecutively increasing ID 
00031 uint32 seq
00032 #Two-integer timestamp that is expressed as:
00033 # * stamp.secs: seconds (stamp_secs) since epoch
00034 # * stamp.nsecs: nanoseconds since stamp_secs
00035 # time-handling sugar is provided by the client library
00036 time stamp
00037 #Frame this data is associated with
00038 # 0: no frame
00039 # 1: global frame
00040 string frame_id
00041 
00042 ================================================================================
00043 MSG: actionlib_msgs/GoalStatus
00044 GoalID goal_id
00045 uint8 status
00046 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00047 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00048 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00049                             #   and has since completed its execution (Terminal State)
00050 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00051 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00052                             #    to some failure (Terminal State)
00053 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00054                             #    because the goal was unattainable or invalid (Terminal State)
00055 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00056                             #    and has not yet completed execution
00057 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00058                             #    but the action server has not yet confirmed that the goal is canceled
00059 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00060                             #    and was successfully cancelled (Terminal State)
00061 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00062                             #    sent over the wire by an action server
00063 
00064 #Allow for the user to associate a string with GoalStatus for debugging
00065 string text
00066 
00067 
00068 ================================================================================
00069 MSG: actionlib_msgs/GoalID
00070 # The stamp should store the time at which this goal was requested.
00071 # It is used by an action server when it tries to preempt all
00072 # goals that were requested before a certain time
00073 time stamp
00074 
00075 # The id provides a way to associate feedback and
00076 # result message with specific goal requests. The id
00077 # specified must be unique.
00078 string id
00079 
00080 
00081 ================================================================================
00082 MSG: face_detector/FaceDetectorResult
00083 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00084 #result
00085 people_msgs/PositionMeasurement[] face_positions
00086 
00087 ================================================================================
00088 MSG: people_msgs/PositionMeasurement
00089 Header          header
00090 string          name
00091 string          object_id
00092 geometry_msgs/Point pos
00093 float64         reliability
00094 float64[9]      covariance
00095 byte            initialization
00096 ================================================================================
00097 MSG: geometry_msgs/Point
00098 # This contains the position of a point in free space
00099 float64 x
00100 float64 y
00101 float64 z
00102 
00103 """
00104   __slots__ = ['header','status','result']
00105   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','face_detector/FaceDetectorResult']
00106 
00107   def __init__(self, *args, **kwds):
00108     """
00109     Constructor. Any message fields that are implicitly/explicitly
00110     set to None will be assigned a default value. The recommend
00111     use is keyword arguments as this is more robust to future message
00112     changes.  You cannot mix in-order arguments and keyword arguments.
00113 
00114     The available fields are:
00115        header,status,result
00116 
00117     :param args: complete set of field values, in .msg order
00118     :param kwds: use keyword arguments corresponding to message field names
00119     to set specific fields.
00120     """
00121     if args or kwds:
00122       super(FaceDetectorActionResult, self).__init__(*args, **kwds)
00123       #message fields cannot be None, assign default values for those that are
00124       if self.header is None:
00125         self.header = std_msgs.msg.Header()
00126       if self.status is None:
00127         self.status = actionlib_msgs.msg.GoalStatus()
00128       if self.result is None:
00129         self.result = face_detector.msg.FaceDetectorResult()
00130     else:
00131       self.header = std_msgs.msg.Header()
00132       self.status = actionlib_msgs.msg.GoalStatus()
00133       self.result = face_detector.msg.FaceDetectorResult()
00134 
00135   def _get_types(self):
00136     """
00137     internal API method
00138     """
00139     return self._slot_types
00140 
00141   def serialize(self, buff):
00142     """
00143     serialize message into buffer
00144     :param buff: buffer, ``StringIO``
00145     """
00146     try:
00147       _x = self
00148       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00149       _x = self.header.frame_id
00150       length = len(_x)
00151       if python3 or type(_x) == unicode:
00152         _x = _x.encode('utf-8')
00153         length = len(_x)
00154       buff.write(struct.pack('<I%ss'%length, length, _x))
00155       _x = self
00156       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00157       _x = self.status.goal_id.id
00158       length = len(_x)
00159       if python3 or type(_x) == unicode:
00160         _x = _x.encode('utf-8')
00161         length = len(_x)
00162       buff.write(struct.pack('<I%ss'%length, length, _x))
00163       buff.write(_struct_B.pack(self.status.status))
00164       _x = self.status.text
00165       length = len(_x)
00166       if python3 or type(_x) == unicode:
00167         _x = _x.encode('utf-8')
00168         length = len(_x)
00169       buff.write(struct.pack('<I%ss'%length, length, _x))
00170       length = len(self.result.face_positions)
00171       buff.write(_struct_I.pack(length))
00172       for val1 in self.result.face_positions:
00173         _v1 = val1.header
00174         buff.write(_struct_I.pack(_v1.seq))
00175         _v2 = _v1.stamp
00176         _x = _v2
00177         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00178         _x = _v1.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         _x = val1.name
00185         length = len(_x)
00186         if python3 or type(_x) == unicode:
00187           _x = _x.encode('utf-8')
00188           length = len(_x)
00189         buff.write(struct.pack('<I%ss'%length, length, _x))
00190         _x = val1.object_id
00191         length = len(_x)
00192         if python3 or type(_x) == unicode:
00193           _x = _x.encode('utf-8')
00194           length = len(_x)
00195         buff.write(struct.pack('<I%ss'%length, length, _x))
00196         _v3 = val1.pos
00197         _x = _v3
00198         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00199         buff.write(_struct_d.pack(val1.reliability))
00200         buff.write(_struct_9d.pack(*val1.covariance))
00201         buff.write(_struct_b.pack(val1.initialization))
00202     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00203     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00204 
00205   def deserialize(self, str):
00206     """
00207     unpack serialized message in str into this message instance
00208     :param str: byte array of serialized message, ``str``
00209     """
00210     try:
00211       if self.header is None:
00212         self.header = std_msgs.msg.Header()
00213       if self.status is None:
00214         self.status = actionlib_msgs.msg.GoalStatus()
00215       if self.result is None:
00216         self.result = face_detector.msg.FaceDetectorResult()
00217       end = 0
00218       _x = self
00219       start = end
00220       end += 12
00221       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00222       start = end
00223       end += 4
00224       (length,) = _struct_I.unpack(str[start:end])
00225       start = end
00226       end += length
00227       if python3:
00228         self.header.frame_id = str[start:end].decode('utf-8')
00229       else:
00230         self.header.frame_id = str[start:end]
00231       _x = self
00232       start = end
00233       end += 8
00234       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00235       start = end
00236       end += 4
00237       (length,) = _struct_I.unpack(str[start:end])
00238       start = end
00239       end += length
00240       if python3:
00241         self.status.goal_id.id = str[start:end].decode('utf-8')
00242       else:
00243         self.status.goal_id.id = str[start:end]
00244       start = end
00245       end += 1
00246       (self.status.status,) = _struct_B.unpack(str[start:end])
00247       start = end
00248       end += 4
00249       (length,) = _struct_I.unpack(str[start:end])
00250       start = end
00251       end += length
00252       if python3:
00253         self.status.text = str[start:end].decode('utf-8')
00254       else:
00255         self.status.text = str[start:end]
00256       start = end
00257       end += 4
00258       (length,) = _struct_I.unpack(str[start:end])
00259       self.result.face_positions = []
00260       for i in range(0, length):
00261         val1 = people_msgs.msg.PositionMeasurement()
00262         _v4 = val1.header
00263         start = end
00264         end += 4
00265         (_v4.seq,) = _struct_I.unpack(str[start:end])
00266         _v5 = _v4.stamp
00267         _x = _v5
00268         start = end
00269         end += 8
00270         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00271         start = end
00272         end += 4
00273         (length,) = _struct_I.unpack(str[start:end])
00274         start = end
00275         end += length
00276         if python3:
00277           _v4.frame_id = str[start:end].decode('utf-8')
00278         else:
00279           _v4.frame_id = str[start:end]
00280         start = end
00281         end += 4
00282         (length,) = _struct_I.unpack(str[start:end])
00283         start = end
00284         end += length
00285         if python3:
00286           val1.name = str[start:end].decode('utf-8')
00287         else:
00288           val1.name = str[start:end]
00289         start = end
00290         end += 4
00291         (length,) = _struct_I.unpack(str[start:end])
00292         start = end
00293         end += length
00294         if python3:
00295           val1.object_id = str[start:end].decode('utf-8')
00296         else:
00297           val1.object_id = str[start:end]
00298         _v6 = val1.pos
00299         _x = _v6
00300         start = end
00301         end += 24
00302         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00303         start = end
00304         end += 8
00305         (val1.reliability,) = _struct_d.unpack(str[start:end])
00306         start = end
00307         end += 72
00308         val1.covariance = _struct_9d.unpack(str[start:end])
00309         start = end
00310         end += 1
00311         (val1.initialization,) = _struct_b.unpack(str[start:end])
00312         self.result.face_positions.append(val1)
00313       return self
00314     except struct.error as e:
00315       raise genpy.DeserializationError(e) #most likely buffer underfill
00316 
00317 
00318   def serialize_numpy(self, buff, numpy):
00319     """
00320     serialize message with numpy array types into buffer
00321     :param buff: buffer, ``StringIO``
00322     :param numpy: numpy python module
00323     """
00324     try:
00325       _x = self
00326       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00327       _x = self.header.frame_id
00328       length = len(_x)
00329       if python3 or type(_x) == unicode:
00330         _x = _x.encode('utf-8')
00331         length = len(_x)
00332       buff.write(struct.pack('<I%ss'%length, length, _x))
00333       _x = self
00334       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00335       _x = self.status.goal_id.id
00336       length = len(_x)
00337       if python3 or type(_x) == unicode:
00338         _x = _x.encode('utf-8')
00339         length = len(_x)
00340       buff.write(struct.pack('<I%ss'%length, length, _x))
00341       buff.write(_struct_B.pack(self.status.status))
00342       _x = self.status.text
00343       length = len(_x)
00344       if python3 or type(_x) == unicode:
00345         _x = _x.encode('utf-8')
00346         length = len(_x)
00347       buff.write(struct.pack('<I%ss'%length, length, _x))
00348       length = len(self.result.face_positions)
00349       buff.write(_struct_I.pack(length))
00350       for val1 in self.result.face_positions:
00351         _v7 = val1.header
00352         buff.write(_struct_I.pack(_v7.seq))
00353         _v8 = _v7.stamp
00354         _x = _v8
00355         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00356         _x = _v7.frame_id
00357         length = len(_x)
00358         if python3 or type(_x) == unicode:
00359           _x = _x.encode('utf-8')
00360           length = len(_x)
00361         buff.write(struct.pack('<I%ss'%length, length, _x))
00362         _x = val1.name
00363         length = len(_x)
00364         if python3 or type(_x) == unicode:
00365           _x = _x.encode('utf-8')
00366           length = len(_x)
00367         buff.write(struct.pack('<I%ss'%length, length, _x))
00368         _x = val1.object_id
00369         length = len(_x)
00370         if python3 or type(_x) == unicode:
00371           _x = _x.encode('utf-8')
00372           length = len(_x)
00373         buff.write(struct.pack('<I%ss'%length, length, _x))
00374         _v9 = val1.pos
00375         _x = _v9
00376         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00377         buff.write(_struct_d.pack(val1.reliability))
00378         buff.write(val1.covariance.tostring())
00379         buff.write(_struct_b.pack(val1.initialization))
00380     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00381     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00382 
00383   def deserialize_numpy(self, str, numpy):
00384     """
00385     unpack serialized message in str into this message instance using numpy for array types
00386     :param str: byte array of serialized message, ``str``
00387     :param numpy: numpy python module
00388     """
00389     try:
00390       if self.header is None:
00391         self.header = std_msgs.msg.Header()
00392       if self.status is None:
00393         self.status = actionlib_msgs.msg.GoalStatus()
00394       if self.result is None:
00395         self.result = face_detector.msg.FaceDetectorResult()
00396       end = 0
00397       _x = self
00398       start = end
00399       end += 12
00400       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00401       start = end
00402       end += 4
00403       (length,) = _struct_I.unpack(str[start:end])
00404       start = end
00405       end += length
00406       if python3:
00407         self.header.frame_id = str[start:end].decode('utf-8')
00408       else:
00409         self.header.frame_id = str[start:end]
00410       _x = self
00411       start = end
00412       end += 8
00413       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00414       start = end
00415       end += 4
00416       (length,) = _struct_I.unpack(str[start:end])
00417       start = end
00418       end += length
00419       if python3:
00420         self.status.goal_id.id = str[start:end].decode('utf-8')
00421       else:
00422         self.status.goal_id.id = str[start:end]
00423       start = end
00424       end += 1
00425       (self.status.status,) = _struct_B.unpack(str[start:end])
00426       start = end
00427       end += 4
00428       (length,) = _struct_I.unpack(str[start:end])
00429       start = end
00430       end += length
00431       if python3:
00432         self.status.text = str[start:end].decode('utf-8')
00433       else:
00434         self.status.text = str[start:end]
00435       start = end
00436       end += 4
00437       (length,) = _struct_I.unpack(str[start:end])
00438       self.result.face_positions = []
00439       for i in range(0, length):
00440         val1 = people_msgs.msg.PositionMeasurement()
00441         _v10 = val1.header
00442         start = end
00443         end += 4
00444         (_v10.seq,) = _struct_I.unpack(str[start:end])
00445         _v11 = _v10.stamp
00446         _x = _v11
00447         start = end
00448         end += 8
00449         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00450         start = end
00451         end += 4
00452         (length,) = _struct_I.unpack(str[start:end])
00453         start = end
00454         end += length
00455         if python3:
00456           _v10.frame_id = str[start:end].decode('utf-8')
00457         else:
00458           _v10.frame_id = str[start:end]
00459         start = end
00460         end += 4
00461         (length,) = _struct_I.unpack(str[start:end])
00462         start = end
00463         end += length
00464         if python3:
00465           val1.name = str[start:end].decode('utf-8')
00466         else:
00467           val1.name = str[start:end]
00468         start = end
00469         end += 4
00470         (length,) = _struct_I.unpack(str[start:end])
00471         start = end
00472         end += length
00473         if python3:
00474           val1.object_id = str[start:end].decode('utf-8')
00475         else:
00476           val1.object_id = str[start:end]
00477         _v12 = val1.pos
00478         _x = _v12
00479         start = end
00480         end += 24
00481         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00482         start = end
00483         end += 8
00484         (val1.reliability,) = _struct_d.unpack(str[start:end])
00485         start = end
00486         end += 72
00487         val1.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00488         start = end
00489         end += 1
00490         (val1.initialization,) = _struct_b.unpack(str[start:end])
00491         self.result.face_positions.append(val1)
00492       return self
00493     except struct.error as e:
00494       raise genpy.DeserializationError(e) #most likely buffer underfill
00495 
00496 _struct_I = genpy.struct_I
00497 _struct_B = struct.Struct("<B")
00498 _struct_d = struct.Struct("<d")
00499 _struct_9d = struct.Struct("<9d")
00500 _struct_3I = struct.Struct("<3I")
00501 _struct_b = struct.Struct("<b")
00502 _struct_2I = struct.Struct("<2I")
00503 _struct_3d = struct.Struct("<3d")


face_detector
Author(s): Caroline Pantofaru
autogenerated on Mon Oct 6 2014 03:17:09