Skip to content

Support configurable TF frame prefixes - #794

Open
Daniiiil1 wants to merge 1 commit into
luxonis:developfrom
Daniiiil1:codex/support-configurable-tf-prefix
Open

Support configurable TF frame prefixes#794
Daniiiil1 wants to merge 1 commit into
luxonis:developfrom
Daniiiil1:codex/support-configurable-tf-prefix

Conversation

@Daniiiil1

Copy link
Copy Markdown

Overview

Author: Daniil Mordanov

Issue

Issue link: #789

Issue description: Published image, optical, IMU, and calibration TF frames were derived from different prefixes, so a custom multi-robot prefix could not be applied consistently.

Related PRs: None

Changes

ROS distro: Kilted

  • add a tf_prefix launch argument, defaulting to the driver node name
  • use driver.i_tf_base_frame as the shared frame prefix when calibration TF publishing is enabled
  • apply the prefix consistently to image frame IDs, optical frames, IMU messages, and calibration transforms
  • keep the robot-state-publisher node name separate from slash-delimited TF prefixes
  • preserve the existing node-name behavior when calibration TF publishing is disabled
  • add hardware-independent unit coverage for custom and fallback frame prefixes

Addresses #789.

Testing

Hardware used: None
DepthAI library version: N/A

  • clang-format --dry-run --Werror on changed C++ files
  • black --check on changed launch files
  • Python bytecode compilation for changed launch files
  • XML validation for depthai_ros_driver/package.xml
  • git diff --check

The new gtest is included for the ROS Kilted CI environment.

@Daniiiil1
Daniiiil1 marked this pull request as ready for review August 6, 2026 15:20
@asahtik
asahtik requested a lite review from Copilot August 13, 2026 08:52
@asahtik
asahtik changed the base branch from kilted to develop August 13, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a configurable TF frame prefix mechanism to make frame IDs consistent across image/optical frames, IMU messages, and calibration-based TF publishing—primarily to support multi-robot namespacing scenarios raised in #789.

Changes:

  • Introduces a tf_prefix launch argument (defaulting to the driver node name) and threads it into calibration TF and URDF launch wiring.
  • Updates BaseNode and IMU publishing to derive frame IDs from a shared prefix when calibration TF publishing is enabled.
  • Adds a hardware-independent gtest to validate configured vs fallback prefix behavior, and wires it into the build/test system.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
depthai_ros_driver/test/tf_prefix_test.cpp Adds gtest coverage for configured vs fallback TF prefix behavior.
depthai_ros_driver/src/param_handlers/driver_param_handler.cpp Changes default i_tf_base_frame to node name for consistent defaults.
depthai_ros_driver/src/dai_nodes/sensors/imu.cpp Switches IMU frame derivation to use BaseNode::getFrameName()-based prefixing.
depthai_ros_driver/src/dai_nodes/base_node.cpp Adds getTFPrefix() and routes frame naming through it.
depthai_ros_driver/include/depthai_ros_driver/dai_nodes/base_node.hpp Updates docstrings and adds getTFPrefix() declaration.
depthai_ros_driver/launch/driver.launch.py Adds tf_prefix launch arg and applies it to calibration TF + URDF arguments.
depthai_descriptions/launch/urdf_launch.py Separates robot_state_publisher node name from slash-delimited TF prefixes.
depthai_bridge/src/TFPublisher.cpp Uses baseFrame consistently for calibration TF child/header frames.
depthai_bridge/include/depthai_bridge/TFPublisher.hpp Removes stored nodeName member (now uses baseFrame for naming).
depthai_ros_driver/CMakeLists.txt Adds a gtest target for the new TF prefix test.
depthai_ros_driver/package.xml Adds ament_cmake_gtest as a test dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 158 to +160
"i_publish_tf_from_calibration": True,
"i_tf_tf_prefix": name,
"i_tf_camera_model": cam_model,
"i_tf_base_frame": name,
"i_tf_base_frame": tf_prefix,
Comment on lines +51 to +61
std::string BaseNode::getTFPrefix() {
auto node = getROSNode();
bool publishTF = false;
if(node->get_parameter("driver.i_publish_tf_from_calibration", publishTF) && publishTF) {
std::string baseFrame;
if(node->get_parameter("driver.i_tf_base_frame", baseFrame) && !baseFrame.empty()) {
return baseFrame;
}
}
return node->get_name();
}
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.

2 participants