Skip to content

Use a dedicated callback group instead of a separate node in TfBuffer#52

Merged
otamachan merged 1 commit into
mainfrom
nishino/tf-buffer-callback-group
Jun 20, 2026
Merged

Use a dedicated callback group instead of a separate node in TfBuffer#52
otamachan merged 1 commit into
mainfrom
nishino/tf-buffer-callback-group

Conversation

@otamachan

@otamachan otamachan commented Jun 20, 2026

Copy link
Copy Markdown
Owner

TfBuffer created its own internal node ("_tf_listener") with a dedicated executor/thread to keep TF flowing while the host node's executor is busy. But spawning a second node is an anti-pattern: it shows up in the ROS graph, inherits the global __node remap (causing duplicate-name collisions), and limits TfBuffer to one instance per host node.

Instead, create the /tf and /tf_static subscriptions on the host node under a dedicated MutuallyExclusive callback group (automatically_add_to_executor_with _node=false) and spin only that group on TfBuffer's executor/thread via add_callback_group. This mirrors tf2_ros::TransformListener(spin_thread=true), keeps the same thread isolation, and removes the extra node entirely.

TfBuffer created its own internal node ("_tf_listener") with a dedicated
executor/thread to keep TF flowing while the host node's executor is busy.
But spawning a second node is an anti-pattern: it shows up in the ROS graph,
inherits the global __node remap (causing duplicate-name collisions), and
limits TfBuffer to one instance per host node.

Instead, create the /tf and /tf_static subscriptions on the host node under a
dedicated MutuallyExclusive callback group (automatically_add_to_executor_with
_node=false) and spin only that group on TfBuffer's executor/thread via
add_callback_group. This mirrors tf2_ros::TransformListener(spin_thread=true),
keeps the same thread isolation, and removes the extra node entirely.

Claude-Session: https://claude.ai/code/session_01G4qmUwoQhFyHf6v2HgkeTf
@otamachan otamachan merged commit 24ae64f into main Jun 20, 2026
4 checks passed
@otamachan otamachan deleted the nishino/tf-buffer-callback-group branch June 20, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant