C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
tf_buffer_state.hpp
Go to the documentation of this file.
1// Copyright (C) 2026 Maik Knof
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16#ifndef YASMIN_ROS__TF_BUFFER_STATE_HPP_
17#define YASMIN_ROS__TF_BUFFER_STATE_HPP_
18
19#include <memory>
20#include <string>
21
22#include <rclcpp/rclcpp.hpp>
23
24#if __has_include(<tf2_ros/buffer.hpp>)
25#include <tf2_ros/buffer.hpp>
26#else
27#include <tf2_ros/buffer.h>
28#endif
29
30#if __has_include(<tf2_ros/transform_listener.hpp>)
31#include <tf2_ros/transform_listener.hpp>
32#else
33#include <tf2_ros/transform_listener.h>
34#endif
35
36#include "yasmin/blackboard.hpp"
37#include "yasmin/state.hpp"
39
40namespace yasmin_ros {
41
50public:
55
56
60
64 void configure() override;
65
73 std::string execute(yasmin::Blackboard::SharedPtr blackboard) override;
74
75private:
77 rclcpp::Node::SharedPtr node_;
80};
81
82} // namespace yasmin_ros
83
84#endif // YASMIN_ROS__TF_BUFFER_STATE_HPP_
std::shared_ptr< Blackboard > SharedPtr
Shared pointer type for Blackboard.
Definition blackboard.hpp:100
Represents a state in a state machine.
Definition state.hpp:49
rclcpp::Node::SharedPtr node_
Node used to create the tf2 listener subscriptions.
Definition tf_buffer_state.hpp:77
TfBufferState()
Shared pointer type for TfBufferState.
Definition tf_buffer_state.cpp:44
void configure() override
Read the configured parameters.
Definition tf_buffer_state.cpp:68
std::string execute(yasmin::Blackboard::SharedPtr blackboard) override
Create the tf2 buffer/listener pair and store them in the blackboard.
Definition tf_buffer_state.cpp:72
double cache_time_sec_
Buffer cache duration in seconds.
Definition tf_buffer_state.hpp:79
Definition action_state.hpp:37
#define YASMIN_PTR_ALIASES(ClassName)
Macro to define all pointer aliases for a class.
Definition types.hpp:52