ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi! I had same trouble with lookup_transform. I'm found solution in tf_echo source code. You need add tf2_ros::TransformListener and init it with tf2_ros::Buffer:
std::unique_ptr<tf2_ros::Buffer> buffer = std::make_unique<tf2_ros::Buffer>(node->get_clock());
std::shared_ptr<tf2_ros::TransformListener> transform_listener_ = std::make_shared<tf2_ros::TransformListener>(*tf_buffer_);
Now when I call lookupTransform() it works as expected. I hope this helps you.