15 #ifndef RCLCPP__CREATE_PUBLISHER_HPP_ 16 #define RCLCPP__CREATE_PUBLISHER_HPP_ 28 template<
typename MessageT,
typename AllocatorT,
typename PublisherT>
29 std::shared_ptr<PublisherT>
32 const std::string & topic_name,
34 bool use_intra_process_comms,
35 std::shared_ptr<AllocatorT> allocator)
38 publisher_options.qos = qos_profile;
42 rclcpp::create_publisher_factory<MessageT, AllocatorT, PublisherT>(allocator),
44 use_intra_process_comms);
46 return std::dynamic_pointer_cast<PublisherT>(pub);
51 #endif // RCLCPP__CREATE_PUBLISHER_HPP_ Definition: allocator_common.hpp:24
virtual rclcpp::publisher::PublisherBase::SharedPtr create_publisher(const std::string &topic_name, const rclcpp::PublisherFactory &publisher_factory, rcl_publisher_options_t &publisher_options, bool use_intra_process)=0
virtual void add_publisher(rclcpp::publisher::PublisherBase::SharedPtr publisher)=0
rcl_publisher_options_t rcl_publisher_get_default_options(void)
Pure virtual interface class for the NodeTopics part of the Node API.
Definition: node_topics_interface.hpp:38
std::shared_ptr< PublisherT > create_publisher(rclcpp::node_interfaces::NodeTopicsInterface *node_topics, const std::string &topic_name, const rmw_qos_profile_t &qos_profile, bool use_intra_process_comms, std::shared_ptr< AllocatorT > allocator)
Definition: create_publisher.hpp:30