Skip to content

Commit

Permalink
Adapt to '--ros-args ... [--]'-based ROS args extraction (#52)
Browse files Browse the repository at this point in the history
* Prepend Node action ROS args in command with --ros-args flag.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Fix failing launch_ros action test.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Remove assertion on cmd, substitutions not expanded yet.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic committed Aug 7, 2019
1 parent 606eaee commit 7e4f431
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions launch_ros/launch_ros/actions/node.py
Expand Up @@ -129,6 +129,7 @@ def __init__(
cmd += [] if arguments is None else arguments
# Reserve space for ros specific arguments.
# The substitutions will get expanded when the action is executed.
cmd += ['--ros-args'] # Prepend ros specific arguments with --ros-args flag
if node_name is not None:
cmd += [LocalSubstitution(
"ros_specific_arguments['name']", description='node name')]
Expand Down
Expand Up @@ -82,7 +82,5 @@ def test_push_ros_namespace(config):
node_namespace=config.node_ns,
)
node._perform_substitutions(lc)
expected_cmd_len = 2 if config.expected_ns is not None else 1
assert expected_cmd_len == len(node.cmd)
expected_ns = config.expected_ns if config.expected_ns is not None else ''
assert expected_ns == node.expanded_node_namespace

0 comments on commit 7e4f431

Please sign in to comment.