@@ -125,6 +125,7 @@ def __init__(
125125 exec_name : Optional [SomeSubstitutionsType ] = None ,
126126 parameters : Optional [SomeParameters ] = None ,
127127 remappings : Optional [SomeRemapRules ] = None ,
128+ ros_arguments : Optional [Iterable [SomeSubstitutionsType ]] = None ,
128129 arguments : Optional [Iterable [SomeSubstitutionsType ]] = None ,
129130 ** kwargs
130131 ) -> None :
@@ -180,6 +181,9 @@ def __init__(
180181 wildcard namespace (`/**`) and other specific parameter declarations
181182 may overwrite it.
182183
184+ Using `ros_arguments` is equivalent to using `arguments` with a
185+ prepended '--ros-args' item.
186+
183187 :param: executable the name of the executable to find if a package
184188 is provided or otherwise a path to the executable to run.
185189 :param: package the package in which the node executable can be found
@@ -191,13 +195,15 @@ def __init__(
191195 or dictionaries of parameters.
192196 :param: remappings ordered list of 'to' and 'from' string pairs to be
193197 passed to the node as ROS remapping rules
198+ :param: ros_arguments list of ROS arguments for the node
194199 :param: arguments list of extra arguments for the node
195200 """
196201 if package is not None :
197202 cmd = [ExecutableInPackage (package = package , executable = executable )]
198203 else :
199204 cmd = [executable ]
200205 cmd += [] if arguments is None else arguments
206+ cmd += [] if ros_arguments is None else ['--ros-args' ] + ros_arguments
201207 # Reserve space for ros specific arguments.
202208 # The substitutions will get expanded when the action is executed.
203209 cmd += ['--ros-args' ] # Prepend ros specific arguments with --ros-args flag
@@ -218,6 +224,7 @@ def __init__(
218224 self .__node_namespace = namespace
219225 self .__parameters = [] if parameters is None else normalized_params
220226 self .__remappings = [] if remappings is None else list (normalize_remap_rules (remappings ))
227+ self .__ros_arguments = ros_arguments
221228 self .__arguments = arguments
222229
223230 self .__expanded_node_name = self .UNSPECIFIED_NODE_NAME
0 commit comments