-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove template specialization for toMsg functions #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a recommendation to remove the templated declarations of toMsg()
and fromMsg()
in tf2/convert.h
since they're no longer being used here.
I'm not sure if this can be backported. If a compiler chooses to ignore inline
, I think the mangled name on the functions is changed when these become overloads instead of specializations.
@tfoote Before I merge this, maybe you can shed some light on if template specialization is required or if switching to overloads is fine. |
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This fixes #176 as demonstrated by the unit test compiling. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Similar to stamped transforms, this resolves a compilation issue when using the function. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
1ee78ab
to
143e90d
Compare
@sloretz I think you're right that this is not eligible for backport, but users can still workaround the issue by explicitly providing template arguments. I've rebased to get the latest changes and I've removed the last occurrence of the template specialization for |
Since the templated declarations may be used elsewhere (outside of this repo), it might be better to leave them for now. |
@jacobperron removed this from backport consideration since it is not ABI compatible. |
Since ros2/geometry2#179, there are no longer compilation issues. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Since ros2/geometry2#179, there are no longer compilation issues. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Resolves #176
Before, the compiler was preferring the overloaded function:
geometry2/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.h
Lines 397 to 398 in 71b0542
instead of the template specialization. I tried to change the overload into a template specialization, but then we run into the error that the compile can't deduce the second template parameter (ie. the return type).
I'm not sure if this is an ideal fix, or if instead we should go with template specialization (I'm not sure how we were/are benefiting from this), which requires the user to be explicit:
auto msg = tf2::toMsg<tf2::Stamped<tf2::Transform>, geometry_msgs::msg::TransformStamped>(tf_stamped);
I've also went ahead and made the change for stamped quaternions, which have the same bug.