00001 """autogenerated by genpy from iri_perception_msgs/peopleTracking.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class peopleTracking(genpy.Message):
00009 _md5sum = "5085acdc7b3d2430f148e7a5cb50043c"
00010 _type = "iri_perception_msgs/peopleTracking"
00011 _has_header = False
00012 _full_text = """#target id
00013 int32 targetId
00014
00015 #target status is a bitwise OR of the following values
00016 # TO_BE_REMOVED = 0x01,
00017 # OCCLUDDED = 0x02,
00018 # CANDIDATE = 0x04,
00019 # LEGGED_TARGET = 0x08,
00020 # VISUALLY_CONFIRMED = 0x10,
00021 # FRIEND_IN_SIGHT = 0x20,
00022 # BACK_LEARNT = 0x40,
00023 # FACE_LEARNT = 0x80
00024 int32 targetStatus
00025
00026 #target 2D position
00027 float64 x
00028 float64 y
00029
00030 #target 2D linear velocity
00031 float64 vx
00032 float64 vy
00033
00034 #(x,y,vx,vy) covariance matrix
00035 float64[16] covariances
00036 """
00037 __slots__ = ['targetId','targetStatus','x','y','vx','vy','covariances']
00038 _slot_types = ['int32','int32','float64','float64','float64','float64','float64[16]']
00039
00040 def __init__(self, *args, **kwds):
00041 """
00042 Constructor. Any message fields that are implicitly/explicitly
00043 set to None will be assigned a default value. The recommend
00044 use is keyword arguments as this is more robust to future message
00045 changes. You cannot mix in-order arguments and keyword arguments.
00046
00047 The available fields are:
00048 targetId,targetStatus,x,y,vx,vy,covariances
00049
00050 :param args: complete set of field values, in .msg order
00051 :param kwds: use keyword arguments corresponding to message field names
00052 to set specific fields.
00053 """
00054 if args or kwds:
00055 super(peopleTracking, self).__init__(*args, **kwds)
00056
00057 if self.targetId is None:
00058 self.targetId = 0
00059 if self.targetStatus is None:
00060 self.targetStatus = 0
00061 if self.x is None:
00062 self.x = 0.
00063 if self.y is None:
00064 self.y = 0.
00065 if self.vx is None:
00066 self.vx = 0.
00067 if self.vy is None:
00068 self.vy = 0.
00069 if self.covariances is None:
00070 self.covariances = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00071 else:
00072 self.targetId = 0
00073 self.targetStatus = 0
00074 self.x = 0.
00075 self.y = 0.
00076 self.vx = 0.
00077 self.vy = 0.
00078 self.covariances = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00079
00080 def _get_types(self):
00081 """
00082 internal API method
00083 """
00084 return self._slot_types
00085
00086 def serialize(self, buff):
00087 """
00088 serialize message into buffer
00089 :param buff: buffer, ``StringIO``
00090 """
00091 try:
00092 _x = self
00093 buff.write(_struct_2i4d.pack(_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy))
00094 buff.write(_struct_16d.pack(*self.covariances))
00095 except struct.error as se: self._check_types(se)
00096 except TypeError as te: self._check_types(te)
00097
00098 def deserialize(self, str):
00099 """
00100 unpack serialized message in str into this message instance
00101 :param str: byte array of serialized message, ``str``
00102 """
00103 try:
00104 end = 0
00105 _x = self
00106 start = end
00107 end += 40
00108 (_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy,) = _struct_2i4d.unpack(str[start:end])
00109 start = end
00110 end += 128
00111 self.covariances = _struct_16d.unpack(str[start:end])
00112 return self
00113 except struct.error as e:
00114 raise genpy.DeserializationError(e)
00115
00116
00117 def serialize_numpy(self, buff, numpy):
00118 """
00119 serialize message with numpy array types into buffer
00120 :param buff: buffer, ``StringIO``
00121 :param numpy: numpy python module
00122 """
00123 try:
00124 _x = self
00125 buff.write(_struct_2i4d.pack(_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy))
00126 buff.write(self.covariances.tostring())
00127 except struct.error as se: self._check_types(se)
00128 except TypeError as te: self._check_types(te)
00129
00130 def deserialize_numpy(self, str, numpy):
00131 """
00132 unpack serialized message in str into this message instance using numpy for array types
00133 :param str: byte array of serialized message, ``str``
00134 :param numpy: numpy python module
00135 """
00136 try:
00137 end = 0
00138 _x = self
00139 start = end
00140 end += 40
00141 (_x.targetId, _x.targetStatus, _x.x, _x.y, _x.vx, _x.vy,) = _struct_2i4d.unpack(str[start:end])
00142 start = end
00143 end += 128
00144 self.covariances = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=16)
00145 return self
00146 except struct.error as e:
00147 raise genpy.DeserializationError(e)
00148
00149 _struct_I = genpy.struct_I
00150 _struct_16d = struct.Struct("<16d")
00151 _struct_2i4d = struct.Struct("<2i4d")