Common
common packages for kyubic
 
Loading...
Searching...
No Matches
talker.hpp
Go to the documentation of this file.
1
10#ifndef _TALKER_HPP
11#define _TALKER_HPP
12
13#include <behaviortree_cpp/action_node.h>
14
15#include <rclcpp/rclcpp.hpp>
16#include <std_msgs/msg/string.hpp>
17
18namespace behavior_tree
19{
20
26class Talker : public BT::SyncActionNode
27{
28public:
35 Talker(const std::string & name, const BT::NodeConfig & config, rclcpp::Node::SharedPtr ros_node);
36
43 static BT::PortsList providedPorts();
44
50 BT::NodeStatus tick() override;
51
52private:
53 rclcpp::Node::SharedPtr ros_node_;
54 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_;
55 std::string topic_name_;
56};
57
58} // namespace behavior_tree
59
60#endif // _TALKER_HPP
Action node to publish a string message to a ROS 2 topic.
Definition: talker.hpp:27
static BT::PortsList providedPorts()
Defines the input ports for this node.
Definition: talker.cpp:28
BT::NodeStatus tick() override
Publishes the message to the topic.
Definition: talker.cpp:35