What is setCreateTimerInterface in the TF2 library for?
I'm currently working on setting up a TransformListener in ROS2, using the TF2 API. I notice that when creating the TF buffer object, existing ROS2 libraries that use this library also call the setCreateTimerInterface
function.
This is the typical code used:
tf_buffer_ = std::make_shared<tf2_ros::Buffer>(rclcpp_node_->get_clock());
auto timer_interface = std::make_shared<tf2_ros::CreateTimerROS>(
rclcpp_node_->get_node_base_interface(),
rclcpp_node_->get_node_timers_interface());
tf_buffer_->setCreateTimerInterface(timer_interface);
And here are two examples of this in use:
However the ROS2 Foxy API doesn't describe this function at all (see bottom of this page), if it is necessary, or why the TF2 buffer needs this in ROS2 when it wasn't present in ROS1. It's also not explained on the ROS2 TF2 tutorial page.
Is someone with better knowledge of this source code able to explain what the timer interface is for and how it works?