15 #ifndef RCLCPP__CREATE_SUBSCRIPTION_HPP_ 16 #define RCLCPP__CREATE_SUBSCRIPTION_HPP_ 42 typename CallbackMessageT =
55 CallbackT && callback,
60 MessageMemoryStrategyT::create_default()
67 auto factory = rclcpp::create_subscription_factory<MessageT>(
68 std::forward<CallbackT>(callback),
73 auto sub = node_topics->create_subscription(topic_name, factory, qos);
74 node_topics->add_subscription(sub, options.callback_group);
81 #endif // RCLCPP__CREATE_SUBSCRIPTION_HPP_ Default allocation strategy for messages received by subscriptions.
Definition: message_memory_strategy.hpp:40
Encapsulation of Quality of Service settings.
Definition: qos.hpp:55
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
Subscription implementation, templated on the type of message this subscription receives.
Definition: subscription.hpp:67
T dynamic_pointer_cast(T... args)
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
Set the data type used in the intra-process buffer as std::shared_ptr<MessageT>
std::shared_ptr< SubscriptionT > create_subscription(NodeT &&node, const std::string &topic_name, const rclcpp::QoS &qos, CallbackT &&callback, const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options=(rclcpp::SubscriptionOptionsWithAllocator< AllocatorT >()), typename MessageMemoryStrategyT::SharedPtr msg_mem_strat=(MessageMemoryStrategyT::create_default()))
Create and return a subscription of the given MessageT type.
Definition: create_subscription.hpp:51