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