ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The problem is caused because you're trying to use the tf::TransformListener listener
object immediately after creating it. These objects work by listening to the tf
and tf_static
topics and storing a buffer of recent values. It then uses this buffer of messages to resolve transform queries.
Because of this you need to allow enough time for the TransformListener object to collect an initial buffer of values before you start using it.
It is recommended that you create a single tf::TransformListener
object when your node starts up, then to use that same object for the lifetime of the node.
Hope this helps.