Go to the documentation of this file.00001 """autogenerated by genpy from ublox_msgs/AidALM.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 AidALM(genpy.Message):
00009 _md5sum = "de5ab2550e698fc8acfb7263c7c55fa2"
00010 _type = "ublox_msgs/AidALM"
00011 _has_header = False
00012 _full_text = """# RXM-ALM (0x02 0x30)
00013 # GPS Aiding Almanach Input/Output Message
00014 #
00015 # This message is provided considered obsolete, please use AID-ALM instead!
00016 # - If the WEEK Value is 0, DWRD0 to DWRD7 are not sent as the almanach is not available
00017 # for the given SV. This may happen even if NAV-SVINFO and RXM-SVSI are indicating
00018 # almanac availability as the internal data may not represent the content of an original
00019 # broadcast almanac (or only parts thereof).
00020 # - DWORD0 to DWORD7 contain the 8 words following the Hand-Over Word ( HOW )
00021 # from the GPS navigation message, either pages 1 to 24 of sub-frame 5 or pages 2 to 10
00022 # of subframe 4. See IS-GPS-200 for a full description of the contents of the Almanac
00023 # pages.
00024 # - In DWORD0 to DWORD7, the parity bits have been removed, and the 24 bits of data are
00025 # located in Bits 0 to 23. Bits 24 to 31 shall be ignored.
00026 # - Example: Parameter e (Eccentricity) from Almanach Subframe 4/5, Word 3, Bits 69-84
00027 # within the subframe can be found in DWRD0, Bits 15-0 whereas Bit 0 is the LSB.
00028
00029 uint8 CLASS_ID = 11
00030 uint8 MESSAGE_ID = 48
00031
00032 uint32 svid # SV ID for which this Almanach Data is (Valid Range: 1 .. 32 or 51, 56, 63).
00033 uint32 week # Issue Date of Almanach (GPS week number)
00034
00035 # Start of optional block
00036 uint32[] dwrd # Almanach Words
00037 # End of optional block
00038
00039 """
00040
00041 CLASS_ID = 11
00042 MESSAGE_ID = 48
00043
00044 __slots__ = ['svid','week','dwrd']
00045 _slot_types = ['uint32','uint32','uint32[]']
00046
00047 def __init__(self, *args, **kwds):
00048 """
00049 Constructor. Any message fields that are implicitly/explicitly
00050 set to None will be assigned a default value. The recommend
00051 use is keyword arguments as this is more robust to future message
00052 changes. You cannot mix in-order arguments and keyword arguments.
00053
00054 The available fields are:
00055 svid,week,dwrd
00056
00057 :param args: complete set of field values, in .msg order
00058 :param kwds: use keyword arguments corresponding to message field names
00059 to set specific fields.
00060 """
00061 if args or kwds:
00062 super(AidALM, self).__init__(*args, **kwds)
00063
00064 if self.svid is None:
00065 self.svid = 0
00066 if self.week is None:
00067 self.week = 0
00068 if self.dwrd is None:
00069 self.dwrd = []
00070 else:
00071 self.svid = 0
00072 self.week = 0
00073 self.dwrd = []
00074
00075 def _get_types(self):
00076 """
00077 internal API method
00078 """
00079 return self._slot_types
00080
00081 def serialize(self, buff):
00082 """
00083 serialize message into buffer
00084 :param buff: buffer, ``StringIO``
00085 """
00086 try:
00087 _x = self
00088 buff.write(_struct_2I.pack(_x.svid, _x.week))
00089 length = len(self.dwrd)
00090 buff.write(_struct_I.pack(length))
00091 pattern = '<%sI'%length
00092 buff.write(struct.pack(pattern, *self.dwrd))
00093 except struct.error as se: self._check_types(se)
00094 except TypeError as te: self._check_types(te)
00095
00096 def deserialize(self, str):
00097 """
00098 unpack serialized message in str into this message instance
00099 :param str: byte array of serialized message, ``str``
00100 """
00101 try:
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 8
00106 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end])
00107 start = end
00108 end += 4
00109 (length,) = _struct_I.unpack(str[start:end])
00110 pattern = '<%sI'%length
00111 start = end
00112 end += struct.calcsize(pattern)
00113 self.dwrd = struct.unpack(pattern, str[start:end])
00114 return self
00115 except struct.error as e:
00116 raise genpy.DeserializationError(e)
00117
00118
00119 def serialize_numpy(self, buff, numpy):
00120 """
00121 serialize message with numpy array types into buffer
00122 :param buff: buffer, ``StringIO``
00123 :param numpy: numpy python module
00124 """
00125 try:
00126 _x = self
00127 buff.write(_struct_2I.pack(_x.svid, _x.week))
00128 length = len(self.dwrd)
00129 buff.write(_struct_I.pack(length))
00130 pattern = '<%sI'%length
00131 buff.write(self.dwrd.tostring())
00132 except struct.error as se: self._check_types(se)
00133 except TypeError as te: self._check_types(te)
00134
00135 def deserialize_numpy(self, str, numpy):
00136 """
00137 unpack serialized message in str into this message instance using numpy for array types
00138 :param str: byte array of serialized message, ``str``
00139 :param numpy: numpy python module
00140 """
00141 try:
00142 end = 0
00143 _x = self
00144 start = end
00145 end += 8
00146 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end])
00147 start = end
00148 end += 4
00149 (length,) = _struct_I.unpack(str[start:end])
00150 pattern = '<%sI'%length
00151 start = end
00152 end += struct.calcsize(pattern)
00153 self.dwrd = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00154 return self
00155 except struct.error as e:
00156 raise genpy.DeserializationError(e)
00157
00158 _struct_I = genpy.struct_I
00159 _struct_2I = struct.Struct("<2I")