Ask Your Question
0

Eigen::eigen2_Transform3D and TF

asked 2012-03-14 09:56:31 -0600

Kel gravatar image

updated 2014-01-28 17:11:38 -0600

ngrennan gravatar image

Hi Guys,

I am trying to use tf::TransformTFToEigen with a TF listener.

I have both eigen2 and eigen3 installed.

The error I get is "'eigen2_Transform3d' is not a member of Eigen". I was assuming that including <tf_conversions tf_eigen.h=""> would pull in any eigen dependencies, as that is what happens in tf_eigen.cpp.

Here is my code:

 #include <ros/ros.h>
 #include "std_msgs/String.h"
 #include "std_msgs/Float32.h"
 #include <tf_conversions/tf_eigen.h>
 #include <tf/transform_listener.h>

 int main(int argc, char** argv){
   ros::init(argc, argv, "openni_tracker_listener");

   ros::NodeHandle node;

   tf::TransformListener listener;

   Eigen::eigen2_Transform3d t;

   ros::Rate rate(10.0);

   while (node.ok()){

     tf::StampedTransform transform;

     try{
       listener.lookupTransform( "/right_hand", "/left_hand",  
                            ros::Time(0), transform);
       tf::TransformTFToEigen(transform,t);

     }catch (tf::TransformException ex){
       ROS_ERROR("%s",ex.what());
     }
     ros::spinOnce();
     rate.sleep();
   }
   return 0;
 };

Thanks for the help!

Kel

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-03-14 17:45:04 -0600

jbohren gravatar image

updated 2012-03-14 17:46:45 -0600

"eigen2_Transform3d" is an artifact of the Diamondback API where eigen2 types and eigen3 types were both used, but needed to be separated to avoid naming collisions. If you're trying to use tf_conversions with "eigen2_*" types on Electric, you will have problems.

Until a few moments ago when I fixed it, the main links under "Documentation" in both the eigen_conversions wiki page and the tf_conversions wiki page linked to an older version of the API documentation. If you're using electric, most (if not all) core packages should be using eigen3.

The API documentation should be clearer, now.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-03-14 09:56:31 -0600

Seen: 1,099 times

Last updated: Mar 14 '12