00001 """autogenerated by genmsg_py from App.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import app_manager.msg
00006
00007 class App(roslib.message.Message):
00008 _md5sum = "643c1db5f71b615a47789ff5e190811e"
00009 _type = "app_manager/App"
00010 _has_header = False
00011 _full_text = """# app name
00012 string name
00013 # user-friendly display name of application
00014 string display_name
00015 # icon for showing app
00016 Icon icon
00017 # ordered list (by preference) of client applications to interact with this robot app.
00018 ClientApp[] client_apps
00019
00020 ================================================================================
00021 MSG: app_manager/Icon
00022 # Image data format. "jpeg" or "png"
00023 string format
00024
00025 # Image data.
00026 uint8[] data
00027
00028 ================================================================================
00029 MSG: app_manager/ClientApp
00030 # like "android" or "web" or "linux"
00031 string client_type
00032
00033 # like "intent = ros.android.teleop" and "accelerometer = true", used to choose which ClientApp to use
00034 KeyValue[] manager_data
00035
00036 # parameters which just get passed through to the client app.
00037 KeyValue[] app_data
00038
00039 ================================================================================
00040 MSG: app_manager/KeyValue
00041 string key
00042 string value
00043
00044 """
00045 __slots__ = ['name','display_name','icon','client_apps']
00046 _slot_types = ['string','string','app_manager/Icon','app_manager/ClientApp[]']
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 name,display_name,icon,client_apps
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(App, self).__init__(*args, **kwds)
00064
00065 if self.name is None:
00066 self.name = ''
00067 if self.display_name is None:
00068 self.display_name = ''
00069 if self.icon is None:
00070 self.icon = app_manager.msg.Icon()
00071 if self.client_apps is None:
00072 self.client_apps = []
00073 else:
00074 self.name = ''
00075 self.display_name = ''
00076 self.icon = app_manager.msg.Icon()
00077 self.client_apps = []
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 _x = self.name
00093 length = len(_x)
00094 buff.write(struct.pack('<I%ss'%length, length, _x))
00095 _x = self.display_name
00096 length = len(_x)
00097 buff.write(struct.pack('<I%ss'%length, length, _x))
00098 _x = self.icon.format
00099 length = len(_x)
00100 buff.write(struct.pack('<I%ss'%length, length, _x))
00101 _x = self.icon.data
00102 length = len(_x)
00103
00104 if type(_x) in [list, tuple]:
00105 buff.write(struct.pack('<I%sB'%length, length, *_x))
00106 else:
00107 buff.write(struct.pack('<I%ss'%length, length, _x))
00108 length = len(self.client_apps)
00109 buff.write(_struct_I.pack(length))
00110 for val1 in self.client_apps:
00111 _x = val1.client_type
00112 length = len(_x)
00113 buff.write(struct.pack('<I%ss'%length, length, _x))
00114 length = len(val1.manager_data)
00115 buff.write(_struct_I.pack(length))
00116 for val2 in val1.manager_data:
00117 _x = val2.key
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 _x = val2.value
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 length = len(val1.app_data)
00124 buff.write(_struct_I.pack(length))
00125 for val2 in val1.app_data:
00126 _x = val2.key
00127 length = len(_x)
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 _x = val2.value
00130 length = len(_x)
00131 buff.write(struct.pack('<I%ss'%length, length, _x))
00132 except struct.error, se: self._check_types(se)
00133 except TypeError, te: self._check_types(te)
00134
00135 def deserialize(self, str):
00136 """
00137 unpack serialized message in str into this message instance
00138 @param str: byte array of serialized message
00139 @type str: str
00140 """
00141 try:
00142 if self.icon is None:
00143 self.icon = app_manager.msg.Icon()
00144 end = 0
00145 start = end
00146 end += 4
00147 (length,) = _struct_I.unpack(str[start:end])
00148 start = end
00149 end += length
00150 self.name = str[start:end]
00151 start = end
00152 end += 4
00153 (length,) = _struct_I.unpack(str[start:end])
00154 start = end
00155 end += length
00156 self.display_name = str[start:end]
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 start = end
00161 end += length
00162 self.icon.format = str[start:end]
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 start = end
00167 end += length
00168 self.icon.data = str[start:end]
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 self.client_apps = []
00173 for i in xrange(0, length):
00174 val1 = app_manager.msg.ClientApp()
00175 start = end
00176 end += 4
00177 (length,) = _struct_I.unpack(str[start:end])
00178 start = end
00179 end += length
00180 val1.client_type = str[start:end]
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 val1.manager_data = []
00185 for i in xrange(0, length):
00186 val2 = app_manager.msg.KeyValue()
00187 start = end
00188 end += 4
00189 (length,) = _struct_I.unpack(str[start:end])
00190 start = end
00191 end += length
00192 val2.key = str[start:end]
00193 start = end
00194 end += 4
00195 (length,) = _struct_I.unpack(str[start:end])
00196 start = end
00197 end += length
00198 val2.value = str[start:end]
00199 val1.manager_data.append(val2)
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 val1.app_data = []
00204 for i in xrange(0, length):
00205 val2 = app_manager.msg.KeyValue()
00206 start = end
00207 end += 4
00208 (length,) = _struct_I.unpack(str[start:end])
00209 start = end
00210 end += length
00211 val2.key = str[start:end]
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 start = end
00216 end += length
00217 val2.value = str[start:end]
00218 val1.app_data.append(val2)
00219 self.client_apps.append(val1)
00220 return self
00221 except struct.error, e:
00222 raise roslib.message.DeserializationError(e)
00223
00224
00225 def serialize_numpy(self, buff, numpy):
00226 """
00227 serialize message with numpy array types into buffer
00228 @param buff: buffer
00229 @type buff: StringIO
00230 @param numpy: numpy python module
00231 @type numpy module
00232 """
00233 try:
00234 _x = self.name
00235 length = len(_x)
00236 buff.write(struct.pack('<I%ss'%length, length, _x))
00237 _x = self.display_name
00238 length = len(_x)
00239 buff.write(struct.pack('<I%ss'%length, length, _x))
00240 _x = self.icon.format
00241 length = len(_x)
00242 buff.write(struct.pack('<I%ss'%length, length, _x))
00243 _x = self.icon.data
00244 length = len(_x)
00245
00246 if type(_x) in [list, tuple]:
00247 buff.write(struct.pack('<I%sB'%length, length, *_x))
00248 else:
00249 buff.write(struct.pack('<I%ss'%length, length, _x))
00250 length = len(self.client_apps)
00251 buff.write(_struct_I.pack(length))
00252 for val1 in self.client_apps:
00253 _x = val1.client_type
00254 length = len(_x)
00255 buff.write(struct.pack('<I%ss'%length, length, _x))
00256 length = len(val1.manager_data)
00257 buff.write(_struct_I.pack(length))
00258 for val2 in val1.manager_data:
00259 _x = val2.key
00260 length = len(_x)
00261 buff.write(struct.pack('<I%ss'%length, length, _x))
00262 _x = val2.value
00263 length = len(_x)
00264 buff.write(struct.pack('<I%ss'%length, length, _x))
00265 length = len(val1.app_data)
00266 buff.write(_struct_I.pack(length))
00267 for val2 in val1.app_data:
00268 _x = val2.key
00269 length = len(_x)
00270 buff.write(struct.pack('<I%ss'%length, length, _x))
00271 _x = val2.value
00272 length = len(_x)
00273 buff.write(struct.pack('<I%ss'%length, length, _x))
00274 except struct.error, se: self._check_types(se)
00275 except TypeError, te: self._check_types(te)
00276
00277 def deserialize_numpy(self, str, numpy):
00278 """
00279 unpack serialized message in str into this message instance using numpy for array types
00280 @param str: byte array of serialized message
00281 @type str: str
00282 @param numpy: numpy python module
00283 @type numpy: module
00284 """
00285 try:
00286 if self.icon is None:
00287 self.icon = app_manager.msg.Icon()
00288 end = 0
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 self.name = str[start:end]
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 start = end
00299 end += length
00300 self.display_name = str[start:end]
00301 start = end
00302 end += 4
00303 (length,) = _struct_I.unpack(str[start:end])
00304 start = end
00305 end += length
00306 self.icon.format = str[start:end]
00307 start = end
00308 end += 4
00309 (length,) = _struct_I.unpack(str[start:end])
00310 start = end
00311 end += length
00312 self.icon.data = str[start:end]
00313 start = end
00314 end += 4
00315 (length,) = _struct_I.unpack(str[start:end])
00316 self.client_apps = []
00317 for i in xrange(0, length):
00318 val1 = app_manager.msg.ClientApp()
00319 start = end
00320 end += 4
00321 (length,) = _struct_I.unpack(str[start:end])
00322 start = end
00323 end += length
00324 val1.client_type = str[start:end]
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 val1.manager_data = []
00329 for i in xrange(0, length):
00330 val2 = app_manager.msg.KeyValue()
00331 start = end
00332 end += 4
00333 (length,) = _struct_I.unpack(str[start:end])
00334 start = end
00335 end += length
00336 val2.key = str[start:end]
00337 start = end
00338 end += 4
00339 (length,) = _struct_I.unpack(str[start:end])
00340 start = end
00341 end += length
00342 val2.value = str[start:end]
00343 val1.manager_data.append(val2)
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 val1.app_data = []
00348 for i in xrange(0, length):
00349 val2 = app_manager.msg.KeyValue()
00350 start = end
00351 end += 4
00352 (length,) = _struct_I.unpack(str[start:end])
00353 start = end
00354 end += length
00355 val2.key = str[start:end]
00356 start = end
00357 end += 4
00358 (length,) = _struct_I.unpack(str[start:end])
00359 start = end
00360 end += length
00361 val2.value = str[start:end]
00362 val1.app_data.append(val2)
00363 self.client_apps.append(val1)
00364 return self
00365 except struct.error, e:
00366 raise roslib.message.DeserializationError(e)
00367
00368 _struct_I = roslib.message.struct_I