Skip to content

Conversation

@kuralme
Copy link

@kuralme kuralme commented Nov 9, 2025

Used new tf frame prefix helper in differential drive controller to test out & showcase the helper. This is the first part of the changes, the other controllers will come next:

  • mecanum_drive_controller
  • omni_wheel_drive_controller

Related issue

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

I'm not sure if it makes sense to have it in the control_toolbox package. What about controllers_interfaces/helpers.hpp existing file?

What do you think @christophfroehlich ?

@christophfroehlich
Copy link
Member

I'm not sure if it makes sense to have it in the control_toolbox package. What about controllers_interfaces/helpers.hpp existing file?

OK, maybe you are right and we should put it here.

@kuralme
Copy link
Author

kuralme commented Nov 10, 2025

I'm not sure if it makes sense to have it in the control_toolbox package. What about controllers_interfaces/helpers.hpp existing file?

OK, maybe you are right and we should put it here.

I will start working on it

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

There is a behavior-breaking change now, right?
Can we do that gracefully? e.g.,

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.88%. Comparing base (36cfca8) to head (6c0ac1f).

Files with missing lines Patch % Lines
...iff_drive_controller/src/diff_drive_controller.cpp 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1997      +/-   ##
==========================================
- Coverage   84.91%   84.88%   -0.03%     
==========================================
  Files         148      148              
  Lines       14367    14353      -14     
  Branches     1230     1228       -2     
==========================================
- Hits        12200    12184      -16     
- Misses       1740     1741       +1     
- Partials      427      428       +1     
Flag Coverage Δ
unittests 84.88% <77.77%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ive_controller/test/test_diff_drive_controller.cpp 93.99% <100.00%> (-0.20%) ⬇️
...iff_drive_controller/src/diff_drive_controller.cpp 82.17% <50.00%> (-0.83%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kuralme kuralme force-pushed the tf_prefix_helper/diff_drive branch from 53851e8 to 0e25332 Compare November 15, 2025 15:49
@kuralme
Copy link
Author

kuralme commented Nov 15, 2025

A note about my last commit: This is for the deprecations. I am aware of Bence's request, I will apply if a change needed to the helper source.

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

tf_frame_prefix_enable was not unused before? Instead, during the deprecation phase, we still should use this parameter before we remove it.

I'm not sure how we can gracefully transition the usage of node namespace? Currently, if tf_frame_prefix is not set, then automatically the node namespace is used.

- control toolbox pkg already linked
- this commit is to be deleted later
- enable flag removed from args
- tilde substitution with ns added
- tests updated
- verbose comments
- log message added if tf_frame_prefix_enable is not set default
- relevant info added to yaml description, migration and release notes
@kuralme kuralme force-pushed the tf_prefix_helper/diff_drive branch from 05a578b to aae1a3e Compare December 1, 2025 16:14
Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

(failing binary build are fine, I've released ros2_control but rosdistro is on hold for the upcoming sync).

Applied suggestion for backward compatibility

Co-authored-by: Christoph Fröhlich <[email protected]>
@christophfroehlich christophfroehlich linked an issue Dec 3, 2025 that may be closed by this pull request
10 tasks
Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

We have the following failing test:

     [  FAILED  ] TestDiffDriveController.configure_succeeds_tf_blank_prefix_no_namespace
    
     1 FAILED TEST
    -- run_test.py: return code 1
    -- run_test.py: inject classname prefix into gtest result file '/home/runner/work/ros2_controllers/ros2_controllers/.work/target_ws/build/diff_drive_controller/test_results/diff_drive_controller/test_diff_drive_controller.gtest.xml'
    -- run_test.py: verify result file '/home/runner/work/ros2_controllers/ros2_controllers/.work/target_ws/build/diff_drive_controller/test_results/diff_drive_controller/test_diff_drive_controller.gtest.xml'
  >>>
build/diff_drive_controller/test_results/diff_drive_controller/test_diff_drive_controller.gtest.xml: 25 tests, 0 errors, 1 failure, 0 skipped
- diff_drive_controller.TestDiffDriveController configure_succeeds_tf_blank_prefix_no_namespace (/home/runner/work/ros2_controllers/ros2_controllers/.work/target_ws/src/ros2_controllers/diff_drive_controller/test/test_diff_drive_controller.cpp:333)
  <<< failure message
    /home/runner/work/ros2_controllers/ros2_controllers/.work/target_ws/src/ros2_controllers/diff_drive_controller/test/test_diff_drive_controller.cpp:351
    Expected equality of these values:
      controller_->odometry_message_.header.frame_id
        Which is: "/odom"
      odom_id
        Which is: "odom"
  >>>

I think this is related to #1999 and should be discussed.

std::string tf_prefix = "";
if (params_.tf_frame_prefix_enable)
{
if (params_.tf_frame_prefix != "")
Copy link
Author

Choose a reason for hiding this comment

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

This inner if block is wrong imo. It skips slash normalization so the test fail, and the new tilde-replace-namespace not applied as well. That should also address #1999 with the tilde usage.

Copy link
Member

Choose a reason for hiding this comment

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

But this still breaks current behavior, right? That's what I'm concerned about. Any idea how to deprecate that gracefully? We could add a new parameter to opt-in the new behavior, together with a warning when it is not set. This can then be fully removed one release after next.

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.

Move tf_frame_prefix utilities to control_toolbox

3 participants