# Unable to lookup transform, cache is empty.

Hi everybody! I'm a newcomer to the ROS world, so please do correct me when necessary, it will be appreciated. If there's a better way of doing something, I'm also interested and open to corrections. I have searched a lot for questions with similar problems, but none of the solutions work in my case. Now, onto the question:

Edit: I forgot to mention I'm using ROS Fuerte.

I have a Kinect mounted on top of a robot, 16 cm above the robot's referential. What I want to do is to transform the point cloud and depth image that Kinect publishes (in the /camera/depth_registered/points topic) to be referenced to the robot's referential. Also, I want to publish a new point cloud that uses spherical coordinates instead of cartesian coordinates.

Everything seems to be doing what is expected (things appear correct when I see them with Rviz), but after some seconds, the following error message starts to appear repeatedly and everything freezes in Rviz:

Unable to lookup transform, cache is empty, when looking up transform from frame [/camera_rgb_optical_frame] to frame [/impep_frame]


Also, Rviz produces the following warning message:

MessageFilter [target=/impep_frame ]: Discarding message from [/kinectRef2IMPEPRef] due to empty frame_id.  This message will only print once.


This is the launch file I use:

<launch>
<!-- Launch the static transform publisher that defines the transform
from IMPEP's referential to Kinect's referential. -->
<node name="impep_frame_publisher" pkg="tf" type="static_transform_publisher" args="0 0 0.16 0.5 -0.5 0.5 0.5 /impep_frame /camera_link 100" />

<!-- Launch the node that transforms data from Kinect's referential to
IMPEP's referential -->
<node name="kinectRef2IMPEPRef" pkg="IMPEP" type="kinectRef2IMPEPRef" />

<!-- Include the openni launch file to start the Kinect nodes. -->
<include file="\$(find IMPEP)/launch/openni.launch" />
</launch>


Note: I changed the following line in the openni.launch file to have depth registered output.

<!-- Use OpenNI's factory-calibrated depth->RGB registration? -->
<arg name="depth_registration" default="true" />


This is the code I've written to do all this. I'm aware that some things can be optimized, but I want to understand what's going wrong with this code before I start optimizing it. I put it in Pastebin for easier reading, it is too big to post here (185 lines).

Note: PointDTPRGB is a point type created by myself to contain the spherical coordinates.

Edit2: I just noticed that, after I shutdown the nodes launched by the launch file above, this message related to my problematic node appears:

[kinectRef2IMPEPRef-3] escalating to SIGTERM


If you need any information I might have forgotten, please do ask for it, I will post it as soon as possible. Thanks in advance!

edit retag close merge delete

Sort by » oldest newest most voted

I finally solved this problem. I'm posting the answer because it might help someone else.

If you look into the code I had before you will notice I made all my calculations inside the callback function of the topic the node subscribes to. This post instructed me that the callback function is not the best place to perform calculations.

Knowing this, I restructured my code into this, which solved the problem.

more