Skip to content

pilz_industrial_motion_planner: Use tf2::fromMsg instead of tf2::convert (backport #3219)#3224

Merged
sea-bass merged 1 commit into
jazzyfrom
mergify/bp/jazzy/pr-3219
Jan 10, 2025
Merged

pilz_industrial_motion_planner: Use tf2::fromMsg instead of tf2::convert (backport #3219)#3224
sea-bass merged 1 commit into
jazzyfrom
mergify/bp/jazzy/pr-3219

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Jan 10, 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

This is an automatic backport of pull request #3219 done by [Mergify](https://mergify.com).

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 10, 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 44.19%. Comparing base (f820ea4) to head (1a82aad).
Report is 3 commits behind head on jazzy.

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

Additional details and impacted files
@@            Coverage Diff             @@
##            jazzy    #3224      +/-   ##
==========================================
- Coverage   44.19%   44.19%   -0.00%     
==========================================
  Files         698      698              
  Lines       61586    61584       -2     
  Branches     7460     7459       -1     
==========================================
- Hits        27214    27210       -4     
- Misses      34205    34207       +2     
  Partials      167      167              

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

@sea-bass sea-bass merged commit 47759c2 into jazzy Jan 10, 2025
@sea-bass sea-bass deleted the mergify/bp/jazzy/pr-3219 branch January 10, 2025 02:29
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.

3 participants