_NavTIMEGPS.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ublox_msgs/NavTIMEGPS.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 NavTIMEGPS(genpy.Message):
00009   _md5sum = "4b13e924e2a4818785c01a54ff86bd76"
00010   _type = "ublox_msgs/NavTIMEGPS"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# NAV-TIMEGPS (0x01 0x20)
00013 # GPS Time Solution
00014 #
00015 
00016 uint8 CLASS_ID = 1
00017 uint8 MESSAGE_ID = 32
00018 
00019 uint32 iTOW             # GPS Millisecond time of week [ms]
00020 int32 fTOW              # Fractional Nanoseconds remainder of rounded
00021                         # ms above, range -500000 .. 500000 [ns]
00022 int16 week              # GPS week (GPS time)
00023 
00024 int8 leapS              # Leap Seconds (GPS-UTC) [s]
00025 
00026 uint8 valid             # Validity Flags
00027 uint8 VALID_TOW = 1         # Valid Time of Week
00028 uint8 VALID_WEEK = 2        # Valid Week Number
00029 uint8 VALID_UTC = 4         # Valid Leap Seconds, i.e. Leap Seconds already known
00030 
00031 uint32 tAcc             # Time Accuracy Estimate [ns]
00032 
00033 """
00034   # Pseudo-constants
00035   CLASS_ID = 1
00036   MESSAGE_ID = 32
00037   VALID_TOW = 1
00038   VALID_WEEK = 2
00039   VALID_UTC = 4
00040 
00041   __slots__ = ['iTOW','fTOW','week','leapS','valid','tAcc']
00042   _slot_types = ['uint32','int32','int16','int8','uint8','uint32']
00043 
00044   def __init__(self, *args, **kwds):
00045     """
00046     Constructor. Any message fields that are implicitly/explicitly
00047     set to None will be assigned a default value. The recommend
00048     use is keyword arguments as this is more robust to future message
00049     changes.  You cannot mix in-order arguments and keyword arguments.
00050 
00051     The available fields are:
00052        iTOW,fTOW,week,leapS,valid,tAcc
00053 
00054     :param args: complete set of field values, in .msg order
00055     :param kwds: use keyword arguments corresponding to message field names
00056     to set specific fields.
00057     """
00058     if args or kwds:
00059       super(NavTIMEGPS, self).__init__(*args, **kwds)
00060       #message fields cannot be None, assign default values for those that are
00061       if self.iTOW is None:
00062         self.iTOW = 0
00063       if self.fTOW is None:
00064         self.fTOW = 0
00065       if self.week is None:
00066         self.week = 0
00067       if self.leapS is None:
00068         self.leapS = 0
00069       if self.valid is None:
00070         self.valid = 0
00071       if self.tAcc is None:
00072         self.tAcc = 0
00073     else:
00074       self.iTOW = 0
00075       self.fTOW = 0
00076       self.week = 0
00077       self.leapS = 0
00078       self.valid = 0
00079       self.tAcc = 0
00080 
00081   def _get_types(self):
00082     """
00083     internal API method
00084     """
00085     return self._slot_types
00086 
00087   def serialize(self, buff):
00088     """
00089     serialize message into buffer
00090     :param buff: buffer, ``StringIO``
00091     """
00092     try:
00093       _x = self
00094       buff.write(_struct_IihbBI.pack(_x.iTOW, _x.fTOW, _x.week, _x.leapS, _x.valid, _x.tAcc))
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as te: self._check_types(te)
00097 
00098   def deserialize(self, str):
00099     """
00100     unpack serialized message in str into this message instance
00101     :param str: byte array of serialized message, ``str``
00102     """
00103     try:
00104       end = 0
00105       _x = self
00106       start = end
00107       end += 16
00108       (_x.iTOW, _x.fTOW, _x.week, _x.leapS, _x.valid, _x.tAcc,) = _struct_IihbBI.unpack(str[start:end])
00109       return self
00110     except struct.error as e:
00111       raise genpy.DeserializationError(e) #most likely buffer underfill
00112 
00113 
00114   def serialize_numpy(self, buff, numpy):
00115     """
00116     serialize message with numpy array types into buffer
00117     :param buff: buffer, ``StringIO``
00118     :param numpy: numpy python module
00119     """
00120     try:
00121       _x = self
00122       buff.write(_struct_IihbBI.pack(_x.iTOW, _x.fTOW, _x.week, _x.leapS, _x.valid, _x.tAcc))
00123     except struct.error as se: self._check_types(se)
00124     except TypeError as te: self._check_types(te)
00125 
00126   def deserialize_numpy(self, str, numpy):
00127     """
00128     unpack serialized message in str into this message instance using numpy for array types
00129     :param str: byte array of serialized message, ``str``
00130     :param numpy: numpy python module
00131     """
00132     try:
00133       end = 0
00134       _x = self
00135       start = end
00136       end += 16
00137       (_x.iTOW, _x.fTOW, _x.week, _x.leapS, _x.valid, _x.tAcc,) = _struct_IihbBI.unpack(str[start:end])
00138       return self
00139     except struct.error as e:
00140       raise genpy.DeserializationError(e) #most likely buffer underfill
00141 
00142 _struct_I = genpy.struct_I
00143 _struct_IihbBI = struct.Struct("<IihbBI")
 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