Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tf2_ros/src/transform_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TransformListener::TransformListener(tf2::BufferCore & buffer, bool spin_thread)
sstream << "transform_listener_impl_" << std::hex << reinterpret_cast<size_t>(this);
rclcpp::NodeOptions options;
// but specify its name in .arguments to override any __node passed on the command line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good, but I don't like the original motivation of this.

The node name uniqueness problem shouldn't be solved by generating a random name and overriding the command passed in the command line.
If someone wants to launch multiple TransformListener, they should carefully remap the node name.
I'm not sure if that's possible, because TransformListener isn't exactly a node. But in the case it's not possible, I think that problem should be solved instead of doing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't weigh into the correctness of the workaround, just to keep this scoped. I'll defer to @rotu and @gonzodepedro, author and reviewer of #129 respectively, for that.

options.arguments({"__node:=" + std::string(sstream.str())});
options.arguments({"-r", "__node:=" + std::string(sstream.str())});
options.start_parameter_event_publisher(false);
options.start_parameter_services(false);
optional_default_node_ = rclcpp::Node::make_shared("_", options);
Expand Down