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


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