3 from roslaunch.config
import ROSLaunchConfig
4 from roslaunch.core
import Param
7 def __init__(self, name, default=None, value=None, doc=None):
13 if self.
default is None and other.default
is not None:
15 if self.
value is None and other.value
is not None:
16 self.
value = other.value
17 if self.
doc is None and other.doc
is not None:
27 super(LaunchtreeParam, self).
__init__(key, value)
38 super(LaunchtreeConfig, self).
__init__()
46 tree_level +=
':%d' % self.
idx 48 self._tree_stack.append(tree_level)
52 return self._tree_stack.pop()
57 if not launch
in level:
58 level[launch] = dict()
59 elif not isinstance(level[launch], dict):
60 old_instance = level[launch]
61 level[launch] = dict()
62 level[launch +
':%d' % self.
idx] = old_instance
65 if level.has_key(key):
66 if isinstance(level[key], dict)
and not '_root' in level[key]:
68 level[key][
'_root'] = instance
69 elif isinstance(instance, LaunchtreeArg)
and isinstance(level[key], LaunchtreeArg):
70 level[key].merge(instance)
72 level[key +
':%d' % self.
idx] = instance
82 def add_param(self, p, filename=None, verbose=True, command=None):
83 p.inconsistent =
False 84 if p.key
in self.params
and (p.value != self.params[p.key].value
or self.params[p.key].inconsistent):
86 self.params[p.key].inconsistent =
True 87 rospy.logwarn(
'Inconsistent param: %s\n - %s: %s\n - %s: %s' %
88 (p.key, p.key, str(p.value), self.params[p.key].key, str(self.params[p.key].value)))
89 result = super(LaunchtreeConfig, self).
add_param(p, filename, verbose)
94 result = super(LaunchtreeConfig, self).
add_machine(m, verbose)
99 result = super(LaunchtreeConfig, self).
add_test(test, verbose)
103 def add_node(self, node, core=False, verbose=True):
104 result = super(LaunchtreeConfig, self).
add_node(node, core, verbose)
108 def add_arg(self, name, default=None, value=None, doc=None):
def add_param(self, p, filename=None, verbose=True, command=None)
def add_executable(self, exe)
def _add_to_tree(self, key, instance)
def add_rosparam(self, command, filename, unique_name)
def __init__(self, key, value, command)
def __init__(self, command, filename)
def add_remap(self, from_topic, to_topic)
def add_arg(self, name, default=None, value=None, doc=None)
def __init__(self, name, default=None, value=None, doc=None)
def add_test(self, test, verbose=True)
def __init__(self, from_topic, to_topic)
def add_machine(self, m, verbose=True)
def add_node(self, node, core=False, verbose=True)
def push_level(self, tree_level, unique=False)