_PoseWithCovarianceStampedArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_nav_msgs/PoseWithCovarianceStampedArray.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 std_msgs.msg
00009 
00010 class PoseWithCovarianceStampedArray(genpy.Message):
00011   _md5sum = "9ae57d4912ee570d48570ab5b45b5942"
00012   _type = "iri_nav_msgs/PoseWithCovarianceStampedArray"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """#An array of poses with covariance with a header for global reference.
00015 Header header
00016 
00017 geometry_msgs/PoseWithCovariance[] poses
00018 
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: geometry_msgs/PoseWithCovariance
00039 # This represents a pose in free space with uncertainty.
00040 
00041 Pose pose
00042 
00043 # Row-major representation of the 6x6 covariance matrix
00044 # The orientation parameters use a fixed-axis representation.
00045 # In order, the parameters are:
00046 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
00047 float64[36] covariance
00048 
00049 ================================================================================
00050 MSG: geometry_msgs/Pose
00051 # A representation of pose in free space, composed of postion and orientation. 
00052 Point position
00053 Quaternion orientation
00054 
00055 ================================================================================
00056 MSG: geometry_msgs/Point
00057 # This contains the position of a point in free space
00058 float64 x
00059 float64 y
00060 float64 z
00061 
00062 ================================================================================
00063 MSG: geometry_msgs/Quaternion
00064 # This represents an orientation in free space in quaternion form.
00065 
00066 float64 x
00067 float64 y
00068 float64 z
00069 float64 w
00070 
00071 """
00072   __slots__ = ['header','poses']
00073   _slot_types = ['std_msgs/Header','geometry_msgs/PoseWithCovariance[]']
00074 
00075   def __init__(self, *args, **kwds):
00076     """
00077     Constructor. Any message fields that are implicitly/explicitly
00078     set to None will be assigned a default value. The recommend
00079     use is keyword arguments as this is more robust to future message
00080     changes.  You cannot mix in-order arguments and keyword arguments.
00081 
00082     The available fields are:
00083        header,poses
00084 
00085     :param args: complete set of field values, in .msg order
00086     :param kwds: use keyword arguments corresponding to message field names
00087     to set specific fields.
00088     """
00089     if args or kwds:
00090       super(PoseWithCovarianceStampedArray, self).__init__(*args, **kwds)
00091       #message fields cannot be None, assign default values for those that are
00092       if self.header is None:
00093         self.header = std_msgs.msg.Header()
00094       if self.poses is None:
00095         self.poses = []
00096     else:
00097       self.header = std_msgs.msg.Header()
00098       self.poses = []
00099 
00100   def _get_types(self):
00101     """
00102     internal API method
00103     """
00104     return self._slot_types
00105 
00106   def serialize(self, buff):
00107     """
00108     serialize message into buffer
00109     :param buff: buffer, ``StringIO``
00110     """
00111     try:
00112       _x = self
00113       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00114       _x = self.header.frame_id
00115       length = len(_x)
00116       if python3 or type(_x) == unicode:
00117         _x = _x.encode('utf-8')
00118         length = len(_x)
00119       buff.write(struct.pack('<I%ss'%length, length, _x))
00120       length = len(self.poses)
00121       buff.write(_struct_I.pack(length))
00122       for val1 in self.poses:
00123         _v1 = val1.pose
00124         _v2 = _v1.position
00125         _x = _v2
00126         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00127         _v3 = _v1.orientation
00128         _x = _v3
00129         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00130         buff.write(_struct_36d.pack(*val1.covariance))
00131     except struct.error as se: self._check_types(se)
00132     except TypeError as te: self._check_types(te)
00133 
00134   def deserialize(self, str):
00135     """
00136     unpack serialized message in str into this message instance
00137     :param str: byte array of serialized message, ``str``
00138     """
00139     try:
00140       if self.header is None:
00141         self.header = std_msgs.msg.Header()
00142       if self.poses is None:
00143         self.poses = None
00144       end = 0
00145       _x = self
00146       start = end
00147       end += 12
00148       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00149       start = end
00150       end += 4
00151       (length,) = _struct_I.unpack(str[start:end])
00152       start = end
00153       end += length
00154       if python3:
00155         self.header.frame_id = str[start:end].decode('utf-8')
00156       else:
00157         self.header.frame_id = str[start:end]
00158       start = end
00159       end += 4
00160       (length,) = _struct_I.unpack(str[start:end])
00161       self.poses = []
00162       for i in range(0, length):
00163         val1 = geometry_msgs.msg.PoseWithCovariance()
00164         _v4 = val1.pose
00165         _v5 = _v4.position
00166         _x = _v5
00167         start = end
00168         end += 24
00169         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00170         _v6 = _v4.orientation
00171         _x = _v6
00172         start = end
00173         end += 32
00174         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00175         start = end
00176         end += 288
00177         val1.covariance = _struct_36d.unpack(str[start:end])
00178         self.poses.append(val1)
00179       return self
00180     except struct.error as e:
00181       raise genpy.DeserializationError(e) #most likely buffer underfill
00182 
00183 
00184   def serialize_numpy(self, buff, numpy):
00185     """
00186     serialize message with numpy array types into buffer
00187     :param buff: buffer, ``StringIO``
00188     :param numpy: numpy python module
00189     """
00190     try:
00191       _x = self
00192       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00193       _x = self.header.frame_id
00194       length = len(_x)
00195       if python3 or type(_x) == unicode:
00196         _x = _x.encode('utf-8')
00197         length = len(_x)
00198       buff.write(struct.pack('<I%ss'%length, length, _x))
00199       length = len(self.poses)
00200       buff.write(_struct_I.pack(length))
00201       for val1 in self.poses:
00202         _v7 = val1.pose
00203         _v8 = _v7.position
00204         _x = _v8
00205         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00206         _v9 = _v7.orientation
00207         _x = _v9
00208         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00209         buff.write(val1.covariance.tostring())
00210     except struct.error as se: self._check_types(se)
00211     except TypeError as te: self._check_types(te)
00212 
00213   def deserialize_numpy(self, str, numpy):
00214     """
00215     unpack serialized message in str into this message instance using numpy for array types
00216     :param str: byte array of serialized message, ``str``
00217     :param numpy: numpy python module
00218     """
00219     try:
00220       if self.header is None:
00221         self.header = std_msgs.msg.Header()
00222       if self.poses is None:
00223         self.poses = None
00224       end = 0
00225       _x = self
00226       start = end
00227       end += 12
00228       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       start = end
00233       end += length
00234       if python3:
00235         self.header.frame_id = str[start:end].decode('utf-8')
00236       else:
00237         self.header.frame_id = str[start:end]
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       self.poses = []
00242       for i in range(0, length):
00243         val1 = geometry_msgs.msg.PoseWithCovariance()
00244         _v10 = val1.pose
00245         _v11 = _v10.position
00246         _x = _v11
00247         start = end
00248         end += 24
00249         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00250         _v12 = _v10.orientation
00251         _x = _v12
00252         start = end
00253         end += 32
00254         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00255         start = end
00256         end += 288
00257         val1.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
00258         self.poses.append(val1)
00259       return self
00260     except struct.error as e:
00261       raise genpy.DeserializationError(e) #most likely buffer underfill
00262 
00263 _struct_I = genpy.struct_I
00264 _struct_36d = struct.Struct("<36d")
00265 _struct_3I = struct.Struct("<3I")
00266 _struct_4d = struct.Struct("<4d")
00267 _struct_3d = struct.Struct("<3d")


iri_nav_msgs
Author(s):
autogenerated on Fri Dec 6 2013 21:01:36