Skip to content

Commit

Permalink
Use dedicated TransformListener thread (#551)
Browse files Browse the repository at this point in the history
Signed-off-by: ymd-stella <world.applepie@gmail.com>
  • Loading branch information
ymd-stella authored and jacobperron committed Jul 20, 2020
1 parent b63b096 commit 59dc1d7
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,16 @@ void TFWrapper::initialize(
bool using_dedicated_thread)
{
initializeBuffer(clock, rviz_ros_node.lock()->get_raw_node(), using_dedicated_thread);
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(
*buffer_, rviz_ros_node.lock()->get_raw_node(), false);
if (using_dedicated_thread) {
// TODO(pull/551): The TransformListener needs very quick spinning so it uses its own node
// here. Remove this in favor of a multithreaded spinner and ensure that the listener callback
// queue does not fill up.
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(
*buffer_, true);
} else {
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(
*buffer_, rviz_ros_node.lock()->get_raw_node(), false);
}
}

void TFWrapper::initializeBuffer(
Expand Down

0 comments on commit 59dc1d7

Please sign in to comment.