Template Function rclcpp::create_subscription_factory

Function Documentation

template<typename MessageT, typename CallbackT, typename AllocatorT, typename SubscriptionT = rclcpp::Subscription<MessageT, AllocatorT>, typename MessageMemoryStrategyT = typename SubscriptionT::MessageMemoryStrategyType, typename ROSMessageType = typename SubscriptionT::ROSMessageType>
SubscriptionFactory rclcpp::create_subscription_factory(CallbackT &&callback, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT> &options, typename MessageMemoryStrategyT::SharedPtr msg_mem_strat, std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics<ROSMessageType>> subscription_topic_stats = nullptr)

Return a SubscriptionFactory setup to create a SubscriptionT<MessageT, AllocatorT>.

Parameters:
  • callback[in] The user-defined callback function to receive a message

  • options[in] Additional options for the creation of the Subscription.

  • msg_mem_strat[in] The message memory strategy to use for allocating messages.

  • subscription_topic_stats[in] Optional stats callback for topic_statistics