You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/execute_process_refactor.md
+12-34Lines changed: 12 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Refactoring ExecuteProcess in ROS2
2
2
3
3
Initially proposed in [114](https://github.com/ros2/launch/issues/114), this document describes changes to `ExecuteProcess` and related classes.
4
-
As initially implemented, some aspects of this are tightly coupled to both the implementation chosen and the assumption that processes will execute only in the local environment of the launch process itself.
5
-
The following changes are designed to provide a more decoupled architecture that will ease support of launching processes locally, remotely, or potentially in containerized environments.
4
+
As initially implemented, some aspects of this class are tightly coupled to both the implementation chosen and the assumption that processes will execute only in the local environment of the launch process itself.
5
+
The following changes are designed to provide a more decoupled architecture that will ease support of launching processes locally, remotely, and potentially in containerized environments.
6
6
Additionally, these changes will support the goal of decoupling the description of an executable from the actual action of executing it.
7
7
These changes are designed so that existing systems may continue to use the interface before these changes without modification; newer systems may find benefits from adapting to the newer syntax, particularly when composing more complicated environments.
8
8
@@ -282,7 +282,7 @@ No events would be handled nor emitted.
282
282
283
283
Extends the `launch.actions.Action` class.
284
284
This class would represent the execution-time aspects of `launch.actions.ExecuteProcess`.
285
-
The new `process_description` constructor parameter could be a `launch.descriptions.Executable`, a `launch_ros.descriptions.Node`, or one of the other subclasses.
285
+
The new `process_description` constructor parameter could be a `launch.descriptions.Executable`or a subclass.
286
286
287
287
This class is simplified from the current `launch.actions.ExecuteProcess` by removing the logic relating to process definition/configuration, and by removing the logic regarding substitutions thereof.
288
288
@@ -351,7 +351,6 @@ These parameters are drawn from the shared parameters of the current `launch_ros
| package | name of the ROS package the node executable lives in |
355
354
| node_name | Name the node should have |
356
355
| node_namespace | Namespace the node should create topics/services/etc in |
357
356
| parameters | List of either paths to yaml files or dictionaries of parameters |
@@ -361,7 +360,7 @@ These parameters are drawn from the shared parameters of the current `launch_ros
361
360
362
361
#### Properties
363
362
364
-
Accessors would be provided for the various constructor parameters: `package`, `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, and `traits`.
363
+
Accessors would be provided for the various constructor parameters: `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, and `traits`.
365
364
366
365
#### Methods
367
366
@@ -388,14 +387,15 @@ Most parameters would be passed to the superclass.
388
387
389
388
|Argument|Description|
390
389
|---|---|
390
+
| package | Optional. Name of the ROS package the node plugin lives in. If not specified, the package of the containing executable will be assumed. |
391
391
|node_plugin|Name of the plugin to be loaded|
392
392
393
-
Additional parameters that may be passed, which are handled by `launch_ros.descriptions.NodeBase`: `package`, `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, `traits`.
393
+
Additional parameters that may be passed, which are handled by `launch_ros.descriptions.NodeBase`: `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, `traits`.
394
394
395
395
#### Properties
396
396
397
-
Accessors would be provided for the additional constructor parameter:`node_plugin`.
398
-
Inherited accessors would also be available: `package`, `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, and `traits`.
397
+
Accessors would be provided for the additional constructor parameters: `package`,`node_plugin`.
398
+
Inherited accessors would also be available: `node_name`, `node_namespace`, `parameters`, `remappings`, `arguments`, and `traits`.
399
399
400
400
#### Methods
401
401
@@ -486,30 +486,6 @@ Accessors would be provided for the constructor parameter: `nodes`.
486
486
487
487
No events would be handled or emitted.
488
488
489
-
### launch_ros.traits.IsExecutable
490
-
491
-
This class would extend the `launch_ros.traits.NodeTrait` class, and provide the additional information required for launching executable nodes that are currently defined in `launch_ros.actions.Node`.
492
-
493
-
#### Constructor
494
-
495
-
Most parameters would be passed to the new superclass.
496
-
497
-
|Argument|Description|
498
-
|---|---|
499
-
|node_executable|Name of the executable to find|
500
-
501
-
#### Properties
502
-
503
-
Accessors would be provided for the constructor parameter: `node_exectuable`.
504
-
505
-
#### Methods
506
-
507
-
No custom methods would be defined or overridden.
508
-
509
-
#### Events
510
-
511
-
No events would be handled or emitted.
512
-
513
489
### launch_ros.descriptions.RosExecutable
514
490
515
491
This class would represent the information required to run a ROS-aware process and inherit from `launch.descriptions.Executable`.
@@ -519,14 +495,16 @@ It would not include execution-time details, nor provide monitoring of the proce
| package | name of the ROS package the node executable lives in |
499
+
|node_executable|Name of the executable to find|
522
500
| nodes | A list of `launch_ros.descriptions.Node` objects which are part of the executable. |
523
501
524
502
Additional parameters that may be passed, which are handled by `launch.actions.ExecuteProcess`: `cmd`, `name`, `cwd`, `env`, `additional_env`.
525
503
NOTE: To allow ROS to determine the appropriate executable based on the package and executable name, the `cmd` parameter should *NOT* be specified. When `cmd` is not specified, this class will determine the appropriate executable if and only if exactly one of the nodes it contains has the `launch_ros.traits.IsExecutable` trait.
526
504
527
505
#### Properties
528
506
529
-
Accessors would be provided for the constructor parameter:`nodes`.
507
+
Accessors would be provided for the constructor parameters: `package`, `node_executable`,`nodes`.
530
508
Inherited accessors would also be available: `cmd`, `name`, `cwd`, `env`, and `additional_env`.
531
509
532
510
#### Methods
@@ -559,7 +537,7 @@ If this is attempted, several features such as input/output pipes would likely n
| process\_description | The `launch.descriptions.Executable` to execute as a local process |
540
+
| process\_description | The `launch.descriptions.Executable` to execute as a remote process |
563
541
| connection_description | An object defining the SSH connection information, such as host, port, user, etc. |
564
542
| prefix | A set of commands/arguments to preceed the `cmd`, used for things like `gdb`/`valgrind` and defaults to the `LaunchConfiguration` called `launch-prefix`|
565
543
| output | Configuration for process output logging. Defaults to `log` i.e. log both `stdout` and `stderr` to launch main log file and stderr to the screen. |
0 commit comments