rclcpp
master
C++ ROS Client Library API
|
#include <publisher_base.hpp>
Public Types | |
using | IntraProcessManagerSharedPtr = std::shared_ptr< rclcpp::intra_process_manager::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... | |
const rmw_gid_t & | get_intra_process_gid () const |
Get the global identifier for this publisher used by intra-process communication. More... | |
rcl_publisher_t * | get_publisher_handle () |
Get the rcl publisher handle. More... | |
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... | |
rmw_qos_profile_t | get_actual_qos () const |
Get the actual QoS settings, after the defaults have been determined. 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... | |
virtual mapped_ring_buffer::MappedRingBufferBase::SharedPtr | make_mapped_ring_buffer (size_t size) const |
Implementation utility function that creates a typed mapped ring buffer. More... | |
void | setup_intra_process (uint64_t intra_process_publisher_id, IntraProcessManagerSharedPtr ipm, const rcl_publisher_options_t &intra_process_options) |
Implementation utility function used to setup intra process publishing after creation. More... | |
Protected Types | |
using | IntraProcessManagerWeakPtr = std::weak_ptr< rclcpp::intra_process_manager::IntraProcessManager > |
Protected Member Functions | |
template<typename EventCallbackT > | |
void | add_event_handler (const EventCallbackT &callback, const rcl_publisher_event_type_t event_type) |
using rclcpp::PublisherBase::IntraProcessManagerSharedPtr = std::shared_ptr<rclcpp::intra_process_manager::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).
const rmw_gid_t& rclcpp::PublisherBase::get_intra_process_gid | ( | ) | const |
Get the global identifier for this publisher used by intra-process communication.
rcl_publisher_t* rclcpp::PublisherBase::get_publisher_handle | ( | ) |
Get the rcl publisher handle.
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
rmw_qos_profile_t 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::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. |
|
virtual |
Implementation utility function that creates a typed mapped ring buffer.
Reimplemented in rclcpp::Publisher< MessageT, Alloc >, and rclcpp::Publisher< rcl_interfaces::msg::ParameterEvent >.
void rclcpp::PublisherBase::setup_intra_process | ( | uint64_t | intra_process_publisher_id, |
IntraProcessManagerSharedPtr | ipm, | ||
const rcl_publisher_options_t & | intra_process_options | ||
) |
Implementation utility function used to setup intra process publishing after creation.
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |