|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Wrapper for rclcpp::Publisher. More...
#include <publisher.hpp>
Public Member Functions | |
| Publisher (const PublisherOptions &options, std::string_view topic_name) | |
| construct a publisher using the specified options. | |
| void | publish (const MessageType &msg) |
| Publish a message. | |
| void | publish (std::unique_ptr< MessageType > msg) |
| Publish a message. | |
| std::string | get_topic_name () const |
| Returns the resolved (full) name of the topic handled by this publisher. | |
| std::string | get_unresolved_topic_name () const |
| Returns the unresolved name of the topic handled by this publisher. | |
| size_t | get_subscriber_count () const |
| Get number of subscribers on the published topic. | |
Wrapper for rclcpp::Publisher.
| MessageType | Type of the message to publish. |
| mrs_lib::Publisher< MessageType >::Publisher | ( | const PublisherOptions & | options, |
| std::string_view | topic_name ) |
construct a publisher using the specified options.
| options | Configuration of the publisher. |
| topic_name | Name of the topic to publish to. |
|
nodiscard |
Get number of subscribers on the published topic.
|
nodiscard |
Returns the resolved (full) name of the topic handled by this publisher.
|
nodiscard |
Returns the unresolved name of the topic handled by this publisher.
| void mrs_lib::Publisher< MessageType >::publish | ( | const MessageType & | msg | ) |
Publish a message.
| msg | Message to publish. |
| void mrs_lib::Publisher< MessageType >::publish | ( | std::unique_ptr< MessageType > | msg | ) |
Publish a message.
| msg | Message to publish. |