Skip to content

Commit 96e92a0

Browse files
committed
Move Executable specific keyword args to kwargs instead of duplicating
parameters between classes. Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <[email protected]>
1 parent eabed97 commit 96e92a0

File tree

1 file changed

+5
-4
lines changed
  • launch_ros/launch_ros/actions

1 file changed

+5
-4
lines changed

launch_ros/launch_ros/actions/node.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
"""Module for the Node action."""
1616

17+
import inspect
18+
1719
from typing import Dict
1820
from typing import Iterable
1921
from typing import List
@@ -23,6 +25,7 @@
2325

2426
from launch.actions import ExecuteLocal
2527
from launch.actions import ExecuteProcess
28+
from launch.descriptions import Executable
2629
from launch.frontend import Entity
2730
from launch.frontend import expose_action
2831
from launch.frontend import Parser
@@ -123,13 +126,11 @@ def __init__(
123126
passed to the node as ROS remapping rules
124127
:param: ros_arguments list of ROS arguments for the node
125128
:param: arguments list of extra arguments for the node
126-
:param additional_env: Dictionary of environment variables to be added. If env was
127-
None, they are added to the current environment. If not, env is updated with
128-
additional_env.
129129
"""
130130
self.__node_desc = NodeDescription(node_name=name, node_namespace=namespace,
131131
parameters=parameters, remappings=remappings)
132-
ros_exec_kwargs = {'additional_env': additional_env}
132+
executable_keywords = inspect.signature(Executable).parameters.keys()
133+
ros_exec_kwargs = {key: val for key, val in kwargs.items() if key in executable_keywords}
133134
self.__ros_exec = RosExecutable(package=package, executable=executable,
134135
arguments=arguments, ros_arguments=ros_arguments,
135136
nodes=[self.__node_desc], **ros_exec_kwargs)

0 commit comments

Comments
 (0)