13#include <behaviortree_cpp/action_node.h>
15#include <rclcpp/rclcpp.hpp>
16#include <std_msgs/msg/string.hpp>
26class Talker :
public BT::SyncActionNode
35 Talker(
const std::string & name,
const BT::NodeConfig & config, rclcpp::Node::SharedPtr ros_node);
50 BT::NodeStatus
tick()
override;
53 rclcpp::Node::SharedPtr ros_node_;
54 rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_;
55 std::string topic_name_;
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