00001 """autogenerated by genpy from turtlebot_app_manager/ClientApp.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import turtlebot_app_manager.msg
00008
00009 class ClientApp(genpy.Message):
00010 _md5sum = "0a8112672c3fbf73cb62ec78d67e41bb"
00011 _type = "turtlebot_app_manager/ClientApp"
00012 _has_header = False
00013 _full_text = """# like "android" or "web" or "linux"
00014 string client_type
00015
00016 # like "intent = ros.android.teleop" and "accelerometer = true", used to choose which ClientApp to use
00017 KeyValue[] manager_data
00018
00019 # parameters which just get passed through to the client app.
00020 KeyValue[] app_data
00021
00022 ================================================================================
00023 MSG: turtlebot_app_manager/KeyValue
00024 string key
00025 string value
00026
00027 """
00028 __slots__ = ['client_type','manager_data','app_data']
00029 _slot_types = ['string','turtlebot_app_manager/KeyValue[]','turtlebot_app_manager/KeyValue[]']
00030
00031 def __init__(self, *args, **kwds):
00032 """
00033 Constructor. Any message fields that are implicitly/explicitly
00034 set to None will be assigned a default value. The recommend
00035 use is keyword arguments as this is more robust to future message
00036 changes. You cannot mix in-order arguments and keyword arguments.
00037
00038 The available fields are:
00039 client_type,manager_data,app_data
00040
00041 :param args: complete set of field values, in .msg order
00042 :param kwds: use keyword arguments corresponding to message field names
00043 to set specific fields.
00044 """
00045 if args or kwds:
00046 super(ClientApp, self).__init__(*args, **kwds)
00047
00048 if self.client_type is None:
00049 self.client_type = ''
00050 if self.manager_data is None:
00051 self.manager_data = []
00052 if self.app_data is None:
00053 self.app_data = []
00054 else:
00055 self.client_type = ''
00056 self.manager_data = []
00057 self.app_data = []
00058
00059 def _get_types(self):
00060 """
00061 internal API method
00062 """
00063 return self._slot_types
00064
00065 def serialize(self, buff):
00066 """
00067 serialize message into buffer
00068 :param buff: buffer, ``StringIO``
00069 """
00070 try:
00071 _x = self.client_type
00072 length = len(_x)
00073 if python3 or type(_x) == unicode:
00074 _x = _x.encode('utf-8')
00075 length = len(_x)
00076 buff.write(struct.pack('<I%ss'%length, length, _x))
00077 length = len(self.manager_data)
00078 buff.write(_struct_I.pack(length))
00079 for val1 in self.manager_data:
00080 _x = val1.key
00081 length = len(_x)
00082 if python3 or type(_x) == unicode:
00083 _x = _x.encode('utf-8')
00084 length = len(_x)
00085 buff.write(struct.pack('<I%ss'%length, length, _x))
00086 _x = val1.value
00087 length = len(_x)
00088 if python3 or type(_x) == unicode:
00089 _x = _x.encode('utf-8')
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 length = len(self.app_data)
00093 buff.write(_struct_I.pack(length))
00094 for val1 in self.app_data:
00095 _x = val1.key
00096 length = len(_x)
00097 if python3 or type(_x) == unicode:
00098 _x = _x.encode('utf-8')
00099 length = len(_x)
00100 buff.write(struct.pack('<I%ss'%length, length, _x))
00101 _x = val1.value
00102 length = len(_x)
00103 if python3 or type(_x) == unicode:
00104 _x = _x.encode('utf-8')
00105 length = len(_x)
00106 buff.write(struct.pack('<I%ss'%length, length, _x))
00107 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00108 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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, ``str``
00114 """
00115 try:
00116 if self.manager_data is None:
00117 self.manager_data = None
00118 if self.app_data is None:
00119 self.app_data = None
00120 end = 0
00121 start = end
00122 end += 4
00123 (length,) = _struct_I.unpack(str[start:end])
00124 start = end
00125 end += length
00126 if python3:
00127 self.client_type = str[start:end].decode('utf-8')
00128 else:
00129 self.client_type = str[start:end]
00130 start = end
00131 end += 4
00132 (length,) = _struct_I.unpack(str[start:end])
00133 self.manager_data = []
00134 for i in range(0, length):
00135 val1 = turtlebot_app_manager.msg.KeyValue()
00136 start = end
00137 end += 4
00138 (length,) = _struct_I.unpack(str[start:end])
00139 start = end
00140 end += length
00141 if python3:
00142 val1.key = str[start:end].decode('utf-8')
00143 else:
00144 val1.key = str[start:end]
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 if python3:
00151 val1.value = str[start:end].decode('utf-8')
00152 else:
00153 val1.value = str[start:end]
00154 self.manager_data.append(val1)
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 self.app_data = []
00159 for i in range(0, length):
00160 val1 = turtlebot_app_manager.msg.KeyValue()
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 if python3:
00167 val1.key = str[start:end].decode('utf-8')
00168 else:
00169 val1.key = str[start:end]
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 start = end
00174 end += length
00175 if python3:
00176 val1.value = str[start:end].decode('utf-8')
00177 else:
00178 val1.value = str[start:end]
00179 self.app_data.append(val1)
00180 return self
00181 except struct.error as e:
00182 raise genpy.DeserializationError(e)
00183
00184
00185 def serialize_numpy(self, buff, numpy):
00186 """
00187 serialize message with numpy array types into buffer
00188 :param buff: buffer, ``StringIO``
00189 :param numpy: numpy python module
00190 """
00191 try:
00192 _x = self.client_type
00193 length = len(_x)
00194 if python3 or type(_x) == unicode:
00195 _x = _x.encode('utf-8')
00196 length = len(_x)
00197 buff.write(struct.pack('<I%ss'%length, length, _x))
00198 length = len(self.manager_data)
00199 buff.write(_struct_I.pack(length))
00200 for val1 in self.manager_data:
00201 _x = val1.key
00202 length = len(_x)
00203 if python3 or type(_x) == unicode:
00204 _x = _x.encode('utf-8')
00205 length = len(_x)
00206 buff.write(struct.pack('<I%ss'%length, length, _x))
00207 _x = val1.value
00208 length = len(_x)
00209 if python3 or type(_x) == unicode:
00210 _x = _x.encode('utf-8')
00211 length = len(_x)
00212 buff.write(struct.pack('<I%ss'%length, length, _x))
00213 length = len(self.app_data)
00214 buff.write(_struct_I.pack(length))
00215 for val1 in self.app_data:
00216 _x = val1.key
00217 length = len(_x)
00218 if python3 or type(_x) == unicode:
00219 _x = _x.encode('utf-8')
00220 length = len(_x)
00221 buff.write(struct.pack('<I%ss'%length, length, _x))
00222 _x = val1.value
00223 length = len(_x)
00224 if python3 or type(_x) == unicode:
00225 _x = _x.encode('utf-8')
00226 length = len(_x)
00227 buff.write(struct.pack('<I%ss'%length, length, _x))
00228 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00229 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00230
00231 def deserialize_numpy(self, str, numpy):
00232 """
00233 unpack serialized message in str into this message instance using numpy for array types
00234 :param str: byte array of serialized message, ``str``
00235 :param numpy: numpy python module
00236 """
00237 try:
00238 if self.manager_data is None:
00239 self.manager_data = None
00240 if self.app_data is None:
00241 self.app_data = None
00242 end = 0
00243 start = end
00244 end += 4
00245 (length,) = _struct_I.unpack(str[start:end])
00246 start = end
00247 end += length
00248 if python3:
00249 self.client_type = str[start:end].decode('utf-8')
00250 else:
00251 self.client_type = str[start:end]
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 self.manager_data = []
00256 for i in range(0, length):
00257 val1 = turtlebot_app_manager.msg.KeyValue()
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 if python3:
00264 val1.key = str[start:end].decode('utf-8')
00265 else:
00266 val1.key = str[start:end]
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 start = end
00271 end += length
00272 if python3:
00273 val1.value = str[start:end].decode('utf-8')
00274 else:
00275 val1.value = str[start:end]
00276 self.manager_data.append(val1)
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 self.app_data = []
00281 for i in range(0, length):
00282 val1 = turtlebot_app_manager.msg.KeyValue()
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 start = end
00287 end += length
00288 if python3:
00289 val1.key = str[start:end].decode('utf-8')
00290 else:
00291 val1.key = str[start:end]
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 start = end
00296 end += length
00297 if python3:
00298 val1.value = str[start:end].decode('utf-8')
00299 else:
00300 val1.value = str[start:end]
00301 self.app_data.append(val1)
00302 return self
00303 except struct.error as e:
00304 raise genpy.DeserializationError(e)
00305
00306 _struct_I = genpy.struct_I