|
14 | 14 |
|
15 | 15 | """Module for the Node action.""" |
16 | 16 |
|
| 17 | +import inspect |
| 18 | + |
17 | 19 | from typing import Dict |
18 | 20 | from typing import Iterable |
19 | 21 | from typing import List |
|
23 | 25 |
|
24 | 26 | from launch.actions import ExecuteLocal |
25 | 27 | from launch.actions import ExecuteProcess |
| 28 | +from launch.descriptions import Executable |
26 | 29 | from launch.frontend import Entity |
27 | 30 | from launch.frontend import expose_action |
28 | 31 | from launch.frontend import Parser |
@@ -123,13 +126,11 @@ def __init__( |
123 | 126 | passed to the node as ROS remapping rules |
124 | 127 | :param: ros_arguments list of ROS arguments for the node |
125 | 128 | :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. |
129 | 129 | """ |
130 | 130 | self.__node_desc = NodeDescription(node_name=name, node_namespace=namespace, |
131 | 131 | 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} |
133 | 134 | self.__ros_exec = RosExecutable(package=package, executable=executable, |
134 | 135 | arguments=arguments, ros_arguments=ros_arguments, |
135 | 136 | nodes=[self.__node_desc], **ros_exec_kwargs) |
|
0 commit comments