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