_NavSBAS.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ublox_msgs/NavSBAS.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 ublox_msgs.msg
00008 
00009 class NavSBAS(genpy.Message):
00010   _md5sum = "ef6bea20644abf57a149084ba2380e8c"
00011   _type = "ublox_msgs/NavSBAS"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# NAV-SBAS (0x01 0x32)
00014 # SBAS Status Data
00015 #
00016 # This message outputs the status of the SBAS sub system
00017 #
00018 
00019 uint8 CLASS_ID = 1
00020 uint8 MESSAGE_ID = 50
00021 
00022 uint32 iTOW             # GPS Millisecond time of week [ms]
00023 
00024 uint8 geo               # PRN Number of the GEO where correction and integrity data is used from
00025 
00026 uint8 mode              # SBAS Mode
00027 uint8 MODE_DISABLED = 0
00028 uint8 MODE_ENABLED_INTEGRITY = 1
00029 uint8 MODE_ENABLED_TESTMODE = 3
00030 
00031 int8 sys                # SBAS System (WAAS/EGNOS/...)
00032 int8 SYS_UNKNOWN = -1
00033 int8 SYS_WAAS = 0
00034 int8 SYS_EGNOS = 1
00035 int8 SYS_MSAS = 2
00036 int8 SYS_GPS = 16
00037 
00038 uint8 service           # SBAS Services available
00039 uint8 SERVICE_RANGING = 1
00040 uint8 SERVICE_CORRECTIONS = 2
00041 uint8 SERVICE_INTEGRITY = 4
00042 uint8 SERVICE_TESTMODE = 8
00043 
00044 uint8 cnt               # Number of SV data following
00045 uint8[3] reserved0      # Reserved
00046 
00047 NavSBAS_SV[] sv
00048 
00049 ================================================================================
00050 MSG: ublox_msgs/NavSBAS_SV
00051 # see message NavSBAS
00052 #
00053 
00054 uint8 svid              # SV Id
00055 uint8 flags             # Flags for this SV
00056 uint8 udre              # Monitoring status
00057 uint8 svSys             # System (WAAS/EGNOS/...), same as SYS
00058 uint8 svService         # Services available, same as SERVICE
00059 uint8 reserved1         # Reserved
00060 int16 prc               # Pseudo Range correction in [cm]
00061 uint16 reserved2        # Reserved
00062 int16 ic                # Ionosphere correction in [cm]
00063 
00064 """
00065   # Pseudo-constants
00066   CLASS_ID = 1
00067   MESSAGE_ID = 50
00068   MODE_DISABLED = 0
00069   MODE_ENABLED_INTEGRITY = 1
00070   MODE_ENABLED_TESTMODE = 3
00071   SYS_UNKNOWN = -1
00072   SYS_WAAS = 0
00073   SYS_EGNOS = 1
00074   SYS_MSAS = 2
00075   SYS_GPS = 16
00076   SERVICE_RANGING = 1
00077   SERVICE_CORRECTIONS = 2
00078   SERVICE_INTEGRITY = 4
00079   SERVICE_TESTMODE = 8
00080 
00081   __slots__ = ['iTOW','geo','mode','sys','service','cnt','reserved0','sv']
00082   _slot_types = ['uint32','uint8','uint8','int8','uint8','uint8','uint8[3]','ublox_msgs/NavSBAS_SV[]']
00083 
00084   def __init__(self, *args, **kwds):
00085     """
00086     Constructor. Any message fields that are implicitly/explicitly
00087     set to None will be assigned a default value. The recommend
00088     use is keyword arguments as this is more robust to future message
00089     changes.  You cannot mix in-order arguments and keyword arguments.
00090 
00091     The available fields are:
00092        iTOW,geo,mode,sys,service,cnt,reserved0,sv
00093 
00094     :param args: complete set of field values, in .msg order
00095     :param kwds: use keyword arguments corresponding to message field names
00096     to set specific fields.
00097     """
00098     if args or kwds:
00099       super(NavSBAS, self).__init__(*args, **kwds)
00100       #message fields cannot be None, assign default values for those that are
00101       if self.iTOW is None:
00102         self.iTOW = 0
00103       if self.geo is None:
00104         self.geo = 0
00105       if self.mode is None:
00106         self.mode = 0
00107       if self.sys is None:
00108         self.sys = 0
00109       if self.service is None:
00110         self.service = 0
00111       if self.cnt is None:
00112         self.cnt = 0
00113       if self.reserved0 is None:
00114         self.reserved0 = chr(0)*3
00115       if self.sv is None:
00116         self.sv = []
00117     else:
00118       self.iTOW = 0
00119       self.geo = 0
00120       self.mode = 0
00121       self.sys = 0
00122       self.service = 0
00123       self.cnt = 0
00124       self.reserved0 = chr(0)*3
00125       self.sv = []
00126 
00127   def _get_types(self):
00128     """
00129     internal API method
00130     """
00131     return self._slot_types
00132 
00133   def serialize(self, buff):
00134     """
00135     serialize message into buffer
00136     :param buff: buffer, ``StringIO``
00137     """
00138     try:
00139       _x = self
00140       buff.write(_struct_I2Bb2B.pack(_x.iTOW, _x.geo, _x.mode, _x.sys, _x.service, _x.cnt))
00141       _x = self.reserved0
00142       # - if encoded as a list instead, serialize as bytes instead of string
00143       if type(_x) in [list, tuple]:
00144         buff.write(_struct_3B.pack(*_x))
00145       else:
00146         buff.write(_struct_3s.pack(_x))
00147       length = len(self.sv)
00148       buff.write(_struct_I.pack(length))
00149       for val1 in self.sv:
00150         _x = val1
00151         buff.write(_struct_6BhHh.pack(_x.svid, _x.flags, _x.udre, _x.svSys, _x.svService, _x.reserved1, _x.prc, _x.reserved2, _x.ic))
00152     except struct.error as se: self._check_types(se)
00153     except TypeError as te: self._check_types(te)
00154 
00155   def deserialize(self, str):
00156     """
00157     unpack serialized message in str into this message instance
00158     :param str: byte array of serialized message, ``str``
00159     """
00160     try:
00161       if self.sv is None:
00162         self.sv = None
00163       end = 0
00164       _x = self
00165       start = end
00166       end += 9
00167       (_x.iTOW, _x.geo, _x.mode, _x.sys, _x.service, _x.cnt,) = _struct_I2Bb2B.unpack(str[start:end])
00168       start = end
00169       end += 3
00170       self.reserved0 = str[start:end]
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       self.sv = []
00175       for i in range(0, length):
00176         val1 = ublox_msgs.msg.NavSBAS_SV()
00177         _x = val1
00178         start = end
00179         end += 12
00180         (_x.svid, _x.flags, _x.udre, _x.svSys, _x.svService, _x.reserved1, _x.prc, _x.reserved2, _x.ic,) = _struct_6BhHh.unpack(str[start:end])
00181         self.sv.append(val1)
00182       return self
00183     except struct.error as e:
00184       raise genpy.DeserializationError(e) #most likely buffer underfill
00185 
00186 
00187   def serialize_numpy(self, buff, numpy):
00188     """
00189     serialize message with numpy array types into buffer
00190     :param buff: buffer, ``StringIO``
00191     :param numpy: numpy python module
00192     """
00193     try:
00194       _x = self
00195       buff.write(_struct_I2Bb2B.pack(_x.iTOW, _x.geo, _x.mode, _x.sys, _x.service, _x.cnt))
00196       _x = self.reserved0
00197       # - if encoded as a list instead, serialize as bytes instead of string
00198       if type(_x) in [list, tuple]:
00199         buff.write(_struct_3B.pack(*_x))
00200       else:
00201         buff.write(_struct_3s.pack(_x))
00202       length = len(self.sv)
00203       buff.write(_struct_I.pack(length))
00204       for val1 in self.sv:
00205         _x = val1
00206         buff.write(_struct_6BhHh.pack(_x.svid, _x.flags, _x.udre, _x.svSys, _x.svService, _x.reserved1, _x.prc, _x.reserved2, _x.ic))
00207     except struct.error as se: self._check_types(se)
00208     except TypeError as te: self._check_types(te)
00209 
00210   def deserialize_numpy(self, str, numpy):
00211     """
00212     unpack serialized message in str into this message instance using numpy for array types
00213     :param str: byte array of serialized message, ``str``
00214     :param numpy: numpy python module
00215     """
00216     try:
00217       if self.sv is None:
00218         self.sv = None
00219       end = 0
00220       _x = self
00221       start = end
00222       end += 9
00223       (_x.iTOW, _x.geo, _x.mode, _x.sys, _x.service, _x.cnt,) = _struct_I2Bb2B.unpack(str[start:end])
00224       start = end
00225       end += 3
00226       self.reserved0 = str[start:end]
00227       start = end
00228       end += 4
00229       (length,) = _struct_I.unpack(str[start:end])
00230       self.sv = []
00231       for i in range(0, length):
00232         val1 = ublox_msgs.msg.NavSBAS_SV()
00233         _x = val1
00234         start = end
00235         end += 12
00236         (_x.svid, _x.flags, _x.udre, _x.svSys, _x.svService, _x.reserved1, _x.prc, _x.reserved2, _x.ic,) = _struct_6BhHh.unpack(str[start:end])
00237         self.sv.append(val1)
00238       return self
00239     except struct.error as e:
00240       raise genpy.DeserializationError(e) #most likely buffer underfill
00241 
00242 _struct_I = genpy.struct_I
00243 _struct_3s = struct.Struct("<3s")
00244 _struct_3B = struct.Struct("<3B")
00245 _struct_6BhHh = struct.Struct("<6BhHh")
00246 _struct_I2Bb2B = struct.Struct("<I2Bb2B")
 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