Skip to content

Commit

Permalink
Avoid clashing with the 'name' attribute also being expected by Execu…
Browse files Browse the repository at this point in the history
…teProcess

Instead, intercept the 'name' attribute and don't forward to ExecuteProcess.
Add a new attribute 'exec-name' that can be used to set the name of the process.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Feb 8, 2020
1 parent f401c9e commit 61503c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions launch_ros/launch_ros/actions/node.py
Expand Up @@ -244,6 +244,13 @@ def parse(cls, entity: Entity, parser: Parser):
node_name = entity.get_attr('name', optional=True)
if node_name is not None:
kwargs['node_name'] = parser.parse_substitution(node_name)
# Undo the parent action parsing 'name' as the process name
# For node actions, use 'exec-name' to rename the process
if 'name' in kwargs:
del kwargs['name']
exec_name = entity.get_attr('exec-name', optional=True)
if exec_name is not None:
kwargs['name'] = parser.parse_substitution(exec_name)
package = entity.get_attr('pkg', optional=True)
if package is not None:
kwargs['package'] = parser.parse_substitution(package)
Expand Down

0 comments on commit 61503c9

Please sign in to comment.