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