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