$search
00001 """autogenerated by genmsg_py from NMEAMessageSelect.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class NMEAMessageSelect(roslib.message.Message): 00008 _md5sum = "d988d97031c9db73713ce27fde744cff" 00009 _type = "applanix_msgs/NMEAMessageSelect" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Msg 35 00012 uint16 transaction 00013 00014 uint8[9] reserved 00015 00016 uint8 TALKER_IN=0 00017 uint8 TALKER_GP=1 00018 uint8 talker 00019 00020 uint8 ports_count 00021 COMPortMessages[] ports 00022 00023 ================================================================================ 00024 MSG: applanix_msgs/COMPortMessages 00025 uint8 port_num 00026 00027 uint32 MESSAGES_NMEA_GST=1 00028 uint32 MESSAGES_NMEA_GGA=2 00029 uint32 MESSAGES_NMEA_HDT=4 00030 uint32 MESSAGES_NMEA_ZDA=8 00031 uint32 MESSAGES_NMEA_EVT1=16 00032 uint32 MESSAGES_NMEA_EVT2=32 00033 uint32 MESSAGES_NMEA_VTG=64 00034 uint32 MESSAGES_NMEA_PASHR=128 00035 uint32 MESSAGES_NMEA_GGA2=8192 00036 uint32 MESSAGES_NMEA_PPS=16384 00037 uint32 MESSAGES_NMEA_GGK=32768 00038 uint32 MESSAGES_NMEA_RMC=65536 00039 uint32 MESSAGES_BIN_GIMBAL_LOOP=1 00040 uint32 MESSAGES_BIN_RDR1=2 00041 uint32 MESSAGES_BIN_PAST2=4 00042 uint32 MESSAGES_BIN_PPS=65536 00043 uint32 MESSAGES_BIN_TM1B=131072 00044 uint32 messages 00045 00046 uint8 update_rate 00047 00048 """ 00049 # Pseudo-constants 00050 TALKER_IN = 0 00051 TALKER_GP = 1 00052 00053 __slots__ = ['transaction','reserved','talker','ports_count','ports'] 00054 _slot_types = ['uint16','uint8[9]','uint8','uint8','applanix_msgs/COMPortMessages[]'] 00055 00056 def __init__(self, *args, **kwds): 00057 """ 00058 Constructor. Any message fields that are implicitly/explicitly 00059 set to None will be assigned a default value. The recommend 00060 use is keyword arguments as this is more robust to future message 00061 changes. You cannot mix in-order arguments and keyword arguments. 00062 00063 The available fields are: 00064 transaction,reserved,talker,ports_count,ports 00065 00066 @param args: complete set of field values, in .msg order 00067 @param kwds: use keyword arguments corresponding to message field names 00068 to set specific fields. 00069 """ 00070 if args or kwds: 00071 super(NMEAMessageSelect, self).__init__(*args, **kwds) 00072 #message fields cannot be None, assign default values for those that are 00073 if self.transaction is None: 00074 self.transaction = 0 00075 if self.reserved is None: 00076 self.reserved = chr(0)*9 00077 if self.talker is None: 00078 self.talker = 0 00079 if self.ports_count is None: 00080 self.ports_count = 0 00081 if self.ports is None: 00082 self.ports = [] 00083 else: 00084 self.transaction = 0 00085 self.reserved = chr(0)*9 00086 self.talker = 0 00087 self.ports_count = 0 00088 self.ports = [] 00089 00090 def _get_types(self): 00091 """ 00092 internal API method 00093 """ 00094 return self._slot_types 00095 00096 def serialize(self, buff): 00097 """ 00098 serialize message into buffer 00099 @param buff: buffer 00100 @type buff: StringIO 00101 """ 00102 try: 00103 buff.write(_struct_H.pack(self.transaction)) 00104 _x = self.reserved 00105 # - if encoded as a list instead, serialize as bytes instead of string 00106 if type(_x) in [list, tuple]: 00107 buff.write(_struct_9B.pack(*_x)) 00108 else: 00109 buff.write(_struct_9s.pack(_x)) 00110 _x = self 00111 buff.write(_struct_2B.pack(_x.talker, _x.ports_count)) 00112 length = len(self.ports) 00113 buff.write(_struct_I.pack(length)) 00114 for val1 in self.ports: 00115 _x = val1 00116 buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate)) 00117 except struct.error as se: self._check_types(se) 00118 except TypeError as te: self._check_types(te) 00119 00120 def deserialize(self, str): 00121 """ 00122 unpack serialized message in str into this message instance 00123 @param str: byte array of serialized message 00124 @type str: str 00125 """ 00126 try: 00127 end = 0 00128 start = end 00129 end += 2 00130 (self.transaction,) = _struct_H.unpack(str[start:end]) 00131 start = end 00132 end += 9 00133 self.reserved = str[start:end] 00134 _x = self 00135 start = end 00136 end += 2 00137 (_x.talker, _x.ports_count,) = _struct_2B.unpack(str[start:end]) 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 self.ports = [] 00142 for i in range(0, length): 00143 val1 = applanix_msgs.msg.COMPortMessages() 00144 _x = val1 00145 start = end 00146 end += 6 00147 (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end]) 00148 self.ports.append(val1) 00149 return self 00150 except struct.error as e: 00151 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00152 00153 00154 def serialize_numpy(self, buff, numpy): 00155 """ 00156 serialize message with numpy array types into buffer 00157 @param buff: buffer 00158 @type buff: StringIO 00159 @param numpy: numpy python module 00160 @type numpy module 00161 """ 00162 try: 00163 buff.write(_struct_H.pack(self.transaction)) 00164 _x = self.reserved 00165 # - if encoded as a list instead, serialize as bytes instead of string 00166 if type(_x) in [list, tuple]: 00167 buff.write(_struct_9B.pack(*_x)) 00168 else: 00169 buff.write(_struct_9s.pack(_x)) 00170 _x = self 00171 buff.write(_struct_2B.pack(_x.talker, _x.ports_count)) 00172 length = len(self.ports) 00173 buff.write(_struct_I.pack(length)) 00174 for val1 in self.ports: 00175 _x = val1 00176 buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate)) 00177 except struct.error as se: self._check_types(se) 00178 except TypeError as te: self._check_types(te) 00179 00180 def deserialize_numpy(self, str, numpy): 00181 """ 00182 unpack serialized message in str into this message instance using numpy for array types 00183 @param str: byte array of serialized message 00184 @type str: str 00185 @param numpy: numpy python module 00186 @type numpy: module 00187 """ 00188 try: 00189 end = 0 00190 start = end 00191 end += 2 00192 (self.transaction,) = _struct_H.unpack(str[start:end]) 00193 start = end 00194 end += 9 00195 self.reserved = str[start:end] 00196 _x = self 00197 start = end 00198 end += 2 00199 (_x.talker, _x.ports_count,) = _struct_2B.unpack(str[start:end]) 00200 start = end 00201 end += 4 00202 (length,) = _struct_I.unpack(str[start:end]) 00203 self.ports = [] 00204 for i in range(0, length): 00205 val1 = applanix_msgs.msg.COMPortMessages() 00206 _x = val1 00207 start = end 00208 end += 6 00209 (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end]) 00210 self.ports.append(val1) 00211 return self 00212 except struct.error as e: 00213 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00214 00215 _struct_I = roslib.message.struct_I 00216 _struct_H = struct.Struct("<H") 00217 _struct_9s = struct.Struct("<9s") 00218 _struct_9B = struct.Struct("<9B") 00219 _struct_BIB = struct.Struct("<BIB") 00220 _struct_2B = struct.Struct("<2B")