00001 """autogenerated by genpy from ssf_updates/PositionWithCovarianceStamped.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 PositionWithCovarianceStamped(genpy.Message):
00011 _md5sum = "3128d09129e2da15dcfe14f5a9b5a902"
00012 _type = "ssf_updates/PositionWithCovarianceStamped"
00013 _has_header = True
00014 _full_text = """Header header
00015 geometry_msgs/Point position
00016 float64[9] covariance
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data
00021 # in a particular coordinate frame.
00022 #
00023 # sequence ID: consecutively increasing ID
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034
00035 ================================================================================
00036 MSG: geometry_msgs/Point
00037 # This contains the position of a point in free space
00038 float64 x
00039 float64 y
00040 float64 z
00041
00042 """
00043 __slots__ = ['header','position','covariance']
00044 _slot_types = ['std_msgs/Header','geometry_msgs/Point','float64[9]']
00045
00046 def __init__(self, *args, **kwds):
00047 """
00048 Constructor. Any message fields that are implicitly/explicitly
00049 set to None will be assigned a default value. The recommend
00050 use is keyword arguments as this is more robust to future message
00051 changes. You cannot mix in-order arguments and keyword arguments.
00052
00053 The available fields are:
00054 header,position,covariance
00055
00056 :param args: complete set of field values, in .msg order
00057 :param kwds: use keyword arguments corresponding to message field names
00058 to set specific fields.
00059 """
00060 if args or kwds:
00061 super(PositionWithCovarianceStamped, self).__init__(*args, **kwds)
00062
00063 if self.header is None:
00064 self.header = std_msgs.msg.Header()
00065 if self.position is None:
00066 self.position = geometry_msgs.msg.Point()
00067 if self.covariance is None:
00068 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
00069 else:
00070 self.header = std_msgs.msg.Header()
00071 self.position = geometry_msgs.msg.Point()
00072 self.covariance = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
00073
00074 def _get_types(self):
00075 """
00076 internal API method
00077 """
00078 return self._slot_types
00079
00080 def serialize(self, buff):
00081 """
00082 serialize message into buffer
00083 :param buff: buffer, ``StringIO``
00084 """
00085 try:
00086 _x = self
00087 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00088 _x = self.header.frame_id
00089 length = len(_x)
00090 if python3 or type(_x) == unicode:
00091 _x = _x.encode('utf-8')
00092 length = len(_x)
00093 buff.write(struct.pack('<I%ss'%length, length, _x))
00094 _x = self
00095 buff.write(_struct_3d.pack(_x.position.x, _x.position.y, _x.position.z))
00096 buff.write(_struct_9d.pack(*self.covariance))
00097 except struct.error as se: self._check_types(se)
00098 except TypeError as te: self._check_types(te)
00099
00100 def deserialize(self, str):
00101 """
00102 unpack serialized message in str into this message instance
00103 :param str: byte array of serialized message, ``str``
00104 """
00105 try:
00106 if self.header is None:
00107 self.header = std_msgs.msg.Header()
00108 if self.position is None:
00109 self.position = geometry_msgs.msg.Point()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 12
00114 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 if python3:
00121 self.header.frame_id = str[start:end].decode('utf-8')
00122 else:
00123 self.header.frame_id = str[start:end]
00124 _x = self
00125 start = end
00126 end += 24
00127 (_x.position.x, _x.position.y, _x.position.z,) = _struct_3d.unpack(str[start:end])
00128 start = end
00129 end += 72
00130 self.covariance = _struct_9d.unpack(str[start:end])
00131 return self
00132 except struct.error as e:
00133 raise genpy.DeserializationError(e)
00134
00135
00136 def serialize_numpy(self, buff, numpy):
00137 """
00138 serialize message with numpy array types into buffer
00139 :param buff: buffer, ``StringIO``
00140 :param numpy: numpy python module
00141 """
00142 try:
00143 _x = self
00144 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00145 _x = self.header.frame_id
00146 length = len(_x)
00147 if python3 or type(_x) == unicode:
00148 _x = _x.encode('utf-8')
00149 length = len(_x)
00150 buff.write(struct.pack('<I%ss'%length, length, _x))
00151 _x = self
00152 buff.write(_struct_3d.pack(_x.position.x, _x.position.y, _x.position.z))
00153 buff.write(self.covariance.tostring())
00154 except struct.error as se: self._check_types(se)
00155 except TypeError as te: self._check_types(te)
00156
00157 def deserialize_numpy(self, str, numpy):
00158 """
00159 unpack serialized message in str into this message instance using numpy for array types
00160 :param str: byte array of serialized message, ``str``
00161 :param numpy: numpy python module
00162 """
00163 try:
00164 if self.header is None:
00165 self.header = std_msgs.msg.Header()
00166 if self.position is None:
00167 self.position = geometry_msgs.msg.Point()
00168 end = 0
00169 _x = self
00170 start = end
00171 end += 12
00172 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00173 start = end
00174 end += 4
00175 (length,) = _struct_I.unpack(str[start:end])
00176 start = end
00177 end += length
00178 if python3:
00179 self.header.frame_id = str[start:end].decode('utf-8')
00180 else:
00181 self.header.frame_id = str[start:end]
00182 _x = self
00183 start = end
00184 end += 24
00185 (_x.position.x, _x.position.y, _x.position.z,) = _struct_3d.unpack(str[start:end])
00186 start = end
00187 end += 72
00188 self.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00189 return self
00190 except struct.error as e:
00191 raise genpy.DeserializationError(e)
00192
00193 _struct_I = genpy.struct_I
00194 _struct_3I = struct.Struct("<3I")
00195 _struct_9d = struct.Struct("<9d")
00196 _struct_3d = struct.Struct("<3d")