ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

undefined reference to tf::poseMsgToEigen

asked 2018-07-26 05:12:18 -0600

dhindhimathai gravatar image

I'm on Ubuntu 14.04 with ROS Indigo.

Inside a service callback, I want to convert a geometry_msgs::Pose to Eigen::Affine3d. I'm trying to use tf::poseMsgToEigen.

My includes are as follows:

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

The relevant part of code is:

geometry_msgs::Pose pose;
Eigen::Affine3d transform;  
tf::poseMsgToEigen(pose, transform);

I get the following error:

undefined reference to `tf::poseMsgToEigen(geometry_msgs::Pose_<std::allocator<void> > const&, Eigen::Transform<double, 3, 2, 0>&)'
collect2: error: ld returned 1 exit status

Inside my CMakeLists.txt I have

find_package(catkin REQUIRED COMPONENTS

and in the package.xml I have added the build and exec_depends for the same.

Thanks a lot in advance for your help.

edit retag flag offensive close merge delete



Are you maybe missing eigen conversion?

destogl gravatar image destogl  ( 2018-07-26 05:14:49 -0600 )edit

@destogl I already included it: #include <eigen_conversions/eigen_msg.h>. Do I have to include it anywhere else?

dhindhimathai gravatar image dhindhimathai  ( 2018-07-26 05:33:26 -0600 )edit

I was missing tf_conversions and had similar error.

Abdulbaki gravatar image Abdulbaki  ( 2019-04-08 10:32:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-26 05:51:57 -0600

dhindhimathai gravatar image

Sorry guys, I was missing eigen_conversions inside find_package(catkin REQUIRED COMPONENTS ) in my CMakeLists.txt.

Thanks to @destogl for the hint.

edit flag offensive delete link more



That is what I meant

destogl gravatar image destogl  ( 2018-07-26 06:50:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-07-26 05:12:18 -0600

Seen: 2,721 times

Last updated: Jul 26 '18