15 #ifndef RCLCPP__CREATE_PUBLISHER_HPP_ 16 #define RCLCPP__CREATE_PUBLISHER_HPP_ 37 [[deprecated(
"use alternative rclcpp::create_publisher() signatures")]]
44 rclcpp::callback_group::CallbackGroup::SharedPtr group,
45 bool use_intra_process_comms,
49 publisher_options.qos = qos_profile;
53 rclcpp::create_publisher_factory<MessageT, AllocatorT, PublisherT>(event_callbacks, allocator),
55 use_intra_process_comms);
86 allocator = std::make_shared<AllocatorT>();
89 bool use_intra_process;
90 switch (options.use_intra_process_comm) {
92 use_intra_process =
true;
95 use_intra_process =
false;
98 use_intra_process = node_topics->get_node_base_interface()->get_use_intra_process_default();
106 auto pub = node_topics->create_publisher(
108 rclcpp::create_publisher_factory<MessageT, AllocatorT, PublisherT>(
109 options.event_callbacks,
112 options.template to_rcl_publisher_options<MessageT>(qos),
115 node_topics->add_publisher(pub, options.callback_group);
121 #endif // RCLCPP__CREATE_PUBLISHER_HPP_
virtual rclcpp::PublisherBase::SharedPtr create_publisher(const std::string &topic_name, const rclcpp::PublisherFactory &publisher_factory, const rcl_publisher_options_t &publisher_options, bool use_intra_process)=0
Encapsulation of Quality of Service settings.
Definition: qos.hpp:55
Contains callbacks for various types of events a Publisher can receive from the middleware.
Definition: qos_event.hpp:42
This header provides the get_node_topics_interface() template function.
Definition: allocator_common.hpp:24
std::shared_ptr< PublisherT > create_publisher(rclcpp::node_interfaces::NodeTopicsInterface *node_topics, const std::string &topic_name, const rmw_qos_profile_t &qos_profile, const PublisherEventCallbacks &event_callbacks, rclcpp::callback_group::CallbackGroup::SharedPtr group, bool use_intra_process_comms, std::shared_ptr< AllocatorT > allocator)
Definition: create_publisher.hpp:39
rclcpp::node_interfaces::NodeTopicsInterface * get_node_topics_interface(NodeType &&node_pointer)
Get the NodeTopicsInterface as a pointer from a pointer to a "Node like" object.
Definition: get_node_topics_interface.hpp:126
A publisher publishes messages of any type to a topic.
Definition: publisher.hpp:46
Explicitly enable intraprocess comm at publisher/subscription level.
Explicitly disable intraprocess comm at publisher/subscription level.
T dynamic_pointer_cast(T... args)
rcl_publisher_options_t rcl_publisher_get_default_options(void)
Structure containing optional configuration for Publishers.
Definition: publisher_options.hpp:47
Pure virtual interface class for the NodeTopics part of the Node API.
Definition: node_topics_interface.hpp:38
virtual void add_publisher(rclcpp::PublisherBase::SharedPtr publisher, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group)=0
Take intraprocess configuration from the node.