undefined reference to `tf::pointEigenToMsg

asked 2019-07-23 12:29:29 -0500

Henning Luo gravatar image

I'm working on Ubuntu 16.04 with ROS Kinetic.

In my program I was trying to convert an Eigen::Vector3d to a geometry_msgs::Point.

The error:

undefined reference to `tf::pointEigenToMsg(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&, geometry_msgs::Point_<std::allocator<void> >&)'

I have included the header:

#include <eigen_conversions/eigen_msg.h>
#include <tf/tf.h>
#include <tf_conversions/tf_eigen.h>

and in my CMakeLists.txt

find_package(catkin REQUIRED COMPONENTS 
    roscpp 
    std_msgs
    sensor_msgs
    geometry_msgs
    tf
    tf_conversions
    eigen_conversions
    pcl_ros
    pcl_conversions
    cv_bridge
    image_transport
    message_filters
    OpenCV
    yumi_vision_srv
)

also in the package.xml

  <depend>tf</depend>  
  <depend>tf_conversions</depend>
  <depend>eigen_conversions</depend>

Does anybody know why is this happening? Thank you so much for your help.

edit retag flag offensive close merge delete