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
+1,183
−1,249
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