Open kjjpc opened 2 months ago
@kjjpc thanks for posting the issue and detailed report.
return [lc_node, emit_configure, emit_active]
as a possible work-around, changing this line into return [lc_node, emit_active, emit_configure]
can mitigate the issue in my local environment. (register OnStateTransition
event handler before changing state to configure
.)
i am not sure if this LaunchDescription
order is requirement for the user application, but i can see the examples are considered with this order. e.g https://github.com/ros2/launch_ros/blob/dbc2bbc80d31ae932bdd7060669f58d0b6e39305/launch_ros/examples/lifecycle_pub_sub_launch.py#L79-L84
if this is the design for LaunchDescription
, probably we would want to add the doc section for LaunchDescription
. @wjwwood @adityapande-1995 what do you think?
we have to be careful on this. if this change is applied alone, it can break the downstream launch application with incompatible QoS.
Bug report
Steps to reproduce issue
When I launch multiple lifecycle nodes using LaunchService, some nodes failed to be activated. This is a reproduction script.
Expected behavior
All lifecycle nodes become active.
Actual behavior
Some nodes remains configured occasionally.
Additional information
I investigated the behavior and found that the lifecycle_node action of launch_ros failed to catch transition_event topic. The lifecycle_node action create subscriber just before calling change_state and the topic subscription registration is not completed before transition_event publish.
One solution is to make transition_event topic reliable and transient local. Following changes resolve the issue.
Add following code to com_interface.c.
Change qos setting in lifecycle_node.py of launch_ros.