Skip to content

Commit

Permalink
Do not use event handler for loading composable nodes
Browse files Browse the repository at this point in the history
Fixes #114.

Due to the asynchronous nature of the LoadComposableNodes action, an event handler causes the launch configuration is popped if ComposableNodeContainer appears inside a group or include action.
It seems to me we can simply return the load node action, which will get executed after the ComposableNodeContainer action. The use of an event handler is vestigial of a refactoring done in #16, and doesn't appear to be necessary.

Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron committed Aug 10, 2020
1 parent 074bdac commit c08b666
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions launch_ros/launch_ros/actions/composable_node_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
from .load_composable_nodes import LoadComposableNodes
# Perform load action once the container has started.
load_actions = [
RegisterEventHandler(
event_handler=OnProcessStart(
target_action=self,
on_start=[
# RegisterEventHandler(
# event_handler=OnProcessStart(
# target_action=self,
# on_start=[
LoadComposableNodes(
composable_node_descriptions=self.__composable_node_descriptions,
target_container=self
)
]
)
)
# ]
# )
# )
]
container_actions = super().execute(context) # type: Optional[List[Action]]
if container_actions is not None and load_actions is not None:
Expand Down

0 comments on commit c08b666

Please sign in to comment.