_NavDGPS.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ublox_msgs/NavDGPS.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 NavDGPS(genpy.Message):
00010   _md5sum = "b0aba8454084620f2a8eb7ff6445368c"
00011   _type = "ublox_msgs/NavDGPS"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# NAV-DGPS (0x01 0x31)
00014 # DGPS Data Used for NAV
00015 #
00016 # This message outputs the Correction data as it has been applied to the current NAV
00017 # Solution. See also the notes on the RTCM protocol.
00018 #
00019 
00020 uint8 CLASS_ID = 1
00021 uint8 MESSAGE_ID = 31
00022 
00023 uint32 iTOW             # GPS Millisecond time of week [ms]
00024 
00025 int32 age               # Age of newest correction data [ms]
00026 int16 baseId            # DGPS Base Station ID
00027 int16 baseHealth        # DGPS Base Station Health Status
00028 int8 numCh              # Number of channels for which correction data is following
00029 
00030 uint8 status            # DGPS Correction Type Status
00031 uint8 DGPS_CORRECTION_NONE = 0
00032 uint8 DGPS_CORRECTION_PR_PRR = 1
00033 
00034 uint16 reserved1        # Reserved
00035 
00036 NavDGPS_SV[] sv
00037 
00038 ================================================================================
00039 MSG: ublox_msgs/NavDGPS_SV
00040 # see message NavDGPS
00041 
00042 uint8 svid              # Satellite ID
00043 
00044 uint8 flags             # Bitmask / Channel Number
00045 uint8 CHANNEL1 = 1
00046 uint8 CHANNEL2 = 2
00047 uint8 CHANNEL3 = 3
00048 uint8 CHANNEL4 = 4
00049 uint8 CHANNEL5 = 5
00050 uint8 CHANNEL6 = 6
00051 uint8 CHANNEL7 = 7
00052 uint8 CHANNEL8 = 8
00053 uint8 DGPS = 16
00054 
00055 uint16 ageC             # Age of latest correction data [ms]
00056 float32 prc             # Pseudo Range Correction [m]
00057 float32 prrc            # Pseudo Range Rate Correction [m/s]
00058 
00059 
00060 """
00061   # Pseudo-constants
00062   CLASS_ID = 1
00063   MESSAGE_ID = 31
00064   DGPS_CORRECTION_NONE = 0
00065   DGPS_CORRECTION_PR_PRR = 1
00066 
00067   __slots__ = ['iTOW','age','baseId','baseHealth','numCh','status','reserved1','sv']
00068   _slot_types = ['uint32','int32','int16','int16','int8','uint8','uint16','ublox_msgs/NavDGPS_SV[]']
00069 
00070   def __init__(self, *args, **kwds):
00071     """
00072     Constructor. Any message fields that are implicitly/explicitly
00073     set to None will be assigned a default value. The recommend
00074     use is keyword arguments as this is more robust to future message
00075     changes.  You cannot mix in-order arguments and keyword arguments.
00076 
00077     The available fields are:
00078        iTOW,age,baseId,baseHealth,numCh,status,reserved1,sv
00079 
00080     :param args: complete set of field values, in .msg order
00081     :param kwds: use keyword arguments corresponding to message field names
00082     to set specific fields.
00083     """
00084     if args or kwds:
00085       super(NavDGPS, self).__init__(*args, **kwds)
00086       #message fields cannot be None, assign default values for those that are
00087       if self.iTOW is None:
00088         self.iTOW = 0
00089       if self.age is None:
00090         self.age = 0
00091       if self.baseId is None:
00092         self.baseId = 0
00093       if self.baseHealth is None:
00094         self.baseHealth = 0
00095       if self.numCh is None:
00096         self.numCh = 0
00097       if self.status is None:
00098         self.status = 0
00099       if self.reserved1 is None:
00100         self.reserved1 = 0
00101       if self.sv is None:
00102         self.sv = []
00103     else:
00104       self.iTOW = 0
00105       self.age = 0
00106       self.baseId = 0
00107       self.baseHealth = 0
00108       self.numCh = 0
00109       self.status = 0
00110       self.reserved1 = 0
00111       self.sv = []
00112 
00113   def _get_types(self):
00114     """
00115     internal API method
00116     """
00117     return self._slot_types
00118 
00119   def serialize(self, buff):
00120     """
00121     serialize message into buffer
00122     :param buff: buffer, ``StringIO``
00123     """
00124     try:
00125       _x = self
00126       buff.write(_struct_Ii2hbBH.pack(_x.iTOW, _x.age, _x.baseId, _x.baseHealth, _x.numCh, _x.status, _x.reserved1))
00127       length = len(self.sv)
00128       buff.write(_struct_I.pack(length))
00129       for val1 in self.sv:
00130         _x = val1
00131         buff.write(_struct_2BH2f.pack(_x.svid, _x.flags, _x.ageC, _x.prc, _x.prrc))
00132     except struct.error as se: self._check_types(se)
00133     except TypeError as te: self._check_types(te)
00134 
00135   def deserialize(self, str):
00136     """
00137     unpack serialized message in str into this message instance
00138     :param str: byte array of serialized message, ``str``
00139     """
00140     try:
00141       if self.sv is None:
00142         self.sv = None
00143       end = 0
00144       _x = self
00145       start = end
00146       end += 16
00147       (_x.iTOW, _x.age, _x.baseId, _x.baseHealth, _x.numCh, _x.status, _x.reserved1,) = _struct_Ii2hbBH.unpack(str[start:end])
00148       start = end
00149       end += 4
00150       (length,) = _struct_I.unpack(str[start:end])
00151       self.sv = []
00152       for i in range(0, length):
00153         val1 = ublox_msgs.msg.NavDGPS_SV()
00154         _x = val1
00155         start = end
00156         end += 12
00157         (_x.svid, _x.flags, _x.ageC, _x.prc, _x.prrc,) = _struct_2BH2f.unpack(str[start:end])
00158         self.sv.append(val1)
00159       return self
00160     except struct.error as e:
00161       raise genpy.DeserializationError(e) #most likely buffer underfill
00162 
00163 
00164   def serialize_numpy(self, buff, numpy):
00165     """
00166     serialize message with numpy array types into buffer
00167     :param buff: buffer, ``StringIO``
00168     :param numpy: numpy python module
00169     """
00170     try:
00171       _x = self
00172       buff.write(_struct_Ii2hbBH.pack(_x.iTOW, _x.age, _x.baseId, _x.baseHealth, _x.numCh, _x.status, _x.reserved1))
00173       length = len(self.sv)
00174       buff.write(_struct_I.pack(length))
00175       for val1 in self.sv:
00176         _x = val1
00177         buff.write(_struct_2BH2f.pack(_x.svid, _x.flags, _x.ageC, _x.prc, _x.prrc))
00178     except struct.error as se: self._check_types(se)
00179     except TypeError as te: self._check_types(te)
00180 
00181   def deserialize_numpy(self, str, numpy):
00182     """
00183     unpack serialized message in str into this message instance using numpy for array types
00184     :param str: byte array of serialized message, ``str``
00185     :param numpy: numpy python module
00186     """
00187     try:
00188       if self.sv is None:
00189         self.sv = None
00190       end = 0
00191       _x = self
00192       start = end
00193       end += 16
00194       (_x.iTOW, _x.age, _x.baseId, _x.baseHealth, _x.numCh, _x.status, _x.reserved1,) = _struct_Ii2hbBH.unpack(str[start:end])
00195       start = end
00196       end += 4
00197       (length,) = _struct_I.unpack(str[start:end])
00198       self.sv = []
00199       for i in range(0, length):
00200         val1 = ublox_msgs.msg.NavDGPS_SV()
00201         _x = val1
00202         start = end
00203         end += 12
00204         (_x.svid, _x.flags, _x.ageC, _x.prc, _x.prrc,) = _struct_2BH2f.unpack(str[start:end])
00205         self.sv.append(val1)
00206       return self
00207     except struct.error as e:
00208       raise genpy.DeserializationError(e) #most likely buffer underfill
00209 
00210 _struct_I = genpy.struct_I
00211 _struct_2BH2f = struct.Struct("<2BH2f")
00212 _struct_Ii2hbBH = struct.Struct("<Ii2hbBH")
 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