Ask Your Question
1

tf lookupTransform sigabrt

asked 2014-03-29 09:22:30 -0600

pkohout gravatar image

updated 2016-10-24 09:02:13 -0600

ngrennan gravatar image

hi,

i want to get the transformation between my /map and /robot_0/base_link. I am currentry trying it with:

tf::TransformListener listener;
    tf::StampedTransform transform;
    listener.lookupTransform("/map",
                             "/robot_0/base_link",
                             ros::Time(0),
                             transform);

but i always get a SIGABRT. What I am doing wrong ? my tf tree: image description

regards,

Edit: i get the following Error message: image description Peter

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-03-29 10:55:51 -0600

demmeln gravatar image

updated 2014-04-02 05:05:46 -0600

Is there any output? (Do you have output="screen" in your launch file?)

It would help if you could post the full code for the node. Are you catching the exceptions mentioned in the API? http://docs.ros.org/hydro/api/tf/html...

Edit:

It looks like your are trying to look up a transform before the listener has received enough information. Try adding a call to waitForTransform before lookupTransform. If that doesn't help, please add more of your code to your question.

edit flag offensive delete link more

Comments

i solved the problem, i had to use ros::Time::now() instead of ros::Time(0). I do not know why the code fom http://wiki.ros.org/tf/Tutorials/Writing%20a%20tf%20listener%20%28C%2B%2B%29 does not work, maybe there is something wrong in the tutorial example code.

pkohout gravatar imagepkohout ( 2014-04-02 05:04:18 -0600 )edit

I have no idea why it would work with ros::Time::now() and not ros::Time(0). In any case it would be a good idea to explictely add a call to waitForTransform. Your code is likely brittle to timeing changes. If your problem is solved, please inicate that by marking an answer as accepted. Thanks.

demmeln gravatar imagedemmeln ( 2014-04-02 05:12:13 -0600 )edit
1

There are also no try/catch blocks. Even with waitForTransform there might still be an exception.

dornhege gravatar imagedornhege ( 2014-04-02 06:30:18 -0600 )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

1 follower

Stats

Asked: 2014-03-29 09:22:30 -0600

Seen: 277 times

Last updated: Apr 02 '14