ros2 runtime_error ai_generated true

tf2::TransformException:帧'base_link'已存在于静态变换树中

tf2::TransformException: Frame 'base_link' already exists in static transform tree

ID: ros2/tf2-static-transform-broadcaster-duplicate

其他格式: JSON · Markdown 中文 · English
90%修复率
88%置信度
1证据数
2023-11-05首次发现

版本兼容性

版本状态引入弃用备注
ros2-humble active
ros2-iron active
ros2-rolling active

根因分析

两个节点以不同的时间戳广播相同的静态变换(例如base_link到odom),导致静态变换缓冲区冲突。

English

Two nodes are broadcasting the same static transform (e.g., base_link to odom) with different timestamps, causing a conflict in the static transform buffer.

generic

官方文档

https://docs.ros.org/en/rolling/Tutorials/Intermediate/Tf2/Adding-A-Frame.html

解决方案

  1. 确保只有一个节点广播静态变换;从启动文件中移除重复的广播器。例如:在launch.py中注释掉第二个static_transform_publisher节点。
  2. 如果需要两个广播器,使用不同的帧名称(例如base_link_static和base_link_dynamic),并相应更新下游节点。

无效尝试

常见但无效的做法:

  1. 80% 失败

    Static transforms are cached; delay doesn't resolve the duplicate conflict once both broadcast.

  2. 70% 失败

    Renaming frames breaks transform chains and other nodes expecting the correct frame names.