ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

If you look at the source code: https://github.com/ros/geometry2/blob/melodic-devel/tf2_ros/src/transform_listener.cpp#L47

You'll see that we copy the nodehandle into node_. If that isn't supplied in the constructor, the default constructor (in the default namespace) is used. But you bring up a good question since the topic is /tf and not tf, so even applying the namespacing to the nodehandle, it wouldn't make a difference. The nodehandle is only used to create subscriptions so it really... doesn't matter?

Maybe that actually should be removed if we are correct, but it also may be there for legacy reasons. Good question.

If you look at the source code: https://github.com/ros/geometry2/blob/melodic-devel/tf2_ros/src/transform_listener.cpp#L47

You'll see that we copy the nodehandle into node_. If that isn't supplied in the constructor, the default constructor (in the default namespace) is used. But you bring up a good question since the topic is /tf and not tf, so even applying the namespacing to the nodehandle, it wouldn't make a difference. The nodehandle is only used to create subscriptions so it really... doesn't matter?

Maybe that actually should be removed if we are correct, but it also may be there for legacy reasons. Good question. You will not go wrong using the TransformListener(tf2::BufferCore& buffer, bool spin_thread) constructor unless you are using multi-robot same-ros-core applications.