-
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
Linker error with Rviz2 plugin: undefined symbol: tf2::fromMsg #639
Comments
Yes, you need to have this definition. It is generally provided by tf2_geometry_msgs here: geometry2/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp Lines 933 to 938 in b9b06ec
tf2_geometry_msgs .
|
So, I think it's more involved than just linking against tf2_geometry_msgs - you need to include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" BEFORE "tf2/utils.hpp" per discussion here: #485. I have no idea why, but I also just recently hit this on https://github.com/mikeferguson/graceful_controller - where I haven't changed any code since March and I'm now having this missing symbol issue. I presume some header I included must have previously included the tf2_geometry_msgs header file, and now no longer does. In my case the issue was:
|
Which release are you testing against? |
Actually, I just realized my build failure isn't actually new - I only hit this build failure when building RelWithDebugInfo (mikeferguson/graceful_controller#52) - which makes it even stranger. UPDATE: including tf2_geometry_msgs/tf2_geometry_msgs.hpp BEFORE tf2/utils.h DOES fix my build issue even when using RelWithDebugInfo - even though the PR above seems to indicate that it shouldn't still be an issue |
I'm on Iron, latest debs 0.31.5 |
Not exactly sure what is going on here, but this closes #52 Detailed discussion in ros2/geometry2#639
A detailed discussion may be found here ros2/geometry2#639
A detailed discussion may be found here ros2/geometry2#639
@clalancette @mikeferguson thank you for your reply! I can confirm what @mikeferguson said that just linking tf2_geometry_msgs is not enough to solve the problem, it is also needed to add the My guess for this problem is that something changed within tf2 dependencies that broke downstream packages. I faced a similar issue with dependencies that suddenly disappear with tf2_eigen carla-simulator/ros-bridge#709 If |
In theory, yes. The problem is that we can't do that, as it creates a circular dependency between Probably the right solution is to redesign this API, something along the lines of #427 . But it is a very large change, and we haven't been able to get it in yet. Also, it will cause some short-term pain, but will be better in the long-term. |
Sounds reasonable, classic project growing pains... I will close this one as the original problem was solved and a refactor is already in the horizon. If someone else faces the same problem, I hope this discussion may be useful Thank you very much for your support! |
Bug report
Required Info:
Steps to reproduce issue
rviz_carla_plugin
Expected behavior
Rviz2 should load the plugin and process the messages as intended
Actual behavior
Rviz2 crashes with the message:
Additional information
There is a lot of stuff going on in this setup, so it wasn't easy to pin point the problem within geometry2.
The evidence that I collected so far, in the file
tf2/impl/utils.h
, we have the declaration of the prototypefromMsg
function.geometry2/tf2/include/tf2/impl/utils.h
Line 29 in b9b06ec
This declaration creates an undefined symbol in the plugin dynamic object.
When rviz2 tries to execute the plugin's code, it stumbles upon an undefined symbol and then crashes.
As described here carla-simulator/ros-bridge#711, a quick and dirt solution is to add a bogus
fromMsg
declarationI tried to include
tf2/convert.h
and call the template version offromMsg
, but I got a different errorCode in rviz2 plugin
Terminal
rviz2 -d src/ros-bridge/carla_ad_demo/config/carla_ad_demo_ros2 .rviz [INFO] [1701717747.297741667] [rviz2]: Stereo is NOT SUPPORTED [INFO] [1701717747.297844785] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [INFO] [1701717747.323646353] [rviz2]: Stereo is NOT SUPPORTED fish: Job 1, 'rviz2 -d src/ros-bridge/carla_a…' terminated by signal SIGSEGV (Address boundary error)
I'm not sure why the prototype declaration of the
fromMsg
is needed, so my suggestion would be the simple removal of that declaration in that file.It may be related to #242, but I'm not entirely sure
The text was updated successfully, but these errors were encountered: