AWViz-ROS
Loading...
Searching...
No Matches
tf_tree_updater.hpp
Go to the documentation of this file.
1// Copyright 2024 Kotaro Uetake.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef AWVIZ_COMMON__TRANSFORMATION__TF_TREE_UPDATER_HPP_
16#define AWVIZ_COMMON__TRANSFORMATION__TF_TREE_UPDATER_HPP_
17
19
20#include <rclcpp/rclcpp.hpp>
21
22#include <tf2_ros/buffer.h>
23
24#include <memory>
25#include <mutex>
26#include <string>
27
28namespace awviz_common
29{
34{
35public:
36 virtual ~ITfTreeUpdater() = default;
37
42 virtual void update(TfTree & tree) = 0;
43};
44
48class TfTreeUpdater final : public ITfTreeUpdater
49{
50public:
52 rclcpp::Node::SharedPtr node, std::shared_ptr<tf2_ros::Buffer> tf_buffer,
53 std::shared_ptr<std::mutex> tf_tree_mtx);
54
55 void update(TfTree & tree) override;
56
57private:
58 rclcpp::Node::SharedPtr node_;
59 std::shared_ptr<tf2_ros::Buffer> tf_buffer_;
60 std::shared_ptr<std::mutex> tf_tree_mtx_;
61};
62} // namespace awviz_common
63
64#endif // AWVIZ_COMMON__TRANSFORMATION__TF_TREE_UPDATER_HPP_
Interface for updating a TF tree from a frame source.
Definition: tf_tree_updater.hpp:34
virtual void update(TfTree &tree)=0
Update the TF tree with the latest frame information.
virtual ~ITfTreeUpdater()=default
Concrete updater that uses a TF buffer to refresh the tree.
Definition: tf_tree_updater.hpp:49
void update(TfTree &tree) override
Update the TF tree with the latest frame information.
Definition: tf_tree_updater.cpp:32
Definition: tf_tree.hpp:99
Definition: display.hpp:32