$search
00001 """autogenerated by genmsg_py from RxmEPH.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class RxmEPH(roslib.message.Message): 00007 _md5sum = "378ed135397be8e1e42a9e0e5eb180f5" 00008 _type = "ublox_msgs/RxmEPH" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# RXM-EPH (0x02 0x31) 00011 # GPS Aiding Ephemeris Input/Output Message 00012 # 00013 # This message is provided considered obsolete, please use AID-EPH instead! 00014 # - SF1D0 to SF3D7 is only sent if ephemeris is available for this SV. If not, the payload may 00015 # be reduced to 8 Bytes, or all bytes are set to zero, indicating that this SV Number does 00016 # not have valid ephemeris for the moment. 00017 # - SF1D0 to SF3D7 contain the 24 words following the Hand-Over Word ( HOW ) from the 00018 # GPS navigation message, subframes 1 to 3. See IS-GPS-200 for a full description of the 00019 # contents of the Subframes. 00020 # - In SF1D0 to SF3D7, 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 # 00023 00024 uint8 CLASS_ID = 2 00025 uint8 MESSAGE_ID = 49 00026 00027 uint32 svid # SV ID for which this ephemeris data is (Valid Range: 1 .. 32). 00028 uint32 how # Hand-Over Word of first Subframe. This is 00029 # required if data is sent to the receiver. 00030 # 0 indicates that no Ephemeris Data is following. 00031 00032 # Start of optional block 00033 uint32[] sf1d # Subframe 1 Words 3..10 (SF1D0..SF1D7) 00034 uint32[] sf2d # Subframe 2 Words 3..10 (SF2D0..SF2D7) 00035 uint32[] sf3d # Subframe 3 Words 3..10 (SF3D0..SF3D7) 00036 # End of optional block 00037 00038 """ 00039 # Pseudo-constants 00040 CLASS_ID = 2 00041 MESSAGE_ID = 49 00042 00043 __slots__ = ['svid','how','sf1d','sf2d','sf3d'] 00044 _slot_types = ['uint32','uint32','uint32[]','uint32[]','uint32[]'] 00045 00046 def __init__(self, *args, **kwds): 00047 """ 00048 Constructor. Any message fields that are implicitly/explicitly 00049 set to None will be assigned a default value. The recommend 00050 use is keyword arguments as this is more robust to future message 00051 changes. You cannot mix in-order arguments and keyword arguments. 00052 00053 The available fields are: 00054 svid,how,sf1d,sf2d,sf3d 00055 00056 @param args: complete set of field values, in .msg order 00057 @param kwds: use keyword arguments corresponding to message field names 00058 to set specific fields. 00059 """ 00060 if args or kwds: 00061 super(RxmEPH, self).__init__(*args, **kwds) 00062 #message fields cannot be None, assign default values for those that are 00063 if self.svid is None: 00064 self.svid = 0 00065 if self.how is None: 00066 self.how = 0 00067 if self.sf1d is None: 00068 self.sf1d = [] 00069 if self.sf2d is None: 00070 self.sf2d = [] 00071 if self.sf3d is None: 00072 self.sf3d = [] 00073 else: 00074 self.svid = 0 00075 self.how = 0 00076 self.sf1d = [] 00077 self.sf2d = [] 00078 self.sf3d = [] 00079 00080 def _get_types(self): 00081 """ 00082 internal API method 00083 """ 00084 return self._slot_types 00085 00086 def serialize(self, buff): 00087 """ 00088 serialize message into buffer 00089 @param buff: buffer 00090 @type buff: StringIO 00091 """ 00092 try: 00093 _x = self 00094 buff.write(_struct_2I.pack(_x.svid, _x.how)) 00095 length = len(self.sf1d) 00096 buff.write(_struct_I.pack(length)) 00097 pattern = '<%sI'%length 00098 buff.write(struct.pack(pattern, *self.sf1d)) 00099 length = len(self.sf2d) 00100 buff.write(_struct_I.pack(length)) 00101 pattern = '<%sI'%length 00102 buff.write(struct.pack(pattern, *self.sf2d)) 00103 length = len(self.sf3d) 00104 buff.write(_struct_I.pack(length)) 00105 pattern = '<%sI'%length 00106 buff.write(struct.pack(pattern, *self.sf3d)) 00107 except struct.error as se: self._check_types(se) 00108 except TypeError as te: self._check_types(te) 00109 00110 def deserialize(self, str): 00111 """ 00112 unpack serialized message in str into this message instance 00113 @param str: byte array of serialized message 00114 @type str: str 00115 """ 00116 try: 00117 end = 0 00118 _x = self 00119 start = end 00120 end += 8 00121 (_x.svid, _x.how,) = _struct_2I.unpack(str[start:end]) 00122 start = end 00123 end += 4 00124 (length,) = _struct_I.unpack(str[start:end]) 00125 pattern = '<%sI'%length 00126 start = end 00127 end += struct.calcsize(pattern) 00128 self.sf1d = struct.unpack(pattern, str[start:end]) 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 pattern = '<%sI'%length 00133 start = end 00134 end += struct.calcsize(pattern) 00135 self.sf2d = struct.unpack(pattern, str[start:end]) 00136 start = end 00137 end += 4 00138 (length,) = _struct_I.unpack(str[start:end]) 00139 pattern = '<%sI'%length 00140 start = end 00141 end += struct.calcsize(pattern) 00142 self.sf3d = struct.unpack(pattern, str[start:end]) 00143 return self 00144 except struct.error as e: 00145 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00146 00147 00148 def serialize_numpy(self, buff, numpy): 00149 """ 00150 serialize message with numpy array types into buffer 00151 @param buff: buffer 00152 @type buff: StringIO 00153 @param numpy: numpy python module 00154 @type numpy module 00155 """ 00156 try: 00157 _x = self 00158 buff.write(_struct_2I.pack(_x.svid, _x.how)) 00159 length = len(self.sf1d) 00160 buff.write(_struct_I.pack(length)) 00161 pattern = '<%sI'%length 00162 buff.write(self.sf1d.tostring()) 00163 length = len(self.sf2d) 00164 buff.write(_struct_I.pack(length)) 00165 pattern = '<%sI'%length 00166 buff.write(self.sf2d.tostring()) 00167 length = len(self.sf3d) 00168 buff.write(_struct_I.pack(length)) 00169 pattern = '<%sI'%length 00170 buff.write(self.sf3d.tostring()) 00171 except struct.error as se: self._check_types(se) 00172 except TypeError as te: self._check_types(te) 00173 00174 def deserialize_numpy(self, str, numpy): 00175 """ 00176 unpack serialized message in str into this message instance using numpy for array types 00177 @param str: byte array of serialized message 00178 @type str: str 00179 @param numpy: numpy python module 00180 @type numpy: module 00181 """ 00182 try: 00183 end = 0 00184 _x = self 00185 start = end 00186 end += 8 00187 (_x.svid, _x.how,) = _struct_2I.unpack(str[start:end]) 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 pattern = '<%sI'%length 00192 start = end 00193 end += struct.calcsize(pattern) 00194 self.sf1d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00195 start = end 00196 end += 4 00197 (length,) = _struct_I.unpack(str[start:end]) 00198 pattern = '<%sI'%length 00199 start = end 00200 end += struct.calcsize(pattern) 00201 self.sf2d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 pattern = '<%sI'%length 00206 start = end 00207 end += struct.calcsize(pattern) 00208 self.sf3d = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length) 00209 return self 00210 except struct.error as e: 00211 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00212 00213 _struct_I = roslib.message.struct_I 00214 _struct_2I = struct.Struct("<2I")