Action node to publish a string message to a ROS 2 topic.
More...
#include <talker.hpp>
|
| | 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 BT::PortsList | providedPorts () |
| | Defines the input ports for this node.
|
| |
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".
◆ Talker()
| behavior_tree::Talker::Talker |
( |
const std::string & |
name, |
|
|
const BT::NodeConfig & |
config, |
|
|
rclcpp::Node::SharedPtr |
ros_node |
|
) |
| |
Constructor for the Talker node.
- Parameters
-
| name | The name of the node in the behavior tree. |
| config | The configuration of the node. |
| ros_node | Shared pointer to the ROS 2 node used for publishing. |
◆ 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: