What is the tf threading model?
I want to use it in a single threaded node.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I want to use it in a single threaded node.
answered 2011-03-18 14:56:31 -0500
This post is a wiki. Anyone with karma >75 is welcome to improve it.
A TransformListener class is continuously listening for incoming coordinate transforms from TransformBroadcasters. Any blocking call would severely disrupt the flow of information to the listener. Therefore,
a transform listener, by default, spins its own thread. This particularly helps with calls to functions like tf::Transformer::waitForTransform
which can block callbacks while it is waiting to hear back from tf.
tf::Transformer
, tf::TransformListener
and tf::TransformSender
all use mutex locks to be threadsafe.tf::Transformer::waitForTransform
requires a dedicated listening thread (provided by default by tf::TransformListener)If TransformListener spins a thread it will only service callbacks in the custom callback queue for the tf topic.
What does that mean for the case, when there is a TransformListener, but no other ros spinning going on with respect to other subscribers (i.e. not tf). The TransformListener will get its tf data via its on spinning thread.
Will other callbacks from other subscribers be called although there is no one explictly spinning?
Asked: 2011-03-18 14:54:27 -0500
Seen: 1,561 times
Last updated: Mar 19 '11
Same tf tree changes some frames
tf broadcasting and listening in the same node
issue with odom and tf with gazebo simulation
ERROR: Laser has to be mounted planar
Transforming odom to base-link and then to map [closed]
rtabmap TF tree issue with navigation stack
Using tf for plotting frames in rviz