Ask Your Question
1

undefined reference to tf::poseMsgToEigen

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

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
  std_msgs
  geometry_msgs
  tf
  tf_conversions
)

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

Comments

1

Are you maybe missing eigen conversion?

destogl gravatar imagedestogl ( 2018-07-26 05:14:49 -0500 )edit

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

dhindhimathai gravatar imagedhindhimathai ( 2018-07-26 05:33:26 -0500 )edit

I was missing tf_conversions and had similar error.

Abdulbaki gravatar imageAbdulbaki ( 2019-04-08 10:32:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

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

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

Comments

1

That is what I meant

destogl gravatar imagedestogl ( 2018-07-26 06:50:05 -0500 )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

2 followers

Stats

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

Seen: 750 times

Last updated: Jul 26 '18