recordreplay_planner_node: fix a bug of creating two nodes with a same name
Description
This is a fix for a problem where two recordreplay_planner
nodes are launched with the following warning.
[recordreplay_planner_node_exe-11] [WARN] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
This is due to creating the tf_listener
without passing the node arg. If not specified (current implementation), the tf_listener
creates a new node with the name of tf_listener_impl
, that means, two nodes are launched by the recordreplay_planner_node_exe
. Since this is launched with node_name=recordreplay_planner
option in the launch file, these two nodes are renamed to the same name with /recordreplay_planner
.
This MR modified the constructor of the tf_listener
to pass the parent node (recordreplay_planner_node) so that the tf_listener connects to the other nodes through the recordreplay_planner_node. No additional node will be created.
Notes for Reviewer
The test is blocked with #598 (closed) .
Checklist
-
Check if this works correctly with the trajectory following test in LGSVL.