$search
00001 """autogenerated by genmsg_py from RxmALM.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class RxmALM(roslib.message.Message): 00007 _md5sum = "97a9e7864105ab31fc93f2e4bef9de26" 00008 _type = "ublox_msgs/RxmALM" 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. 00016 # - DWORD0 to DWORD7 contain the 8 words following the Hand-Over Word ( HOW ) 00017 # from the GPS navigation message, either pages 1 to 24 of sub-frame 5 or pages 2 to 10 00018 # of subframe 4. See IS-GPS-200 for a full description of the contents of the Almanac 00019 # pages. 00020 # - In DWORD0 to DWORD7, the parity bits have been removed, and the 24 bits of data are 00021 # located in Bits 0 to 23. Bits 24 to 31 shall be ignored. 00022 # - Example: Parameter e (Eccentricity) from Almanach Subframe 4/5, Word 3, Bits 69-84 00023 # within the subframe can be found in DWRD0, Bits 15-0 whereas Bit 0 is the LSB. 00024 # 00025 00026 uint8 CLASS_ID = 2 00027 uint8 MESSAGE_ID = 48 00028 00029 uint32 svid # SV ID for which this Almanach Data is (Valid Range: 1 .. 32 or 51, 56, 63). 00030 uint32 week # Issue Date of Almanach (GPS week number) 00031 00032 # Start of optional block 00033 uint32[] dwrd # Almanach Words 00034 # End of optional block 00035 00036 """ 00037 # Pseudo-constants 00038 CLASS_ID = 2 00039 MESSAGE_ID = 48 00040 00041 __slots__ = ['svid','week','dwrd'] 00042 _slot_types = ['uint32','uint32','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 svid,week,dwrd 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(RxmALM, self).__init__(*args, **kwds) 00060 #message fields cannot be None, assign default values for those that are 00061 if self.svid is None: 00062 self.svid = 0 00063 if self.week is None: 00064 self.week = 0 00065 if self.dwrd is None: 00066 self.dwrd = [] 00067 else: 00068 self.svid = 0 00069 self.week = 0 00070 self.dwrd = [] 00071 00072 def _get_types(self): 00073 """ 00074 internal API method 00075 """ 00076 return self._slot_types 00077 00078 def serialize(self, buff): 00079 """ 00080 serialize message into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 """ 00084 try: 00085 _x = self 00086 buff.write(_struct_2I.pack(_x.svid, _x.week)) 00087 length = len(self.dwrd) 00088 buff.write(_struct_I.pack(length)) 00089 pattern = '<%sI'%length 00090 buff.write(struct.pack(pattern, *self.dwrd)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 end = 0 00102 _x = self 00103 start = end 00104 end += 8 00105 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end]) 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 pattern = '<%sI'%length 00110 start = end 00111 end += struct.calcsize(pattern) 00112 self.dwrd = struct.unpack(pattern, str[start:end]) 00113 return self 00114 except struct.error as e: 00115 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00116 00117 00118 def serialize_numpy(self, buff, numpy): 00119 """ 00120 serialize message with numpy array types into buffer 00121 @param buff: buffer 00122 @type buff: StringIO 00123 @param numpy: numpy python module 00124 @type numpy module 00125 """ 00126 try: 00127 _x = self 00128 buff.write(_struct_2I.pack(_x.svid, _x.week)) 00129 length = len(self.dwrd) 00130 buff.write(_struct_I.pack(length)) 00131 pattern = '<%sI'%length 00132 buff.write(self.dwrd.tostring()) 00133 except struct.error as se: self._check_types(se) 00134 except TypeError as te: self._check_types(te) 00135 00136 def deserialize_numpy(self, str, numpy): 00137 """ 00138 unpack serialized message in str into this message instance using numpy for array types 00139 @param str: byte array of serialized message 00140 @type str: str 00141 @param numpy: numpy python module 00142 @type numpy: module 00143 """ 00144 try: 00145 end = 0 00146 _x = self 00147 start = end 00148 end += 8 00149 (_x.svid, _x.week,) = _struct_2I.unpack(str[start:end]) 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 pattern = '<%sI'%length 00154 start = end 00155 end += struct.calcsize(pattern) 00156 self.dwrd = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00157 return self 00158 except struct.error as e: 00159 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00160 00161 _struct_I = roslib.message.struct_I 00162 _struct_2I = struct.Struct("<2I")