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