Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute process refactor #215

Open
wants to merge 19 commits into
base: rolling
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use node_description and ros_executable instead of node_action.
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]>
mlanting authored and vknisley-swri committed Dec 15, 2023
commit 4be19e5fa13b89f1592fb83dfd9cf983182ef449
8 changes: 5 additions & 3 deletions launch_ros/launch_ros/descriptions/node.py
Original file line number Diff line number Diff line change
@@ -267,14 +267,15 @@ def _get_parameter_rule(self, param: 'Parameter', context: LaunchContext):
return f'{self.__expanded_node_name}:{name}:={yaml.dump(value)}'

def prepare(self, context: LaunchContext, executable: Executable, action: Action) -> None:
self._perform_substitutions(context, executable.cmd, action)
self._perform_substitutions(context, executable)

# Prepare any traits which may be defined for this node
if self.__traits is not None:
for trait in self.__traits:
trait.prepare(self, context, action)

def _perform_substitutions(self, context: LaunchContext, cmd: List, action: Action) -> None:
def _perform_substitutions(self, context: LaunchContext, executable: Executable) -> None:
cmd = executable.cmd
try:
if self.__substitutions_performed:
# This function may have already been called by a subclass' `execute`, for example.
@@ -386,7 +387,8 @@ def _perform_substitutions(self, context: LaunchContext, cmd: List, action: Acti
cmd_extension, ros_specific_arguments = extension.prepare_for_execute(
context,
ros_specific_arguments,
action
executable,
self
)
cmd.extend(cmd_extension)
context.extend_locals({'ros_specific_arguments': ros_specific_arguments})