00001 """autogenerated by genmsg_py from AppList.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import app_manager.msg
00006
00007 class AppList(roslib.message.Message):
00008 _md5sum = "8a71ede6bf51909653c7c551f462cb30"
00009 _type = "app_manager/AppList"
00010 _has_header = False
00011 _full_text = """App[] running_apps
00012 App[] available_apps
00013
00014 ================================================================================
00015 MSG: app_manager/App
00016 # app name
00017 string name
00018 # user-friendly display name of application
00019 string display_name
00020 # icon for showing app
00021 Icon icon
00022 # ordered list (by preference) of client applications to interact with this robot app.
00023 ClientApp[] client_apps
00024
00025 ================================================================================
00026 MSG: app_manager/Icon
00027 # Image data format. "jpeg" or "png"
00028 string format
00029
00030 # Image data.
00031 uint8[] data
00032
00033 ================================================================================
00034 MSG: app_manager/ClientApp
00035 # like "android" or "web" or "linux"
00036 string client_type
00037
00038 # like "intent = ros.android.teleop" and "accelerometer = true", used to choose which ClientApp to use
00039 KeyValue[] manager_data
00040
00041 # parameters which just get passed through to the client app.
00042 KeyValue[] app_data
00043
00044 ================================================================================
00045 MSG: app_manager/KeyValue
00046 string key
00047 string value
00048
00049 """
00050 __slots__ = ['running_apps','available_apps']
00051 _slot_types = ['app_manager/App[]','app_manager/App[]']
00052
00053 def __init__(self, *args, **kwds):
00054 """
00055 Constructor. Any message fields that are implicitly/explicitly
00056 set to None will be assigned a default value. The recommend
00057 use is keyword arguments as this is more robust to future message
00058 changes. You cannot mix in-order arguments and keyword arguments.
00059
00060 The available fields are:
00061 running_apps,available_apps
00062
00063 @param args: complete set of field values, in .msg order
00064 @param kwds: use keyword arguments corresponding to message field names
00065 to set specific fields.
00066 """
00067 if args or kwds:
00068 super(AppList, self).__init__(*args, **kwds)
00069
00070 if self.running_apps is None:
00071 self.running_apps = []
00072 if self.available_apps is None:
00073 self.available_apps = []
00074 else:
00075 self.running_apps = []
00076 self.available_apps = []
00077
00078 def _get_types(self):
00079 """
00080 internal API method
00081 """
00082 return self._slot_types
00083
00084 def serialize(self, buff):
00085 """
00086 serialize message into buffer
00087 @param buff: buffer
00088 @type buff: StringIO
00089 """
00090 try:
00091 length = len(self.running_apps)
00092 buff.write(_struct_I.pack(length))
00093 for val1 in self.running_apps:
00094 _x = val1.name
00095 length = len(_x)
00096 buff.write(struct.pack('<I%ss'%length, length, _x))
00097 _x = val1.display_name
00098 length = len(_x)
00099 buff.write(struct.pack('<I%ss'%length, length, _x))
00100 _v1 = val1.icon
00101 _x = _v1.format
00102 length = len(_x)
00103 buff.write(struct.pack('<I%ss'%length, length, _x))
00104 _x = _v1.data
00105 length = len(_x)
00106
00107 if type(_x) in [list, tuple]:
00108 buff.write(struct.pack('<I%sB'%length, length, *_x))
00109 else:
00110 buff.write(struct.pack('<I%ss'%length, length, _x))
00111 length = len(val1.client_apps)
00112 buff.write(_struct_I.pack(length))
00113 for val2 in val1.client_apps:
00114 _x = val2.client_type
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 length = len(val2.manager_data)
00118 buff.write(_struct_I.pack(length))
00119 for val3 in val2.manager_data:
00120 _x = val3.key
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 _x = val3.value
00124 length = len(_x)
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 length = len(val2.app_data)
00127 buff.write(_struct_I.pack(length))
00128 for val3 in val2.app_data:
00129 _x = val3.key
00130 length = len(_x)
00131 buff.write(struct.pack('<I%ss'%length, length, _x))
00132 _x = val3.value
00133 length = len(_x)
00134 buff.write(struct.pack('<I%ss'%length, length, _x))
00135 length = len(self.available_apps)
00136 buff.write(_struct_I.pack(length))
00137 for val1 in self.available_apps:
00138 _x = val1.name
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 _x = val1.display_name
00142 length = len(_x)
00143 buff.write(struct.pack('<I%ss'%length, length, _x))
00144 _v2 = val1.icon
00145 _x = _v2.format
00146 length = len(_x)
00147 buff.write(struct.pack('<I%ss'%length, length, _x))
00148 _x = _v2.data
00149 length = len(_x)
00150
00151 if type(_x) in [list, tuple]:
00152 buff.write(struct.pack('<I%sB'%length, length, *_x))
00153 else:
00154 buff.write(struct.pack('<I%ss'%length, length, _x))
00155 length = len(val1.client_apps)
00156 buff.write(_struct_I.pack(length))
00157 for val2 in val1.client_apps:
00158 _x = val2.client_type
00159 length = len(_x)
00160 buff.write(struct.pack('<I%ss'%length, length, _x))
00161 length = len(val2.manager_data)
00162 buff.write(_struct_I.pack(length))
00163 for val3 in val2.manager_data:
00164 _x = val3.key
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 _x = val3.value
00168 length = len(_x)
00169 buff.write(struct.pack('<I%ss'%length, length, _x))
00170 length = len(val2.app_data)
00171 buff.write(_struct_I.pack(length))
00172 for val3 in val2.app_data:
00173 _x = val3.key
00174 length = len(_x)
00175 buff.write(struct.pack('<I%ss'%length, length, _x))
00176 _x = val3.value
00177 length = len(_x)
00178 buff.write(struct.pack('<I%ss'%length, length, _x))
00179 except struct.error, se: self._check_types(se)
00180 except TypeError, te: self._check_types(te)
00181
00182 def deserialize(self, str):
00183 """
00184 unpack serialized message in str into this message instance
00185 @param str: byte array of serialized message
00186 @type str: str
00187 """
00188 try:
00189 end = 0
00190 start = end
00191 end += 4
00192 (length,) = _struct_I.unpack(str[start:end])
00193 self.running_apps = []
00194 for i in xrange(0, length):
00195 val1 = app_manager.msg.App()
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 start = end
00200 end += length
00201 val1.name = str[start:end]
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 start = end
00206 end += length
00207 val1.display_name = str[start:end]
00208 _v3 = val1.icon
00209 start = end
00210 end += 4
00211 (length,) = _struct_I.unpack(str[start:end])
00212 start = end
00213 end += length
00214 _v3.format = str[start:end]
00215 start = end
00216 end += 4
00217 (length,) = _struct_I.unpack(str[start:end])
00218 start = end
00219 end += length
00220 _v3.data = str[start:end]
00221 start = end
00222 end += 4
00223 (length,) = _struct_I.unpack(str[start:end])
00224 val1.client_apps = []
00225 for i in xrange(0, length):
00226 val2 = app_manager.msg.ClientApp()
00227 start = end
00228 end += 4
00229 (length,) = _struct_I.unpack(str[start:end])
00230 start = end
00231 end += length
00232 val2.client_type = str[start:end]
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 val2.manager_data = []
00237 for i in xrange(0, length):
00238 val3 = app_manager.msg.KeyValue()
00239 start = end
00240 end += 4
00241 (length,) = _struct_I.unpack(str[start:end])
00242 start = end
00243 end += length
00244 val3.key = str[start:end]
00245 start = end
00246 end += 4
00247 (length,) = _struct_I.unpack(str[start:end])
00248 start = end
00249 end += length
00250 val3.value = str[start:end]
00251 val2.manager_data.append(val3)
00252 start = end
00253 end += 4
00254 (length,) = _struct_I.unpack(str[start:end])
00255 val2.app_data = []
00256 for i in xrange(0, length):
00257 val3 = 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 val3.key = str[start:end]
00264 start = end
00265 end += 4
00266 (length,) = _struct_I.unpack(str[start:end])
00267 start = end
00268 end += length
00269 val3.value = str[start:end]
00270 val2.app_data.append(val3)
00271 val1.client_apps.append(val2)
00272 self.running_apps.append(val1)
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 self.available_apps = []
00277 for i in xrange(0, length):
00278 val1 = app_manager.msg.App()
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 start = end
00283 end += length
00284 val1.name = str[start:end]
00285 start = end
00286 end += 4
00287 (length,) = _struct_I.unpack(str[start:end])
00288 start = end
00289 end += length
00290 val1.display_name = str[start:end]
00291 _v4 = val1.icon
00292 start = end
00293 end += 4
00294 (length,) = _struct_I.unpack(str[start:end])
00295 start = end
00296 end += length
00297 _v4.format = str[start:end]
00298 start = end
00299 end += 4
00300 (length,) = _struct_I.unpack(str[start:end])
00301 start = end
00302 end += length
00303 _v4.data = str[start:end]
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 val1.client_apps = []
00308 for i in xrange(0, length):
00309 val2 = app_manager.msg.ClientApp()
00310 start = end
00311 end += 4
00312 (length,) = _struct_I.unpack(str[start:end])
00313 start = end
00314 end += length
00315 val2.client_type = str[start:end]
00316 start = end
00317 end += 4
00318 (length,) = _struct_I.unpack(str[start:end])
00319 val2.manager_data = []
00320 for i in xrange(0, length):
00321 val3 = app_manager.msg.KeyValue()
00322 start = end
00323 end += 4
00324 (length,) = _struct_I.unpack(str[start:end])
00325 start = end
00326 end += length
00327 val3.key = str[start:end]
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 start = end
00332 end += length
00333 val3.value = str[start:end]
00334 val2.manager_data.append(val3)
00335 start = end
00336 end += 4
00337 (length,) = _struct_I.unpack(str[start:end])
00338 val2.app_data = []
00339 for i in xrange(0, length):
00340 val3 = app_manager.msg.KeyValue()
00341 start = end
00342 end += 4
00343 (length,) = _struct_I.unpack(str[start:end])
00344 start = end
00345 end += length
00346 val3.key = str[start:end]
00347 start = end
00348 end += 4
00349 (length,) = _struct_I.unpack(str[start:end])
00350 start = end
00351 end += length
00352 val3.value = str[start:end]
00353 val2.app_data.append(val3)
00354 val1.client_apps.append(val2)
00355 self.available_apps.append(val1)
00356 return self
00357 except struct.error, e:
00358 raise roslib.message.DeserializationError(e)
00359
00360
00361 def serialize_numpy(self, buff, numpy):
00362 """
00363 serialize message with numpy array types into buffer
00364 @param buff: buffer
00365 @type buff: StringIO
00366 @param numpy: numpy python module
00367 @type numpy module
00368 """
00369 try:
00370 length = len(self.running_apps)
00371 buff.write(_struct_I.pack(length))
00372 for val1 in self.running_apps:
00373 _x = val1.name
00374 length = len(_x)
00375 buff.write(struct.pack('<I%ss'%length, length, _x))
00376 _x = val1.display_name
00377 length = len(_x)
00378 buff.write(struct.pack('<I%ss'%length, length, _x))
00379 _v5 = val1.icon
00380 _x = _v5.format
00381 length = len(_x)
00382 buff.write(struct.pack('<I%ss'%length, length, _x))
00383 _x = _v5.data
00384 length = len(_x)
00385
00386 if type(_x) in [list, tuple]:
00387 buff.write(struct.pack('<I%sB'%length, length, *_x))
00388 else:
00389 buff.write(struct.pack('<I%ss'%length, length, _x))
00390 length = len(val1.client_apps)
00391 buff.write(_struct_I.pack(length))
00392 for val2 in val1.client_apps:
00393 _x = val2.client_type
00394 length = len(_x)
00395 buff.write(struct.pack('<I%ss'%length, length, _x))
00396 length = len(val2.manager_data)
00397 buff.write(_struct_I.pack(length))
00398 for val3 in val2.manager_data:
00399 _x = val3.key
00400 length = len(_x)
00401 buff.write(struct.pack('<I%ss'%length, length, _x))
00402 _x = val3.value
00403 length = len(_x)
00404 buff.write(struct.pack('<I%ss'%length, length, _x))
00405 length = len(val2.app_data)
00406 buff.write(_struct_I.pack(length))
00407 for val3 in val2.app_data:
00408 _x = val3.key
00409 length = len(_x)
00410 buff.write(struct.pack('<I%ss'%length, length, _x))
00411 _x = val3.value
00412 length = len(_x)
00413 buff.write(struct.pack('<I%ss'%length, length, _x))
00414 length = len(self.available_apps)
00415 buff.write(_struct_I.pack(length))
00416 for val1 in self.available_apps:
00417 _x = val1.name
00418 length = len(_x)
00419 buff.write(struct.pack('<I%ss'%length, length, _x))
00420 _x = val1.display_name
00421 length = len(_x)
00422 buff.write(struct.pack('<I%ss'%length, length, _x))
00423 _v6 = val1.icon
00424 _x = _v6.format
00425 length = len(_x)
00426 buff.write(struct.pack('<I%ss'%length, length, _x))
00427 _x = _v6.data
00428 length = len(_x)
00429
00430 if type(_x) in [list, tuple]:
00431 buff.write(struct.pack('<I%sB'%length, length, *_x))
00432 else:
00433 buff.write(struct.pack('<I%ss'%length, length, _x))
00434 length = len(val1.client_apps)
00435 buff.write(_struct_I.pack(length))
00436 for val2 in val1.client_apps:
00437 _x = val2.client_type
00438 length = len(_x)
00439 buff.write(struct.pack('<I%ss'%length, length, _x))
00440 length = len(val2.manager_data)
00441 buff.write(_struct_I.pack(length))
00442 for val3 in val2.manager_data:
00443 _x = val3.key
00444 length = len(_x)
00445 buff.write(struct.pack('<I%ss'%length, length, _x))
00446 _x = val3.value
00447 length = len(_x)
00448 buff.write(struct.pack('<I%ss'%length, length, _x))
00449 length = len(val2.app_data)
00450 buff.write(_struct_I.pack(length))
00451 for val3 in val2.app_data:
00452 _x = val3.key
00453 length = len(_x)
00454 buff.write(struct.pack('<I%ss'%length, length, _x))
00455 _x = val3.value
00456 length = len(_x)
00457 buff.write(struct.pack('<I%ss'%length, length, _x))
00458 except struct.error, se: self._check_types(se)
00459 except TypeError, te: self._check_types(te)
00460
00461 def deserialize_numpy(self, str, numpy):
00462 """
00463 unpack serialized message in str into this message instance using numpy for array types
00464 @param str: byte array of serialized message
00465 @type str: str
00466 @param numpy: numpy python module
00467 @type numpy: module
00468 """
00469 try:
00470 end = 0
00471 start = end
00472 end += 4
00473 (length,) = _struct_I.unpack(str[start:end])
00474 self.running_apps = []
00475 for i in xrange(0, length):
00476 val1 = app_manager.msg.App()
00477 start = end
00478 end += 4
00479 (length,) = _struct_I.unpack(str[start:end])
00480 start = end
00481 end += length
00482 val1.name = str[start:end]
00483 start = end
00484 end += 4
00485 (length,) = _struct_I.unpack(str[start:end])
00486 start = end
00487 end += length
00488 val1.display_name = str[start:end]
00489 _v7 = val1.icon
00490 start = end
00491 end += 4
00492 (length,) = _struct_I.unpack(str[start:end])
00493 start = end
00494 end += length
00495 _v7.format = str[start:end]
00496 start = end
00497 end += 4
00498 (length,) = _struct_I.unpack(str[start:end])
00499 start = end
00500 end += length
00501 _v7.data = str[start:end]
00502 start = end
00503 end += 4
00504 (length,) = _struct_I.unpack(str[start:end])
00505 val1.client_apps = []
00506 for i in xrange(0, length):
00507 val2 = app_manager.msg.ClientApp()
00508 start = end
00509 end += 4
00510 (length,) = _struct_I.unpack(str[start:end])
00511 start = end
00512 end += length
00513 val2.client_type = str[start:end]
00514 start = end
00515 end += 4
00516 (length,) = _struct_I.unpack(str[start:end])
00517 val2.manager_data = []
00518 for i in xrange(0, length):
00519 val3 = app_manager.msg.KeyValue()
00520 start = end
00521 end += 4
00522 (length,) = _struct_I.unpack(str[start:end])
00523 start = end
00524 end += length
00525 val3.key = str[start:end]
00526 start = end
00527 end += 4
00528 (length,) = _struct_I.unpack(str[start:end])
00529 start = end
00530 end += length
00531 val3.value = str[start:end]
00532 val2.manager_data.append(val3)
00533 start = end
00534 end += 4
00535 (length,) = _struct_I.unpack(str[start:end])
00536 val2.app_data = []
00537 for i in xrange(0, length):
00538 val3 = app_manager.msg.KeyValue()
00539 start = end
00540 end += 4
00541 (length,) = _struct_I.unpack(str[start:end])
00542 start = end
00543 end += length
00544 val3.key = str[start:end]
00545 start = end
00546 end += 4
00547 (length,) = _struct_I.unpack(str[start:end])
00548 start = end
00549 end += length
00550 val3.value = str[start:end]
00551 val2.app_data.append(val3)
00552 val1.client_apps.append(val2)
00553 self.running_apps.append(val1)
00554 start = end
00555 end += 4
00556 (length,) = _struct_I.unpack(str[start:end])
00557 self.available_apps = []
00558 for i in xrange(0, length):
00559 val1 = app_manager.msg.App()
00560 start = end
00561 end += 4
00562 (length,) = _struct_I.unpack(str[start:end])
00563 start = end
00564 end += length
00565 val1.name = str[start:end]
00566 start = end
00567 end += 4
00568 (length,) = _struct_I.unpack(str[start:end])
00569 start = end
00570 end += length
00571 val1.display_name = str[start:end]
00572 _v8 = val1.icon
00573 start = end
00574 end += 4
00575 (length,) = _struct_I.unpack(str[start:end])
00576 start = end
00577 end += length
00578 _v8.format = str[start:end]
00579 start = end
00580 end += 4
00581 (length,) = _struct_I.unpack(str[start:end])
00582 start = end
00583 end += length
00584 _v8.data = str[start:end]
00585 start = end
00586 end += 4
00587 (length,) = _struct_I.unpack(str[start:end])
00588 val1.client_apps = []
00589 for i in xrange(0, length):
00590 val2 = app_manager.msg.ClientApp()
00591 start = end
00592 end += 4
00593 (length,) = _struct_I.unpack(str[start:end])
00594 start = end
00595 end += length
00596 val2.client_type = str[start:end]
00597 start = end
00598 end += 4
00599 (length,) = _struct_I.unpack(str[start:end])
00600 val2.manager_data = []
00601 for i in xrange(0, length):
00602 val3 = app_manager.msg.KeyValue()
00603 start = end
00604 end += 4
00605 (length,) = _struct_I.unpack(str[start:end])
00606 start = end
00607 end += length
00608 val3.key = str[start:end]
00609 start = end
00610 end += 4
00611 (length,) = _struct_I.unpack(str[start:end])
00612 start = end
00613 end += length
00614 val3.value = str[start:end]
00615 val2.manager_data.append(val3)
00616 start = end
00617 end += 4
00618 (length,) = _struct_I.unpack(str[start:end])
00619 val2.app_data = []
00620 for i in xrange(0, length):
00621 val3 = app_manager.msg.KeyValue()
00622 start = end
00623 end += 4
00624 (length,) = _struct_I.unpack(str[start:end])
00625 start = end
00626 end += length
00627 val3.key = str[start:end]
00628 start = end
00629 end += 4
00630 (length,) = _struct_I.unpack(str[start:end])
00631 start = end
00632 end += length
00633 val3.value = str[start:end]
00634 val2.app_data.append(val3)
00635 val1.client_apps.append(val2)
00636 self.available_apps.append(val1)
00637 return self
00638 except struct.error, e:
00639 raise roslib.message.DeserializationError(e)
00640
00641 _struct_I = roslib.message.struct_I