Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

[Noetic] Add tf2::Stamped<T>::operator=() to fix warnings downstream - #453

Merged
tfoote merged 2 commits into
noetic-develfrom
sloretz/stamped_copy_assignment
May 13, 2020
Merged

tfoote merged 2 commits into
noetic-develfrom
sloretz/stamped_copy_assignment

Conversation

@sloretz

@sloretz sloretz commented Apr 15, 2020

Copy link
Copy Markdown
Contributor

This fixes compiler warnings in robot_state_publisher that come from using tf2::Stamped<T>.

In file included from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h: In function ‘void tf2::doTransform(const T&, T&, const TransformStamped&) [with T = tf2::Stamped<KDL::Vector>; geometry_msgs::TransformStamped = geometry_msgs::TransformStamped_<std::allocator<void> >]’:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:86:122: warning: implicitly-declared ‘tf2::Stamped<KDL::Vector>& tf2::Stamped<KDL::Vector>::operator=(const tf2::Stamped<KDL::Vector>&)’ is deprecated [-Wdeprecated-copy]
   86 |     t_out = tf2::Stamped<KDL::Vector>(transformToKDL(transform) * t_in, transform.header.stamp, transform.header.frame_id);
      |                                                                                                                          ^
In file included from /opt/ros/noetic/include/tf2/transform_functions.h:35,
                 from /opt/ros/noetic/include/tf2/convert.h:35,
                 from /opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:35,
                 from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2/transform_datatypes.h:57:3: note: because ‘tf2::Stamped<KDL::Vector>’ has user-provided ‘tf2::Stamped<T>::Stamped(const tf2::Stamped<T>&) [with T = KDL::Vector]’
   57 |   Stamped(const Stamped<T>& s):
      |   ^~~~~~~
In file included from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h: In function ‘void tf2::doTransform(const T&, T&, const TransformStamped&) [with T = tf2::Stamped<KDL::Twist>; geometry_msgs::TransformStamped = geometry_msgs::TransformStamped_<std::allocator<void> >]’:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:134:121: warning: implicitly-declared ‘tf2::Stamped<KDL::Twist>& tf2::Stamped<KDL::Twist>::operator=(const tf2::Stamped<KDL::Twist>&)’ is deprecated [-Wdeprecated-copy]
  134 |     t_out = tf2::Stamped<KDL::Twist>(transformToKDL(transform) * t_in, transform.header.stamp, transform.header.frame_id);
      |                                                                                                                         ^
In file included from /opt/ros/noetic/include/tf2/transform_functions.h:35,
                 from /opt/ros/noetic/include/tf2/convert.h:35,
                 from /opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:35,
                 from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2/transform_datatypes.h:57:3: note: because ‘tf2::Stamped<KDL::Twist>’ has user-provided ‘tf2::Stamped<T>::Stamped(const tf2::Stamped<T>&) [with T = KDL::Twist]’
   57 |   Stamped(const Stamped<T>& s):
      |   ^~~~~~~
In file included from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h: In function ‘void tf2::doTransform(const T&, T&, const TransformStamped&) [with T = tf2::Stamped<KDL::Wrench>; geometry_msgs::TransformStamped = geometry_msgs::TransformStamped_<std::allocator<void> >]’:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:189:122: warning: implicitly-declared ‘tf2::Stamped<KDL::Wrench>& tf2::Stamped<KDL::Wrench>::operator=(const tf2::Stamped<KDL::Wrench>&)’ is deprecated [-Wdeprecated-copy]
  189 |     t_out = tf2::Stamped<KDL::Wrench>(transformToKDL(transform) * t_in, transform.header.stamp, transform.header.frame_id);
      |                                                                                                                          ^
In file included from /opt/ros/noetic/include/tf2/transform_functions.h:35,
                 from /opt/ros/noetic/include/tf2/convert.h:35,
                 from /opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:35,
                 from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2/transform_datatypes.h:57:3: note: because ‘tf2::Stamped<KDL::Wrench>’ has user-provided ‘tf2::Stamped<T>::Stamped(const tf2::Stamped<T>&) [with T = KDL::Wrench]’
   57 |   Stamped(const Stamped<T>& s):
      |   ^~~~~~~
In file included from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h: In function ‘void tf2::doTransform(const T&, T&, const TransformStamped&) [with T = tf2::Stamped<KDL::Frame>; geometry_msgs::TransformStamped = geometry_msgs::TransformStamped_<std::allocator<void> >]’:
/opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:246:121: warning: implicitly-declared ‘tf2::Stamped<KDL::Frame>& tf2::Stamped<KDL::Frame>::operator=(const tf2::Stamped<KDL::Frame>&)’ is deprecated [-Wdeprecated-copy]
  246 |     t_out = tf2::Stamped<KDL::Frame>(transformToKDL(transform) * t_in, transform.header.stamp, transform.header.frame_id);
      |                                                                                                                         ^
In file included from /opt/ros/noetic/include/tf2/transform_functions.h:35,
                 from /opt/ros/noetic/include/tf2/convert.h:35,
                 from /opt/ros/noetic/include/tf2_kdl/tf2_kdl.h:35,
                 from /home/sloretz/ws/noetic/src/robot_state_publisher/src/robot_state_publisher.cpp:39:
/opt/ros/noetic/include/tf2/transform_datatypes.h:57:3: note: because ‘tf2::Stamped<KDL::Frame>’ has user-provided ‘tf2::Stamped<T>::Stamped(const tf2::Stamped<T>&) [with T = KDL::Frame]’
   57 |   Stamped(const Stamped<T>& s):
      |   ^~~~~~~

note: I would have pushed this branch to a fork, but sloretz/geometry2 appears to be a fork of ros2/geometry2 already, and I couldn't open a PR from there to ros/geometry2 :(

@tfoote tfoote left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to add to be explicit. Though we should add at least one basic test to keep our coverage up and this should be easy to test.

@sloretz

sloretz commented Apr 21, 2020

Copy link
Copy Markdown
Contributor Author

This looks good to add to be explicit. Though we should add at least one basic test to keep our coverage up and this should be easy to test.

Added unit tests for tf2::Stamped in a5c34ae

@sloretz
sloretz requested a review from tfoote April 21, 2020 15:25
@sloretz

sloretz commented May 1, 2020

Copy link
Copy Markdown
Contributor Author

@tfoote friendly ping, this fixes the unstable robot_state_publisher job.

@sloretz

sloretz commented May 12, 2020

Copy link
Copy Markdown
Contributor Author

@tfoote friendly ping. I think this is ready to merge with your approval.

@tfoote
tfoote merged commit a4e2bec into noetic-devel May 13, 2020
@tfoote
tfoote deleted the sloretz/stamped_copy_assignment branch May 13, 2020 08:46
ooeygui pushed a commit to ms-iot/geometry2 that referenced this pull request Oct 12, 2022
…_pose_with_covariance_stamped (ros#453)

* -Fixed the issue of covariance not being transformed in do_transform_pose_with_covariance_stamped, corresponding to ros2/geometry2#431 and made the same changes as the C++ API

Co-authored-by: Abrar Rahman Protyasha <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants