Skip to content
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

[Linking Bug - Rolling] tf2 geometry msgs converters #334

Open
guilyx opened this issue Dec 4, 2021 · 0 comments · Fixed by ros2/geometry2#485
Open

[Linking Bug - Rolling] tf2 geometry msgs converters #334

guilyx opened this issue Dec 4, 2021 · 0 comments · Fixed by ros2/geometry2#485

Comments

@guilyx
Copy link

guilyx commented Dec 4, 2021

Hi,

We were so far using Foxy, that still had the tf2_geometry_msgs.h header file in the debian release (0.17.2-1focal.20211011.234834) and had no issue using TEB on the foxy branch.

I'm now porting to Rolling with tf2_geometry_msgs on (0.19.0-1focal.20211105.230706). The header was ported to tf2_geometry_msgs.hpp and tf2_geometry_msgs.h was deprecated (it gives a warning, but the .h still exists and imports the .hpp).

Note that the compilation gives no error and I stumbled on this when running TEB after starting to run my Behavior Tree, the controller_server process died after TEB failed to find a symbol for a fromMsg converter.

Tried enabling the tests and the linker error appeared on compilation after a few fixes (mainly just porting Node to LifecycleNode in the homotopy class test)

This is the converter that's not found when compiling:

/** \brief Convert a Quaternion message to its equivalent tf2 representation.
 * This function is a specialization of the toMsg template defined in tf2/convert.h.
 * \param in A Quaternion message type.
 * \param out The Quaternion converted to a tf2 type.
 */
inline
void fromMsg(const geometry_msgs::msg::Quaternion & in, tf2::Quaternion & out)
{
  // w at the end in the constructor
  out = tf2::Quaternion(in.x, in.y, in.z, in.w);
}

Here's the linker error:

--- stderr: teb_local_planner                             
/usr/bin/ld: libteb_local_planner.so: undefined reference to `void tf2::fromMsg<geometry_msgs::msg::Quaternion_<std::allocator<void> >, tf2::Quaternion>(geometry_msgs::msg::Quaternion_<std::allocator<void> > const&, tf2::Quaternion&)'
collect2: error: ld returned 1 exit status

Which comes from teb_local_planner_ros.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant