-
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
forward declare fromMsg to avoid missing symbols in downstream libraries #485
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.
I think #427 will take a while to land, so this can be merged for now.
CI: Note: the failing uncrustify tests were addressed in #486. |
Hey @aprotyas, any update on this ? |
It's been a while and the failing tests have been addressed, so I'll re-run CI: Repos file: https://gist.githubusercontent.com/aprotyas/c86851dae9847cc1bcf70351926c5a37/raw/94dd686808cad6b23a27280cb26629b261426080/ros2.repos |
@ahcorde @clalancette can either of you take a look please? |
@jcmonteiro can you rebase your branch on the |
3b3ed88
to
db1a534
Compare
Re-running CI following the rebase: Repos file: https://gist.githubusercontent.com/aprotyas/c86851dae9847cc1bcf70351926c5a37/raw/94dd686808cad6b23a27280cb26629b261426080/ros2.repos |
@aprotyas hey, any ETA on this ? |
I left this hanging last time, my bad. Okay, @jcmonteiro last rebase request and then I'll run CI. |
Running CI: Repos file: https://gist.githubusercontent.com/aprotyas/c86851dae9847cc1bcf70351926c5a37/raw/94dd686808cad6b23a27280cb26629b261426080/ros2.repos |
This PR fixes rst-tu-dortmund/teb_local_planner#334 and mitigates #242 while a proper solution addressing
fromMsg
and other template prototype functions (e.g., #427) is not provided.Why
Without the forward declaration, the symbol will be undefined in a target that depends on
tf2
andtf2_geometry_msgs
and includes firsttf2/utils.h
and latertf2_geometry_msgs/tf2_geometry_msgs.hpp
since there are inlined functions intf2/impl/utils.h
that make use offromMsg
with the quaternions as input types.Disclaimer
This solution is avoiding the deeper issue where
fromMsg
and other template functions are not being specialized. If, for example,fromMsg
had been properly specialized intf2_geometry_msgs.hpp
for the typesgeometry_msgs::msg::Quaternion
andtf2::Quaternion
, the forward declaration here would beExample
One can validate this solution by building a simple library
... add_library(library SHARED src/library.cpp) ...
changing the order of the includes and checking the symbols in
liblibrary.so
withWhen checking the symbol, one should notice that
tf2::fromMsg<...>(...)
,tf2::fromMsg(...)
which is not a specialization of the template function.