tf2, thread, setUsingDedicatedThread, timeout
I'm migrating part of my code to tf2. Big chunk of my code is library that can run online or offline, so I pass at construction time a reference to a tf2_ros::Buffer object. It is then used to lookup transforms or transform some stamped data. The buffer is updated "manually" using setTransform.
I get the tf2_ros::threading_error message.
the stack is as follow:
0 tf2_ros::Buffer::checkAndErrorDedicatedThreadPresent buffer.cpp 158 0x7ffff711d487
1 tf2_ros::Buffer::canTransform buffer.cpp 107 0x7ffff711cf12
2 tf2_ros::Buffer::lookupTransform buffer.cpp 54 0x7ffff711cbf6
3 tf2_ros::BufferInterface::transform<geometry_msgs::PointStamped_<std::allocator<void>>> buffer_interface.h 116 0x7ffff79673f6
4 perception::SpinLoader::loadSpin spin_loader.cpp 201 0x7ffff7965c40
5 main offline_perception.cpp 132 0x42d62c
Note that in frame 4 I'm calling
tf2_ros::Buffer::transform(const geometry_msgs::PointStamped &, geometry_msgs::PointStamped &, const std::string &)
which does not have a timeout. But it calls tf2_ros::BufferInterface::transform with a timeout (of zero), which leads to my error... Even worst, canTransform in frame 1 returns false and it's ignored by lookupTransform in frame 2.
Is this a design bug in tf2? Maybe BufferInterface should have functions with no timeout as well.
regardless, what should I do? i.e. how to work with tf2 offline?