ROS2 Launch - Detect error on process startup

asked 2021-11-02 06:19:16 -0600

bergercookie gravatar image

I understand that in ROS2 you can use on_exit=actions.Shutdown() to detect whether one of your running processes has exited:

proc = actions.ExecuteProcess(
    cmd=["path/to/executable"],
    output="screen",
    on_exit=actions.Shutdown()
)

However, this will not trigger the desired actions.Shutdown() if for example the executable is not found in the $PATH or if it launched and there was an issue (e.g. with one of the shared libs it depends on) during loading.

proc = actions.ExecuteProcess(
    cmd=["path/to/executable/that/doesnt/exist"],
    output="screen",
    on_exit=actions.Shutdown() # <-- this will not be triggered
)

Is there a way of doing this? Is there an existing launch event that I'm missing?

edit retag flag offensive close merge delete