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