Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved tf_prefix based on namespace #1060

Conversation

kjvanteeffelen
Copy link
Contributor

Solves #1048.

When using robot namespace as tf_prefix, it now removes any starting '/' and only adds an ending '/' if not present already.
Starting with '/' is not common in TF2 and showed compatibility issues with for instance robot_localization.

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.

The changes look fine to me!

Thank you!

Copy link
Contributor

@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.

Please have a look at the failing tests

henrygerardmoore pushed a commit to henrygerardmoore/ros2_controllers that referenced this pull request Jul 19, 2024
@rafal-gorecki
Copy link
Contributor

rafal-gorecki commented Dec 9, 2024

What is the problem with adding this fix? This issue has been going on almost for a year, and is it just a matter of a few lines of code.

@christophfroehlich
Copy link
Contributor

Acc to my last comment, tests were failing. As this PR is locked for maintainers, I can't push something to it or merge the current master into it.
Doing that locally

    [  FAILED  ] TestDiffDriveController.configure_succeeds_tf_blank_prefix_true_set_namespace
    
     1 FAILED TEST
    -- run_test.py: return code 1
    -- run_test.py: inject classname prefix into gtest result file '/workspaces/ros2_rolling_ws/build/diff_drive_controller/test_results/diff_drive_controller/test_diff_drive_controller.gtest.xml'
    -- run_test.py: verify result file '/workspaces/ros2_rolling_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: 17 tests, 0 errors, 1 failure, 0 skipped
- diff_drive_controller.TestDiffDriveController configure_succeeds_tf_blank_prefix_true_set_namespace (/workspaces/ros2_rolling_ws/src/ros2_controllers/diff_drive_controller/test/test_diff_drive_controller.cpp:392)
  <<< failure message
    /workspaces/ros2_rolling_ws/src/ros2_controllers/diff_drive_controller/test/test_diff_drive_controller.cpp:417
    Expected equality of these values:
      test_odom_frame_id
        Which is: "test_namespace/odom"
      test_namespace + "/" + odom_id
        Which is: "/test_namespace/odom"
  >>>

Maybe someone wants to fix this on top of this PR and open a new one.

@christophfroehlich
Copy link
Contributor

Fixed with #1420

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.

4 participants