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