_peopleTrackResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_perception_msgs/peopleTrackResult.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 iri_perception_msgs.msg
00008 import std_msgs.msg
00009 
00010 class peopleTrackResult(genpy.Message):
00011   _md5sum = "1796d7fa1e8c6767763e459312a86279"
00012   _type = "iri_perception_msgs/peopleTrackResult"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 #result definition
00016 peopleTrackingArray ps
00017 
00018 ================================================================================
00019 MSG: iri_perception_msgs/peopleTrackingArray
00020 # timestamp, frame id
00021 Header header
00022 
00023 #set of targets being tracked
00024 peopleTracking[] peopleSet
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data 
00029 # in a particular coordinate frame.
00030 # 
00031 # sequence ID: consecutively increasing ID 
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042 
00043 ================================================================================
00044 MSG: iri_perception_msgs/peopleTracking
00045 #target id
00046 int32 targetId
00047 
00048 #target status is a bitwise OR of the following values
00049 #      TO_BE_REMOVED = 0x01,
00050 #      OCCLUDDED = 0x02,
00051 #      CANDIDATE = 0x04,
00052 #      LEGGED_TARGET = 0x08,
00053 #      VISUALLY_CONFIRMED = 0x10,
00054 #      FRIEND_IN_SIGHT = 0x20,
00055 #      BACK_LEARNT = 0x40,
00056 #      FACE_LEARNT = 0x80
00057 int32 targetStatus
00058 
00059 #target 2D position
00060 float64 x
00061 float64 y
00062 
00063 #target 2D linear velocity
00064 float64 vx
00065 float64 vy
00066 
00067 #(x,y,vx,vy) covariance matrix
00068 float64[16] covariances
00069 """
00070   __slots__ = ['ps']
00071   _slot_types = ['iri_perception_msgs/peopleTrackingArray']
00072 
00073   def __init__(self, *args, **kwds):
00074     """
00075     Constructor. Any message fields that are implicitly/explicitly
00076     set to None will be assigned a default value. The recommend
00077     use is keyword arguments as this is more robust to future message
00078     changes.  You cannot mix in-order arguments and keyword arguments.
00079 
00080     The available fields are:
00081        ps
00082 
00083     :param args: complete set of field values, in .msg order
00084     :param kwds: use keyword arguments corresponding to message field names
00085     to set specific fields.
00086     """
00087     if args or kwds:
00088       super(peopleTrackResult, self).__init__(*args, **kwds)
00089       #message fields cannot be None, assign default values for those that are
00090       if self.ps is None:
00091         self.ps = iri_perception_msgs.msg.peopleTrackingArray()
00092     else:
00093       self.ps = iri_perception_msgs.msg.peopleTrackingArray()
00094 
00095   def _get_types(self):
00096     """
00097     internal API method
00098     """
00099     return self._slot_types
00100 
00101   def serialize(self, buff):
00102     """
00103     serialize message into buffer
00104     :param buff: buffer, ``StringIO``
00105     """
00106     try:
00107       _x = self
00108       buff.write(_struct_3I.pack(_x.ps.header.seq, _x.ps.header.stamp.secs, _x.ps.header.stamp.nsecs))
00109       _x = self.ps.header.frame_id
00110       length = len(_x)
00111       if python3 or type(_x) == unicode:
00112         _x = _x.encode('utf-8')
00113         length = len(_x)
00114       buff.write(struct.pack('<I%ss'%length, length, _x))
00115       length = len(self.ps.peopleSet)
00116       buff.write(_struct_I.pack(length))
00117       for val1 in self.ps.peopleSet:
00118         _x = val1
00119         buff.write(_struct_2i4d.pack(_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy))
00120         buff.write(_struct_16d.pack(*val1.covariances))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize(self, str):
00125     """
00126     unpack serialized message in str into this message instance
00127     :param str: byte array of serialized message, ``str``
00128     """
00129     try:
00130       if self.ps is None:
00131         self.ps = iri_perception_msgs.msg.peopleTrackingArray()
00132       end = 0
00133       _x = self
00134       start = end
00135       end += 12
00136       (_x.ps.header.seq, _x.ps.header.stamp.secs, _x.ps.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       start = end
00141       end += length
00142       if python3:
00143         self.ps.header.frame_id = str[start:end].decode('utf-8')
00144       else:
00145         self.ps.header.frame_id = str[start:end]
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       self.ps.peopleSet = []
00150       for i in range(0, length):
00151         val1 = iri_perception_msgs.msg.peopleTracking()
00152         _x = val1
00153         start = end
00154         end += 40
00155         (_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy,) = _struct_2i4d.unpack(str[start:end])
00156         start = end
00157         end += 128
00158         val1.covariances = _struct_16d.unpack(str[start:end])
00159         self.ps.peopleSet.append(val1)
00160       return self
00161     except struct.error as e:
00162       raise genpy.DeserializationError(e) #most likely buffer underfill
00163 
00164 
00165   def serialize_numpy(self, buff, numpy):
00166     """
00167     serialize message with numpy array types into buffer
00168     :param buff: buffer, ``StringIO``
00169     :param numpy: numpy python module
00170     """
00171     try:
00172       _x = self
00173       buff.write(_struct_3I.pack(_x.ps.header.seq, _x.ps.header.stamp.secs, _x.ps.header.stamp.nsecs))
00174       _x = self.ps.header.frame_id
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       length = len(self.ps.peopleSet)
00181       buff.write(_struct_I.pack(length))
00182       for val1 in self.ps.peopleSet:
00183         _x = val1
00184         buff.write(_struct_2i4d.pack(_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy))
00185         buff.write(val1.covariances.tostring())
00186     except struct.error as se: self._check_types(se)
00187     except TypeError as te: self._check_types(te)
00188 
00189   def deserialize_numpy(self, str, numpy):
00190     """
00191     unpack serialized message in str into this message instance using numpy for array types
00192     :param str: byte array of serialized message, ``str``
00193     :param numpy: numpy python module
00194     """
00195     try:
00196       if self.ps is None:
00197         self.ps = iri_perception_msgs.msg.peopleTrackingArray()
00198       end = 0
00199       _x = self
00200       start = end
00201       end += 12
00202       (_x.ps.header.seq, _x.ps.header.stamp.secs, _x.ps.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00203       start = end
00204       end += 4
00205       (length,) = _struct_I.unpack(str[start:end])
00206       start = end
00207       end += length
00208       if python3:
00209         self.ps.header.frame_id = str[start:end].decode('utf-8')
00210       else:
00211         self.ps.header.frame_id = str[start:end]
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       self.ps.peopleSet = []
00216       for i in range(0, length):
00217         val1 = iri_perception_msgs.msg.peopleTracking()
00218         _x = val1
00219         start = end
00220         end += 40
00221         (_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy,) = _struct_2i4d.unpack(str[start:end])
00222         start = end
00223         end += 128
00224         val1.covariances = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=16)
00225         self.ps.peopleSet.append(val1)
00226       return self
00227     except struct.error as e:
00228       raise genpy.DeserializationError(e) #most likely buffer underfill
00229 
00230 _struct_I = genpy.struct_I
00231 _struct_16d = struct.Struct("<16d")
00232 _struct_3I = struct.Struct("<3I")
00233 _struct_2i4d = struct.Struct("<2i4d")


iri_perception_msgs
Author(s):
autogenerated on Fri Dec 6 2013 20:02:15