This repository was archived by the owner on May 31, 2025. It is now read-only.
New approach for the tf2::toMsg() hassle#491
Closed
gleichdick wants to merge 6 commits intoros:noetic-develfrom
Closed
New approach for the tf2::toMsg() hassle#491gleichdick wants to merge 6 commits intoros:noetic-develfrom
gleichdick wants to merge 6 commits intoros:noetic-develfrom
Conversation
The conversion is moved into the `ImplDetails` struct to avoid link-time errors. As the return value of `toMsg()` can't be deduced, a default value depending on the first argument will be chosen from the `defaultMessage` struct.
This was referenced Dec 11, 2020
Author
|
@tfoote friendly ping |
Member
|
Thanks for this. It's going to take me a bit to review this fully. As this will break ABI as a core module we generally won't want to roll it out into an active rosdistro for something quite this core without a significant problem. Would it make sense to target this for ROS 2 rolling instead of noetic. If we get it into rolling soon we can also shoot to get it into the upcoming Galactic release. |
3 tasks
Author
|
Okay, thanks. I'm currently porting this to ROS2, see ros2/geometry2#368. |
Contributor
|
I guess this ROS 1 PR can be closed. |
Member
|
This is something that we definitely can't change in ROS 1 distributions. I'm going to close this and point to the open PR on the ROS 2 repo: ros2/geometry2#427 for further discussion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second template parameter of
tf2::toMsg()now has a default value,which is resolved to a ROS message type depending on the non-message datatype.
This allows the deduction of the return value type.
Furthermore,
toMsg(),fromMsg(),getTimestamp()andgetFrameId()now have a default implementation,which forwards the calls into structs defined in the impl namespace. Now missing implementations of conversion methods result in compile-time errors, they do not occur during link-time anymore.
A lot of effort was put into the automatic conversion of dataypes with a stamp (
tf2::Stamped<T>and the ...Stamped ROS messages) to avoid code duplication. The stamped types now use the conversion methods of the unstamped types and copy the timestamp/frame id informations.This PR should remain API compatibility, but the ABI will break (as the non-templated functions like
toMsg()are removed).Further TODO's:
@seanyen may I ask you to test whether this approach works on Windows?
Related Issues:
#430
moveit/moveit#1785