Merge pull request #125 from ros2/create_publisher_with_queue_size
add create_publisher signature which takes just a queue size
This commit is contained in:
commit
c78ff7f422
2 changed files with 21 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue