_RxmALM.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ublox_msgs/RxmALM.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 RxmALM(genpy.Message):
00009   _md5sum = "97a9e7864105ab31fc93f2e4bef9de26"
00010   _type = "ublox_msgs/RxmALM"
00011   _has_header = False #flag to mark the presence of a Header object
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.
00018 # - DWORD0 to DWORD7 contain the 8 words following the Hand-Over Word ( HOW )
00019 #   from the GPS navigation message, either pages 1 to 24 of sub-frame 5 or pages 2 to 10
00020 #   of subframe 4. See IS-GPS-200 for a full description of the contents of the Almanac
00021 #   pages.
00022 # - In DWORD0 to DWORD7, the parity bits have been removed, and the 24 bits of data are
00023 #   located in Bits 0 to 23. Bits 24 to 31 shall be ignored.
00024 # - Example: Parameter e (Eccentricity) from Almanach Subframe 4/5, Word 3, Bits 69-84
00025 #   within the subframe can be found in DWRD0, Bits 15-0 whereas Bit 0 is the LSB.
00026 #
00027 
00028 uint8 CLASS_ID = 2
00029 uint8 MESSAGE_ID = 48
00030 
00031 uint32 svid             # SV ID for which this Almanach Data is (Valid Range: 1 .. 32 or 51, 56, 63).
00032 uint32 week             # Issue Date of Almanach (GPS week number)
00033 
00034 # Start of optional block
00035 uint32[] dwrd           # Almanach Words
00036 # End of optional block
00037 
00038 """
00039   # Pseudo-constants
00040   CLASS_ID = 2
00041   MESSAGE_ID = 48
00042 
00043   __slots__ = ['svid','week','dwrd']
00044   _slot_types = ['uint32','uint32','uint32[]']
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        svid,week,dwrd
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(RxmALM, self).__init__(*args, **kwds)
00062       #message fields cannot be None, assign default values for those that are
00063       if self.svid is None:
00064         self.svid = 0
00065       if self.week is None:
00066         self.week = 0
00067       if self.dwrd is None:
00068         self.dwrd = []
00069     else:
00070       self.svid = 0
00071       self.week = 0
00072       self.dwrd = []
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_2I.pack(_x.svid, _x.week))
00088       length = len(self.dwrd)
00089       buff.write(_struct_I.pack(length))
00090       pattern = '<%sI'%length
00091       buff.write(struct.pack(pattern, *self.dwrd))
00092     except struct.error as se: self._check_types(se)
00093     except TypeError as te: self._check_types(te)
00094 
00095   def deserialize(self, str):
00096     """
00097     unpack serialized message in str into this message instance
00098     :param str: byte array of serialized message, ``str``
00099     """
00100     try:
00101       end = 0
00102       _x = self
00103       start = end
00104       end += 8
00105       (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end])
00106       start = end
00107       end += 4
00108       (length,) = _struct_I.unpack(str[start:end])
00109       pattern = '<%sI'%length
00110       start = end
00111       end += struct.calcsize(pattern)
00112       self.dwrd = struct.unpack(pattern, str[start:end])
00113       return self
00114     except struct.error as e:
00115       raise genpy.DeserializationError(e) #most likely buffer underfill
00116 
00117 
00118   def serialize_numpy(self, buff, numpy):
00119     """
00120     serialize message with numpy array types into buffer
00121     :param buff: buffer, ``StringIO``
00122     :param numpy: numpy python module
00123     """
00124     try:
00125       _x = self
00126       buff.write(_struct_2I.pack(_x.svid, _x.week))
00127       length = len(self.dwrd)
00128       buff.write(_struct_I.pack(length))
00129       pattern = '<%sI'%length
00130       buff.write(self.dwrd.tostring())
00131     except struct.error as se: self._check_types(se)
00132     except TypeError as te: self._check_types(te)
00133 
00134   def deserialize_numpy(self, str, numpy):
00135     """
00136     unpack serialized message in str into this message instance using numpy for array types
00137     :param str: byte array of serialized message, ``str``
00138     :param numpy: numpy python module
00139     """
00140     try:
00141       end = 0
00142       _x = self
00143       start = end
00144       end += 8
00145       (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end])
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       pattern = '<%sI'%length
00150       start = end
00151       end += struct.calcsize(pattern)
00152       self.dwrd = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
00153       return self
00154     except struct.error as e:
00155       raise genpy.DeserializationError(e) #most likely buffer underfill
00156 
00157 _struct_I = genpy.struct_I
00158 _struct_2I = struct.Struct("<2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


ublox_msgs
Author(s): Johannes Meyer
autogenerated on Mon Jul 15 2013 16:55:23