00001 """autogenerated by genpy from komodo_sensors/apm_gps.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class apm_gps(genpy.Message):
00009 _md5sum = "c993a66a6584fc0d2871154e12be7053"
00010 _type = "komodo_sensors/apm_gps"
00011 _has_header = False
00012 _full_text = """int32 lat
00013 int32 lon
00014 int16 alt
00015 int16 sats
00016 int16 hdop
00017 int16 status
00018
00019
00020 """
00021 __slots__ = ['lat','lon','alt','sats','hdop','status']
00022 _slot_types = ['int32','int32','int16','int16','int16','int16']
00023
00024 def __init__(self, *args, **kwds):
00025 """
00026 Constructor. Any message fields that are implicitly/explicitly
00027 set to None will be assigned a default value. The recommend
00028 use is keyword arguments as this is more robust to future message
00029 changes. You cannot mix in-order arguments and keyword arguments.
00030
00031 The available fields are:
00032 lat,lon,alt,sats,hdop,status
00033
00034 :param args: complete set of field values, in .msg order
00035 :param kwds: use keyword arguments corresponding to message field names
00036 to set specific fields.
00037 """
00038 if args or kwds:
00039 super(apm_gps, self).__init__(*args, **kwds)
00040
00041 if self.lat is None:
00042 self.lat = 0
00043 if self.lon is None:
00044 self.lon = 0
00045 if self.alt is None:
00046 self.alt = 0
00047 if self.sats is None:
00048 self.sats = 0
00049 if self.hdop is None:
00050 self.hdop = 0
00051 if self.status is None:
00052 self.status = 0
00053 else:
00054 self.lat = 0
00055 self.lon = 0
00056 self.alt = 0
00057 self.sats = 0
00058 self.hdop = 0
00059 self.status = 0
00060
00061 def _get_types(self):
00062 """
00063 internal API method
00064 """
00065 return self._slot_types
00066
00067 def serialize(self, buff):
00068 """
00069 serialize message into buffer
00070 :param buff: buffer, ``StringIO``
00071 """
00072 try:
00073 _x = self
00074 buff.write(_struct_2i4h.pack(_x.lat, _x.lon, _x.alt, _x.sats, _x.hdop, _x.status))
00075 except struct.error as se: self._check_types(se)
00076 except TypeError as te: self._check_types(te)
00077
00078 def deserialize(self, str):
00079 """
00080 unpack serialized message in str into this message instance
00081 :param str: byte array of serialized message, ``str``
00082 """
00083 try:
00084 end = 0
00085 _x = self
00086 start = end
00087 end += 16
00088 (_x.lat, _x.lon, _x.alt, _x.sats, _x.hdop, _x.status,) = _struct_2i4h.unpack(str[start:end])
00089 return self
00090 except struct.error as e:
00091 raise genpy.DeserializationError(e)
00092
00093
00094 def serialize_numpy(self, buff, numpy):
00095 """
00096 serialize message with numpy array types into buffer
00097 :param buff: buffer, ``StringIO``
00098 :param numpy: numpy python module
00099 """
00100 try:
00101 _x = self
00102 buff.write(_struct_2i4h.pack(_x.lat, _x.lon, _x.alt, _x.sats, _x.hdop, _x.status))
00103 except struct.error as se: self._check_types(se)
00104 except TypeError as te: self._check_types(te)
00105
00106 def deserialize_numpy(self, str, numpy):
00107 """
00108 unpack serialized message in str into this message instance using numpy for array types
00109 :param str: byte array of serialized message, ``str``
00110 :param numpy: numpy python module
00111 """
00112 try:
00113 end = 0
00114 _x = self
00115 start = end
00116 end += 16
00117 (_x.lat, _x.lon, _x.alt, _x.sats, _x.hdop, _x.status,) = _struct_2i4h.unpack(str[start:end])
00118 return self
00119 except struct.error as e:
00120 raise genpy.DeserializationError(e)
00121
00122 _struct_I = genpy.struct_I
00123 _struct_2i4h = struct.Struct("<2i4h")