Common
common packages for kyubic
 
Loading...
Searching...
No Matches
behavior_tree::Talker Class Reference

Action node to publish a string message to a ROS 2 topic. More...

#include <talker.hpp>

+ Inheritance diagram for behavior_tree::Talker:
+ Collaboration diagram for behavior_tree::Talker:

Public Member Functions

 Talker (const std::string &name, const BT::NodeConfig &config, rclcpp::Node::SharedPtr ros_node)
 Constructor for the Talker node.
 
BT::NodeStatus tick () override
 Publishes the message to the topic.
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 Defines the input ports for this node.
 

Detailed Description

Action node to publish a string message to a ROS 2 topic.

This node reads a string from the input port "message" and publishes it to the topic specified in the input port "topic_name".

Constructor & Destructor Documentation

◆ Talker()

behavior_tree::Talker::Talker ( const std::string &  name,
const BT::NodeConfig &  config,
rclcpp::Node::SharedPtr  ros_node 
)

Constructor for the Talker node.

Parameters
nameThe name of the node in the behavior tree.
configThe configuration of the node.
ros_nodeShared pointer to the ROS 2 node used for publishing.

Member Function Documentation

◆ providedPorts()

BT::PortsList behavior_tree::Talker::providedPorts ( )
static

Defines the input ports for this node.

Returns
A list containing:
  • InputPort "message": The string content to publish.
  • InputPort "topic_name": The ROS 2 topic to publish to (default: "output").

◆ tick()

BT::NodeStatus behavior_tree::Talker::tick ( )
override

Publishes the message to the topic.

Returns
BT::NodeStatus::SUCCESS if published successfully. BT::NodeStatus::FAILURE if the message port is empty or publisher is invalid.

The documentation for this class was generated from the following files: