Manages efferent operations in the robotic system, including the configuration of publishers and message broadcasting.
More...
#include <Efferent.hpp>
|
virtual bool | configure ()=0 |
| Configures the Efferent component.
|
|
| Efferent (rclcpp_lifecycle::LifecycleNode::SharedPtr parent) |
| Constructs an Efferent object associated with a parent lifecycle node.
|
|
template<class MessageT> |
void | publish (std::unique_ptr< MessageT > msg) |
| Publishes a serialized message to all configured publishers.
|
|
|
bool | create_publisher (const std::string &topic, const std::string &type) |
| Creates a publisher for a specified topic and message type.
|
|
|
rclcpp_lifecycle::LifecycleNode::SharedPtr | parent_ |
| < Shared pointer to the parent lifecycle node.
|
|
std::vector< std::shared_ptr< rclcpp::GenericPublisher > > | pubs_ |
|
Manages efferent operations in the robotic system, including the configuration of publishers and message broadcasting.
◆ Efferent()
Efferent |
( |
rclcpp_lifecycle::LifecycleNode::SharedPtr | parent | ) |
|
|
explicit |
Constructs an Efferent object associated with a parent lifecycle node.
Constructs an Efferent object and assigns the parent lifecycle node.
- Parameters
-
parent | Shared pointer to the lifecycle node managing this Efferent instance. |
◆ configure()
virtual bool configure |
( |
| ) |
|
|
pure virtual |
◆ create_publisher()
bool create_publisher |
( |
const std::string & | topic, |
|
|
const std::string & | type ) |
|
protected |
Creates a publisher for a specified topic and message type.
- Parameters
-
topic | The topic name to publish messages to. |
type | The type of messages to publish on the topic. |
- Returns
- True if the publisher was created successfully.
This function sets up a generic publisher on a given topic, allowing the Efferent component to send messages of the specified type.
- Parameters
-
topic | The topic name to publish messages to. |
type | The type of messages to publish on the topic. |
- Returns
- True if the publisher was created successfully.
◆ publish()
template<class MessageT>
void publish |
( |
std::unique_ptr< MessageT > | msg | ) |
|
Publishes a serialized message to all configured publishers.
This templated method serializes the provided message and broadcasts it to each publisher in the pubs_
list.
- Template Parameters
-
MessageT | Type of the message to publish. |
- Parameters
-
msg | Unique pointer to the message to broadcast. |
◆ parent_
rclcpp_lifecycle::LifecycleNode::SharedPtr parent_ |
|
protected |
< Shared pointer to the parent lifecycle node.
List of generic publishers.
◆ pubs_
std::vector<std::shared_ptr<rclcpp::GenericPublisher> > pubs_ |
|
protected |
The documentation for this class was generated from the following files: