$search
00001 """autogenerated by genmsg_py from AidALM.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class AidALM(roslib.message.Message): 00007 _md5sum = "de5ab2550e698fc8acfb7263c7c55fa2" 00008 _type = "ublox_msgs/AidALM" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# RXM-ALM (0x02 0x30) 00011 # GPS Aiding Almanach Input/Output Message 00012 # 00013 # This message is provided considered obsolete, please use AID-ALM instead! 00014 # - If the WEEK Value is 0, DWRD0 to DWRD7 are not sent as the almanach is not available 00015 # for the given SV. This may happen even if NAV-SVINFO and RXM-SVSI are indicating 00016 # almanac availability as the internal data may not represent the content of an original 00017 # broadcast almanac (or only parts thereof). 00018 # - DWORD0 to DWORD7 contain the 8 words following the Hand-Over Word ( HOW ) 00019 # from the GPS navigation message, either pages 1 to 24 of sub-frame 5 or pages 2 to 10 00020 # of subframe 4. See IS-GPS-200 for a full description of the contents of the Almanac 00021 # pages. 00022 # - In DWORD0 to DWORD7, the parity bits have been removed, and the 24 bits of data are 00023 # located in Bits 0 to 23. Bits 24 to 31 shall be ignored. 00024 # - Example: Parameter e (Eccentricity) from Almanach Subframe 4/5, Word 3, Bits 69-84 00025 # within the subframe can be found in DWRD0, Bits 15-0 whereas Bit 0 is the LSB. 00026 00027 uint8 CLASS_ID = 11 00028 uint8 MESSAGE_ID = 48 00029 00030 uint32 svid # SV ID for which this Almanach Data is (Valid Range: 1 .. 32 or 51, 56, 63). 00031 uint32 week # Issue Date of Almanach (GPS week number) 00032 00033 # Start of optional block 00034 uint32[] dwrd # Almanach Words 00035 # End of optional block 00036 00037 """ 00038 # Pseudo-constants 00039 CLASS_ID = 11 00040 MESSAGE_ID = 48 00041 00042 __slots__ = ['svid','week','dwrd'] 00043 _slot_types = ['uint32','uint32','uint32[]'] 00044 00045 def __init__(self, *args, **kwds): 00046 """ 00047 Constructor. Any message fields that are implicitly/explicitly 00048 set to None will be assigned a default value. The recommend 00049 use is keyword arguments as this is more robust to future message 00050 changes. You cannot mix in-order arguments and keyword arguments. 00051 00052 The available fields are: 00053 svid,week,dwrd 00054 00055 @param args: complete set of field values, in .msg order 00056 @param kwds: use keyword arguments corresponding to message field names 00057 to set specific fields. 00058 """ 00059 if args or kwds: 00060 super(AidALM, self).__init__(*args, **kwds) 00061 #message fields cannot be None, assign default values for those that are 00062 if self.svid is None: 00063 self.svid = 0 00064 if self.week is None: 00065 self.week = 0 00066 if self.dwrd is None: 00067 self.dwrd = [] 00068 else: 00069 self.svid = 0 00070 self.week = 0 00071 self.dwrd = [] 00072 00073 def _get_types(self): 00074 """ 00075 internal API method 00076 """ 00077 return self._slot_types 00078 00079 def serialize(self, buff): 00080 """ 00081 serialize message into buffer 00082 @param buff: buffer 00083 @type buff: StringIO 00084 """ 00085 try: 00086 _x = self 00087 buff.write(_struct_2I.pack(_x.svid, _x.week)) 00088 length = len(self.dwrd) 00089 buff.write(_struct_I.pack(length)) 00090 pattern = '<%sI'%length 00091 buff.write(struct.pack(pattern, *self.dwrd)) 00092 except struct.error as se: self._check_types(se) 00093 except TypeError as te: self._check_types(te) 00094 00095 def deserialize(self, str): 00096 """ 00097 unpack serialized message in str into this message instance 00098 @param str: byte array of serialized message 00099 @type str: str 00100 """ 00101 try: 00102 end = 0 00103 _x = self 00104 start = end 00105 end += 8 00106 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end]) 00107 start = end 00108 end += 4 00109 (length,) = _struct_I.unpack(str[start:end]) 00110 pattern = '<%sI'%length 00111 start = end 00112 end += struct.calcsize(pattern) 00113 self.dwrd = struct.unpack(pattern, str[start:end]) 00114 return self 00115 except struct.error as e: 00116 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00117 00118 00119 def serialize_numpy(self, buff, numpy): 00120 """ 00121 serialize message with numpy array types into buffer 00122 @param buff: buffer 00123 @type buff: StringIO 00124 @param numpy: numpy python module 00125 @type numpy module 00126 """ 00127 try: 00128 _x = self 00129 buff.write(_struct_2I.pack(_x.svid, _x.week)) 00130 length = len(self.dwrd) 00131 buff.write(_struct_I.pack(length)) 00132 pattern = '<%sI'%length 00133 buff.write(self.dwrd.tostring()) 00134 except struct.error as se: self._check_types(se) 00135 except TypeError as te: self._check_types(te) 00136 00137 def deserialize_numpy(self, str, numpy): 00138 """ 00139 unpack serialized message in str into this message instance using numpy for array types 00140 @param str: byte array of serialized message 00141 @type str: str 00142 @param numpy: numpy python module 00143 @type numpy: module 00144 """ 00145 try: 00146 end = 0 00147 _x = self 00148 start = end 00149 end += 8 00150 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end]) 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 pattern = '<%sI'%length 00155 start = end 00156 end += struct.calcsize(pattern) 00157 self.dwrd = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00158 return self 00159 except struct.error as e: 00160 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00161 00162 _struct_I = roslib.message.struct_I 00163 _struct_2I = struct.Struct("<2I")