tf::matrixEigenToTF

asked 2015-10-14 00:35:37 -0500

johnny.lin gravatar image

updated 2015-10-14 00:37:46 -0500

Eigen::Affine3f transform_temp = (Affine3f)transforms[i]; 
        const Eigen::Matrix3d rotation_part = transform_temp.rotation().cast<double>();
        const Eigen::Vector3d translation_part = transform_temp.translation().cast<double>();
        tf::Matrix3x3 rot;
        tf::Vector3 tra;
        tf::matrixEigenToTF(rotation_part, rot);
        tf::vectorEigenToTF(translation_part, tra);
        tf::Transform temp_transform(rot, tra);

        listener->lookupTransform (link, msg_in->header.frame_id, ros::Time(0), tfTransform);

        broadcaster->sendTransform(tf::StampedTransform(tfTransform * temp_transform.inverse(), ros::Time::now(), link,  "chess_board"));

I got the following error. Do not know why, I have find_package(catkin REQUIRED COMPONENTS tf tf_conversions) and also target_link_libraries(${catkin_LIBRARIES})

undefined reference to `tf::matrixEigenToTF(Eigen::Matrix<double, 3, 3, 1, 3, 3> const&, tf::Matrix3x3&)'
edit retag flag offensive close merge delete

Comments

I can manually transform this by just copying the tf::matrixEigenToTF() code. But still do not know why calling this function directly does not work.

johnny.lin gravatar image johnny.lin  ( 2015-10-14 01:07:31 -0500 )edit