add create_publisher signature which takes just a queue size

This commit is contained in:
William Woodall 2015-10-14 11:19:47 -07:00
parent 36e0dcd8ba
commit b3a88a9974
2 changed files with 21 additions and 0 deletions

View file

@ -92,6 +92,17 @@ public:
rclcpp::callback_group::CallbackGroup::SharedPtr
create_callback_group(rclcpp::callback_group::CallbackGroupType group_type);
/// Create and return a Publisher.
/**
* \param[in] topic_name The topic for this publisher to publish on.
* \param[in] qos_history_depth The depth of the publisher message queue.
* \return Shared pointer to the created publisher.
*/
template<typename MessageT>
typename rclcpp::publisher::Publisher<MessageT>::SharedPtr
create_publisher(
const std::string & topic_name, size_t qos_history_depth);
/// Create and return a Publisher.
/**
* \param[in] topic_name The topic for this publisher to publish on.

View file

@ -113,6 +113,16 @@ Node::create_callback_group(
return group;
}
template<typename MessageT>
typename rclcpp::publisher::Publisher<MessageT>::SharedPtr
Node::create_publisher(
const std::string & topic_name, size_t qos_history_depth)
{
rmw_qos_profile_t qos = rmw_qos_profile_default;
qos.depth = qos_history_depth;
return this->create_publisher<MessageT>(topic_name, qos);
}
template<typename MessageT>
typename publisher::Publisher<MessageT>::SharedPtr
Node::create_publisher(