$search
00001 """autogenerated by genmsg_py from CfgRATE.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class CfgRATE(roslib.message.Message): 00007 _md5sum = "da095554bde2600fd2a774def27fb48e" 00008 _type = "ublox_msgs/CfgRATE" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# CFG-RATE (0x06 0x08) 00011 # Navigation/Measurement Rate Settings 00012 # 00013 00014 uint8 CLASS_ID = 6 00015 uint8 MESSAGE_ID = 8 00016 00017 uint16 measRate # Measurement Rate, GPS measurements are 00018 # taken every measRate milliseconds [ms] 00019 uint16 navRate # Navigation Rate, in number of measurement 00020 # cycles. On u-blox 5 and u-blox 6, this parameter 00021 # cannot be changed, and is always equals 1. 00022 uint16 timeRef # Alignment to reference time: 0 = UTC time, 1 = GPS time 00023 uint16 TIME_REF_UTC = 0 00024 uint16 TIME_REF_GPS = 1 00025 00026 """ 00027 # Pseudo-constants 00028 CLASS_ID = 6 00029 MESSAGE_ID = 8 00030 TIME_REF_UTC = 0 00031 TIME_REF_GPS = 1 00032 00033 __slots__ = ['measRate','navRate','timeRef'] 00034 _slot_types = ['uint16','uint16','uint16'] 00035 00036 def __init__(self, *args, **kwds): 00037 """ 00038 Constructor. Any message fields that are implicitly/explicitly 00039 set to None will be assigned a default value. The recommend 00040 use is keyword arguments as this is more robust to future message 00041 changes. You cannot mix in-order arguments and keyword arguments. 00042 00043 The available fields are: 00044 measRate,navRate,timeRef 00045 00046 @param args: complete set of field values, in .msg order 00047 @param kwds: use keyword arguments corresponding to message field names 00048 to set specific fields. 00049 """ 00050 if args or kwds: 00051 super(CfgRATE, self).__init__(*args, **kwds) 00052 #message fields cannot be None, assign default values for those that are 00053 if self.measRate is None: 00054 self.measRate = 0 00055 if self.navRate is None: 00056 self.navRate = 0 00057 if self.timeRef is None: 00058 self.timeRef = 0 00059 else: 00060 self.measRate = 0 00061 self.navRate = 0 00062 self.timeRef = 0 00063 00064 def _get_types(self): 00065 """ 00066 internal API method 00067 """ 00068 return self._slot_types 00069 00070 def serialize(self, buff): 00071 """ 00072 serialize message into buffer 00073 @param buff: buffer 00074 @type buff: StringIO 00075 """ 00076 try: 00077 _x = self 00078 buff.write(_struct_3H.pack(_x.measRate, _x.navRate, _x.timeRef)) 00079 except struct.error as se: self._check_types(se) 00080 except TypeError as te: self._check_types(te) 00081 00082 def deserialize(self, str): 00083 """ 00084 unpack serialized message in str into this message instance 00085 @param str: byte array of serialized message 00086 @type str: str 00087 """ 00088 try: 00089 end = 0 00090 _x = self 00091 start = end 00092 end += 6 00093 (_x.measRate, _x.navRate, _x.timeRef,) = _struct_3H.unpack(str[start:end]) 00094 return self 00095 except struct.error as e: 00096 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00097 00098 00099 def serialize_numpy(self, buff, numpy): 00100 """ 00101 serialize message with numpy array types into buffer 00102 @param buff: buffer 00103 @type buff: StringIO 00104 @param numpy: numpy python module 00105 @type numpy module 00106 """ 00107 try: 00108 _x = self 00109 buff.write(_struct_3H.pack(_x.measRate, _x.navRate, _x.timeRef)) 00110 except struct.error as se: self._check_types(se) 00111 except TypeError as te: self._check_types(te) 00112 00113 def deserialize_numpy(self, str, numpy): 00114 """ 00115 unpack serialized message in str into this message instance using numpy for array types 00116 @param str: byte array of serialized message 00117 @type str: str 00118 @param numpy: numpy python module 00119 @type numpy: module 00120 """ 00121 try: 00122 end = 0 00123 _x = self 00124 start = end 00125 end += 6 00126 (_x.measRate, _x.navRate, _x.timeRef,) = _struct_3H.unpack(str[start:end]) 00127 return self 00128 except struct.error as e: 00129 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00130 00131 _struct_I = roslib.message.struct_I 00132 _struct_3H = struct.Struct("<3H")