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