rclcpp
master
C++ ROS Client Library API
|
#include <publisher_base.hpp>
Public Types | |
using | IntraProcessManagerSharedPtr = std::shared_ptr< rclcpp::experimental::IntraProcessManager > |
Public Member Functions | |
PublisherBase (rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic, const rosidl_message_type_support_t &type_support, const rcl_publisher_options_t &publisher_options) | |
Default constructor. More... | |
virtual | ~PublisherBase () |
const char * | get_topic_name () const |
Get the topic that this publisher publishes on. More... | |
size_t | get_queue_size () const |
Get the queue size for this publisher. More... | |
const rmw_gid_t & | get_gid () const |
Get the global identifier for this publisher (used in rmw and by DDS). More... | |
std::shared_ptr< rcl_publisher_t > | get_publisher_handle () |
Get the rcl publisher handle. More... | |
std::shared_ptr< const rcl_publisher_t > | get_publisher_handle () const |
Get the rcl publisher handle. More... | |
const std::vector< std::shared_ptr< rclcpp::QOSEventHandlerBase > > & | get_event_handlers () const |
Get all the QoS event handlers associated with this publisher. More... | |
size_t | get_subscription_count () const |
Get subscription count. More... | |
size_t | get_intra_process_subscription_count () const |
Get intraprocess subscription count. More... | |
RCUTILS_WARN_UNUSED bool | assert_liveliness () const |
Manually assert that this Publisher is alive (for RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC). More... | |
rclcpp::QoS | get_actual_qos () const |
Get the actual QoS settings, after the defaults have been determined. More... | |
bool | can_loan_messages () const |
Check if publisher instance can loan messages. More... | |
bool | operator== (const rmw_gid_t &gid) const |
Compare this publisher to a gid. More... | |
bool | operator== (const rmw_gid_t *gid) const |
Compare this publisher to a pointer gid. More... | |
void | setup_intra_process (uint64_t intra_process_publisher_id, IntraProcessManagerSharedPtr ipm) |
Implementation utility function used to setup intra process publishing after creation. More... | |
std::vector< rclcpp::NetworkFlowEndpoint > | get_network_flow_endpoints () const |
Get network flow endpoints. More... | |
Public Member Functions inherited from std::enable_shared_from_this< PublisherBase > | |
T | enable_shared_from_this (T... args) |
T | operator= (T... args) |
T | shared_from_this (T... args) |
T | ~enable_shared_from_this (T... args) |
Protected Types | |
using | IntraProcessManagerWeakPtr = std::weak_ptr< rclcpp::experimental::IntraProcessManager > |
Protected Member Functions | |
template<typename EventCallbackT > | |
void | add_event_handler (const EventCallbackT &callback, const rcl_publisher_event_type_t event_type) |
void | default_incompatible_qos_callback (QOSOfferedIncompatibleQoSInfo &info) const |
using rclcpp::PublisherBase::IntraProcessManagerSharedPtr = std::shared_ptr<rclcpp::experimental::IntraProcessManager> |
|
protected |
rclcpp::PublisherBase::PublisherBase | ( | rclcpp::node_interfaces::NodeBaseInterface * | node_base, |
const std::string & | topic, | ||
const rosidl_message_type_support_t & | type_support, | ||
const rcl_publisher_options_t & | publisher_options | ||
) |
Default constructor.
Typically, a publisher is not created through this method, but instead is created through a call to Node::create_publisher
.
[in] | node_base | A pointer to the NodeBaseInterface for the parent node. |
[in] | topic | The topic that this publisher publishes on. |
[in] | type_support | The type support structure for the type to be published. |
[in] | publisher_options | QoS settings for this publisher. |
|
virtual |
const char* rclcpp::PublisherBase::get_topic_name | ( | ) | const |
Get the topic that this publisher publishes on.
size_t rclcpp::PublisherBase::get_queue_size | ( | ) | const |
Get the queue size for this publisher.
const rmw_gid_t& rclcpp::PublisherBase::get_gid | ( | ) | const |
Get the global identifier for this publisher (used in rmw and by DDS).
std::shared_ptr<rcl_publisher_t> rclcpp::PublisherBase::get_publisher_handle | ( | ) |
Get the rcl publisher handle.
std::shared_ptr<const rcl_publisher_t> rclcpp::PublisherBase::get_publisher_handle | ( | ) | const |
Get the rcl publisher handle.
const std::vector<std::shared_ptr<rclcpp::QOSEventHandlerBase> >& rclcpp::PublisherBase::get_event_handlers | ( | ) | const |
size_t rclcpp::PublisherBase::get_subscription_count | ( | ) | const |
Get subscription count.
size_t rclcpp::PublisherBase::get_intra_process_subscription_count | ( | ) | const |
Get intraprocess subscription count.
RCUTILS_WARN_UNUSED bool rclcpp::PublisherBase::assert_liveliness | ( | ) | const |
Manually assert that this Publisher is alive (for RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC).
If the rmw Liveliness policy is set to RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC, the creator of this publisher may manually call assert_liveliness
at some point in time to signal to the rest of the system that this Node is still alive.
true
if the liveliness was asserted successfully, otherwise false
rclcpp::QoS rclcpp::PublisherBase::get_actual_qos | ( | ) | const |
Get the actual QoS settings, after the defaults have been determined.
The actual configuration applied when using RMW_QOS_POLICY_*_SYSTEM_DEFAULT can only be resolved after the creation of the publisher, and it depends on the underlying rmw implementation. If the underlying setting in use can't be represented in ROS terms, it will be set to RMW_QOS_POLICY_*_UNKNOWN. May throw runtime_error when an unexpected error occurs.
bool rclcpp::PublisherBase::can_loan_messages | ( | ) | const |
Check if publisher instance can loan messages.
Depending on the middleware and the message type, this will return true if the middleware can allocate a ROS message instance.
bool rclcpp::PublisherBase::operator== | ( | const rmw_gid_t & | gid | ) | const |
Compare this publisher to a gid.
Note that this function calls the next function.
[in] | gid | Reference to a gid. |
bool rclcpp::PublisherBase::operator== | ( | const rmw_gid_t * | gid | ) | const |
Compare this publisher to a pointer gid.
A wrapper for comparing this publisher's gid to the input using rmw_compare_gids_equal.
[in] | gid | A pointer to a gid. |
void rclcpp::PublisherBase::setup_intra_process | ( | uint64_t | intra_process_publisher_id, |
IntraProcessManagerSharedPtr | ipm | ||
) |
Implementation utility function used to setup intra process publishing after creation.
std::vector<rclcpp::NetworkFlowEndpoint> rclcpp::PublisherBase::get_network_flow_endpoints | ( | ) | const |
Get network flow endpoints.
Describes network flow endpoints that this publisher is sending messages out on
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |