ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
One thing you could try is to wait a little for the transform:
listener.waitForTransform(destination_frame, original_frame, ros::Time(0), ros::Duration(10.0) );
This would wait at most 10 seconds for the transform to show up.
Of course that won't help if there is some fundamental issue with your tf setup. But generally for a new run node you should call waitForTransform before you try to use transforms for the first time. Also you should be sure to keep the transformlistener over the whole runtime of your node. If you require the tf for a special timestamp, be sure to adjust the third param of the waitForTransform call, also. ros::Time(0) means "the latest transform" in the tf-context.