ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
126 stars 144 forks source link

[launch_pytest] RegisterEventHandler / OnProcessExit not processed correctly. #684

Open rshanor opened 1 year ago

rshanor commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

I have a launch file with some action that starts other nodes when one exits.

on_station_setup_exit = RegisterEventHandler(
    OnProcessExit(
        target_action=station_setup_node,
        on_exit=[
            joint_state_publisher,
        ],
    )
)

I am creating a launch description for test using that launch file.

full_station_launch = IncludeLaunchDescription(
    PythonLaunchDescriptionSource(
        [pylon_pkg_prefix, "/launch/station.launch.py"]
    )
)

I am currently trying to port from launch_testing to launch_pytest. Everything worked fine with the previous package, but the joint_state_publisher never launches with the new setup. Everything runs if I remove the RegisterEventHandler bit from the launch file and add to launch_description directly. Looking at the launch log output, I can see that station_setup_node exits but joint_state_publisher never starts.

Any pointers would be a huge help, Thanks!