Ask Your Question

ROS DEPRECATED get_transforms_vec

asked 2013-04-21 19:02:39 -0600

Robetraks gravatar image

updated 2013-04-26 19:58:17 -0600


I am trying to port scene_label_3D package at, developed in a ROS diamondback to groovy. I was able to modify other bt objects in the package according to the bullet migration guide, but I am stuck in -

The problem is, that I want to find the transformation matrix by extracting the rotation and translation matrix from a tf::tfMessageConstPtr type object. This class has been changed and does not contain any get_transforms_vec function anymore. So my real question now is

How can I find a quaternion from the tf::tfMessageConstPtr object which is initialized as tf::tfMessageConstPtr tf_ptr = mtf.instantiate<tf::tfmessage >="" ();="" because="" my="" transformation="" data="" is="" contained="" inside="" a="" bag="" file.="" and="" assign="" it="" to="" a="" tf::transform="" type="" object?="" <="" p="">

The full code snippet is given below:

     tf::Transform final_tft;

    BOOST_FOREACH(rosbag::MessageInstance const mtf, view_tf)
        cout<<"Inside boost foreach"<<endl;
        tf::tfMessageConstPtr tf_ptr = mtf.instantiate<tf::tfMessage > ();
        assert(tf_ptr != NULL);
        std::vector<geometry_msgs::TransformStamped> bt;
        tf::Transform tft(getQuaternion(bt[0].transform.rotation), getVector3(bt[0].transform.translation));

            final_tft = tft;

And I receive the error saying that there is no get_transforms_vec function. I am struggling to solve this problem since many days. I would really appreciate any help.

Thanks, Akshay

edit retag flag offensive close merge delete


Same problem, could you solved it? Thanks

olmin gravatar image olmin  ( 2014-01-29 06:00:39 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-07-15 08:38:28 -0600

Hello Akshay,

I have been working on it. What I found the solution is,

Change the whole section with the bellow section, it will works properly. Note: I am working on ROS groovy.

TransformG readTranform(const string & filename) {

boost::numeric::ublas::matrix<double> mat(4,4);

ifstream file((char*) filename.c_str(), ifstream::in);

string line;

int row = 0;


    string e1;

    stringstream lineStream(line);

    int col = 0;

    while(getline(lineStream, e1, ',')){

        mat(row,col) = atof(e1.c_str());

            col +=1;


    row += 1;


TransformG transG(mat);

return transG;


Have a look and let me know, If you still face any issue. Remember you might need to sort of changes in some other file too.

edit flag offensive delete link more

answered 2014-01-29 06:00:08 -0600

olmin gravatar image

Same problem, could you solved it? Thanks

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


Asked: 2013-04-21 19:02:39 -0600

Seen: 192 times

Last updated: Jul 15 '15