0
$\begingroup$

Rosanswers logo

Hi,

I am porting a node to a nodelet and having trouble with the TransformListener. In the node it works, but not in the nodelet.

Overview:

  1. TransformListener is a member variable of the nodelet class
  2. after receiving the first pointcloud the TransformListener is tested:

if( !tfListener->waitForTransform(target_frame_id, cloud->header.frame_id, cloud->header.stamp, ros::Duration(10.0), ros::Duration(0.1), error) ) ...

No exception is thrown, it does simply fail. If I try a tfListener->lookupTransform afterwards it will throw an exception: Unable to lookup transform, cache is empty, when looking up transform from frame [/velodyne] to frame [/world] A call to tfListener->getCacheLength() return 10 seconds, a tfPrefix is not set, an tfListener->getAllFrames() also returns all frames correctly.

The things I tried so far:

  1. making the tfListener a boost shared pointer initialized in onInit() with different NodeHandles an Cache lengths.

  2. Inserting a sleep() for 5-10 seconds after creating the Listener and before testing the Listener

  3. Making a loop with intermitting ros::spinOnce()-Calls for 5-10 seconds

  4. Different Durations for timeout and polling intervall in the waitForTransform()

As stated above, a node with a TransformListener() running parallel to the nodelets has no problem looking up the transform an all calls of getCacheLength(), getAllFrames() give identical results to the nodelet-TransformListener.

Anyone any suggestions?

Regards, Torsten Fiolka


Originally posted by torstenfiolka on ROS Answers with karma: 16 on 2012-09-14

Post score: 0


Original comments

Comment by Lorenz on 2012-09-14:
Try setting the time stamp to 0 instead of using cloud->header.stamp to check if there is any transform between your source frame and target frame.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

With ros::Time(0) it works.


Originally posted by torstenfiolka with karma: 16 on 2012-09-17

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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