@@ -91,7 +91,7 @@ def get_launch_arguments(self, conditional_inclusion=False) -> List[DeclareLaunc
91
91
]
92
92
93
93
def get_launch_arguments_with_include_launch_description_actions (
94
- self , conditional_inclusion = False
94
+ self , conditional_inclusion = False , only_search_local = False
95
95
) -> List [Tuple [DeclareLaunchArgument , List ['IncludeLaunchDescription' ]]]:
96
96
"""
97
97
Return a list of launch arguments with its associated include launch descriptions actions.
@@ -128,7 +128,8 @@ def get_launch_arguments_with_include_launch_description_actions(
128
128
Tuple [DeclareLaunchArgument , List [IncludeLaunchDescription ]]] = []
129
129
from .actions import ResetLaunchConfigurations
130
130
131
- def process_entities (entities , * , _conditional_inclusion , nested_ild_actions = None ):
131
+ def process_entities (entities , * , _conditional_inclusion , nested_ild_actions = None ,
132
+ only_search_local = False ):
132
133
for entity in entities :
133
134
if isinstance (entity , DeclareLaunchArgument ):
134
135
# Avoid duplicate entries with the same name.
@@ -139,6 +140,9 @@ def process_entities(entities, *, _conditional_inclusion, nested_ild_actions=Non
139
140
entity ._conditionally_included = _conditional_inclusion
140
141
entity ._conditionally_included |= entity .condition is not None
141
142
declared_launch_arguments .append ((entity , nested_ild_actions ))
143
+ if only_search_local :
144
+ if isinstance (entity , IncludeLaunchDescription ):
145
+ continue
142
146
if isinstance (entity , ResetLaunchConfigurations ):
143
147
# Launch arguments after this cannot be set directly by top level arguments
144
148
return
@@ -151,14 +155,17 @@ def process_entities(entities, *, _conditional_inclusion, nested_ild_actions=Non
151
155
process_entities (
152
156
entity .describe_sub_entities (),
153
157
_conditional_inclusion = False ,
154
- nested_ild_actions = next_nested_ild_actions )
158
+ nested_ild_actions = next_nested_ild_actions ,
159
+ only_search_local = only_search_local )
155
160
for conditional_sub_entity in entity .describe_conditional_sub_entities ():
156
161
process_entities (
157
162
conditional_sub_entity [1 ],
158
163
_conditional_inclusion = True ,
159
- nested_ild_actions = next_nested_ild_actions )
164
+ nested_ild_actions = next_nested_ild_actions ,
165
+ only_search_local = only_search_local )
160
166
161
- process_entities (self .entities , _conditional_inclusion = conditional_inclusion )
167
+ process_entities (self .entities , _conditional_inclusion = conditional_inclusion ,
168
+ only_search_local = only_search_local )
162
169
163
170
return declared_launch_arguments
164
171
0 commit comments