Skip to content

pilz_industrial_motion_planner: Use tf2::fromMsg instead of tf2::convert#3219

Merged
sea-bass merged 1 commit intomoveit:mainfrom
traversaro:patch-6
Jan 10, 2025
Merged

pilz_industrial_motion_planner: Use tf2::fromMsg instead of tf2::convert#3219
sea-bass merged 1 commit intomoveit:mainfrom
traversaro:patch-6

Conversation

@traversaro
Copy link
Contributor

@traversaro traversaro commented Jan 9, 2025

Description

I was compiling pilz_industrial_motion_planner on Windows, and I was obtaining a strange template error:

D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/impl/convert.hpp(60,1): error C2668
: 'tf2::fromMsg': ambiguous call to overloaded function [C:\Users\straversaro\build\trajectory_generation_common.vcxproj]
Click to see the rest of the error.
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/impl/convert.hpp(60,1): error C2668
: 'tf2::fromMsg': ambiguous call to overloaded function [C:\Users\straversaro\build\trajectory_generation_common.vcxproj]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2_eigen\tf2_eigen/tf2_eigen.hpp(661,6): m
essage : could be 'void Eigen::fromMsg(const geometry_msgs::msg::Pose &,Eigen::Isometry3d &)' [found using argument-dependent lookup] [C:\Users\straversaro\build\trajecto
ry_generation_common.vcxproj]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2_eigen\tf2_eigen/tf2_eigen.hpp(484,6): m
essage : or       'void tf2::fromMsg(const geometry_msgs::msg::Pose &,Eigen::Isometry3d &)' [C:\Users\straversaro\build\trajectory_generation_common.vcxproj]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/convert.hpp(138,6): message : or
    'void tf2::fromMsg<geometry_msgs::msg::Pose_<std::allocator<void>>,Eigen::Isometry3d>(const A &,B &)' [C:\Users\straversaro\build\trajectory_generation_common.vcxproj
]
          with
          [
              A=geometry_msgs::msg::Pose_<std::allocator<void>>,
              B=Eigen::Isometry3d
          ]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/impl/convert.hpp(60,1): message : w
hile trying to match the argument list '(const A, B)' [C:\Users\straversaro\build\trajectory_generation_common.vcxproj]
          with
          [
              A=geometry_msgs::msg::Pose
          ]
          and
          [
              B=Eigen::Isometry3d
          ]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/convert.hpp(151): message : see ref
erence to function template instantiation 'void tf2::impl::Converter<true,false>::convert<A,B>(const A &,B &)' being compiled [C:\Users\straversaro\build\trajectory_gener
ation_common.vcxproj]
          with
          [
              A=geometry_msgs::msg::Pose,
              B=Eigen::Isometry3d
          ]
D:/src/testpilz/ros-humble/output/bld/rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231/h_env/Library/include/tf2\tf2/convert.hpp(151): message : see ref
erence to function template instantiation 'void tf2::impl::Converter<true,false>::convert<A,B>(const A &,B &)' being compiled [C:\Users\straversaro\build\trajectory_gener
ation_common.vcxproj]
          with
          [
              A=geometry_msgs::msg::Pose,
              B=Eigen::Isometry3d
          ]
D:\src\testpilz\ros-humble\output\bld\rattler-build_ros-humble-pilz-industrial-motion-planner_1736462231\work\ros-humble-pilz-industrial-motion-planner\src\work\src\traje
ctory_functions.cpp(111): message : see reference to function template instantiation 'void tf2::convert<geometry_msgs::msg::Pose,Eigen::Isometry3d>(const A &,B &)' being
compiled [C:\Users\straversaro\build\trajectory_generation_common.vcxproj]
          with
          [
              A=geometry_msgs::msg::Pose,
              B=Eigen::Isometry3d
          ]

This specific problems is probably actually a geometry2 problem (see ros/geometry2#444 for a fix on the ROS 1 repo, and ros2/geometry2#369 (comment) that indicates that the issue is still present in the ROS 2 repo.

However, by checking the codebase I noticed that the tf2::convert templated function is only used here (see https://github.com/search?q=repo%3Amoveit%2Fmoveit2+convert%3C&type=code), while tf2::fromMsg is much more used (see https://github.com/search?q=repo%3Amoveit%2Fmoveit2+fromMsg&type=code), so I think that for consistency it make sense to use tf2::fromMsg also in pilz_industrial_motion_planner .

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Copy link
Member

@JafarAbdi JafarAbdi left a comment

Choose a reason for hiding this comment

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

Thanks!

@sea-bass sea-bass added backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy labels Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.64%. Comparing base (932c192) to head (d8853d9).
Report is 2 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3219      +/-   ##
==========================================
- Coverage   45.64%   45.64%   -0.00%     
==========================================
  Files         714      714              
  Lines       62297    62298       +1     
  Branches     7529     7530       +1     
==========================================
- Hits        28432    28428       -4     
- Misses      33699    33704       +5     
  Partials      166      166              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sea-bass sea-bass enabled auto-merge January 10, 2025 00:02
@sea-bass sea-bass added this pull request to the merge queue Jan 10, 2025
Merged via the queue into moveit:main with commit cd26fc0 Jan 10, 2025
9 checks passed
mergify bot pushed a commit that referenced this pull request Jan 10, 2025
mergify bot pushed a commit that referenced this pull request Jan 10, 2025
sea-bass pushed a commit that referenced this pull request Jan 10, 2025
…ert (#3219) (#3223)

(cherry picked from commit cd26fc0)

Co-authored-by: Silvio Traversaro <silvio@traversaro.it>
sea-bass pushed a commit that referenced this pull request Jan 10, 2025
…ert (#3219) (#3224)

(cherry picked from commit cd26fc0)

Co-authored-by: Silvio Traversaro <silvio@traversaro.it>
sussybot5258 pushed a commit to GreyCatAI/moveit2 that referenced this pull request Apr 19, 2025
Markus-Simonsen pushed a commit to Markus-Simonsen/moveit2 that referenced this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-humble Mergify label that triggers a PR backport to Humble backport-jazzy Mergify label that triggers a PR backport to Jazzy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants