0
$\begingroup$

Rosanswers logo

Hi All,

I am trying to convert PointStamped values from the narrow_stereo_link frame to the base_link frame using tf::TransformListener::transformPoint. However, I keep getting:

terminate called after throwing an instance of 'tf::LookupException'

what(): Frame id / does not exist!

In my code I have the following function call,

mTransformListener.waitForTransform("/narrow_stereo_link", "/base_link", ros::Time::now(), ros::Duration(5.0)); mTransformListener.transformPoint("/base_link", min_in, min_res);

On executing

rosrun tf tf_echo narrow_stereo_link base_link

on the terminal, I get the following output :

At time 1340824941.479

  • Translation: [0.152, -0.117, -1.386]

  • Rotation: in Quaternion [-0.110, 0.061, 0.869, -0.479]

          in RPY [0.214, 0.133, -2.119]
    

which means that the two are connected in the tf_tree, which is also seen in the frames.pdf generated by

rosrun tf view_frames

Can anyone help me with this?


Originally posted by Mayank on ROS Answers with karma: 23 on 2012-06-27

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

In your call to waitForTransform, don't use ros::Time::now() but your point's time stamp and don't hard-code the frame id but use your point's frame id. Don't forget to check for the return value to be true. If the 5 seconds timeout pass without the transform becoming valid, waitForTransform will return and the following call to transformPoint will throw an exception.


Originally posted by Lorenz with karma: 22731 on 2012-06-27

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Mayank on 2012-06-28:
Thanks for your answer. I edited the code following your advice, but it still doesn't seem to work. I've posted the details below.

$\endgroup$
0
$\begingroup$

Rosanswers logo

My first guess would be that the input point "min_in" does not have a frame_id set. You have to make sure that the input point is in its correct frame by specifying its header.frame_id. It looks to me like this field is blank in your code.


Originally posted by DimitriProsser with karma: 11163 on 2012-06-27

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Mayank on 2012-06-27:
Thanks for your answer. I can't post a long comment, so please read my question posted below!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.