AWViz-ROS
Loading...
Searching...
No Matches
transformation_manager.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_MANAGER_HPP_
16#define AWVIZ_COMMON__TRANSFORMATION_MANAGER_HPP_
17
22
23#include <rclcpp/rclcpp.hpp>
24#include <rerun.hpp>
25
26#include <tf2_ros/buffer.h>
27#include <tf2_ros/transform_listener.h>
28
29#include <memory>
30#include <mutex>
31#include <string>
32#include <unordered_map>
33namespace awviz_common
34{
39{
40public:
48 rclcpp::Node::SharedPtr node, std::shared_ptr<rerun::RecordingStream> stream);
49
55 const std::shared_ptr<std::unordered_map<std::string, std::string>> entities()
56 {
57 return entity_path_resolver_->entities();
58 }
59
60private:
65 void timer_callback();
66
70 void update_tree();
71
75 void update_entities();
76
80 void log_transforms();
81
82private:
83 rclcpp::Node::SharedPtr node_;
84 std::shared_ptr<rerun::RecordingStream> stream_;
85 std::shared_ptr<tf2_ros::Buffer> tf_buffer_;
86 std::shared_ptr<tf2_ros::TransformListener> tf_listener_;
87 rclcpp::TimerBase::SharedPtr timer_;
88 std::shared_ptr<TfTree> tf_tree_;
89 std::shared_ptr<std::mutex> tf_tree_mtx_;
90 std::shared_ptr<std::mutex> entities_mtx_;
91 std::unique_ptr<ITfTreeUpdater> tf_tree_updater_;
92 std::unique_ptr<EntityPathResolver> entity_path_resolver_;
93 std::unique_ptr<ITransformLogger> transform_logger_;
94};
95} // namespace awviz_common
96#endif // AWVIZ_COMMON__TRANSFORMATION_MANAGER_HPP_
A class to manage transform frames.
Definition: transformation_manager.hpp:39
const std::shared_ptr< std::unordered_map< std::string, std::string > > entities()
Return the entity paths.
Definition: transformation_manager.hpp:55
Definition: display.hpp:32