Removed create_subscription_internal
This commit is contained in:
parent
b0a2b7610d
commit
07746c6834
2 changed files with 28 additions and 58 deletions
|
@ -114,31 +114,6 @@ public:
|
||||||
create_publisher(
|
create_publisher(
|
||||||
const std::string & topic_name, const rmw_qos_profile_t & qos_profile);
|
const std::string & topic_name, const rmw_qos_profile_t & qos_profile);
|
||||||
|
|
||||||
/// Create and return a Subscription.
|
|
||||||
/**
|
|
||||||
* \param[in] topic_name The topic to subscribe on.
|
|
||||||
* \param[in] qos_history_depth The depth of the subscription's incoming message queue.
|
|
||||||
* \param[in] callback The user-defined callback function.
|
|
||||||
* \param[in] group The callback group for this subscription. NULL for no callback group.
|
|
||||||
* \param[in] ignore_local_publications True to ignore local publications.
|
|
||||||
* \param[in] msg_mem_strat The message memory strategy to use for allocating messages.
|
|
||||||
* \return Shared pointer to the created subscription.
|
|
||||||
*/
|
|
||||||
/* TODO(jacquelinekay):
|
|
||||||
Windows build breaks when static member function passed as default
|
|
||||||
argument to msg_mem_strat, nullptr is a workaround.
|
|
||||||
*/
|
|
||||||
template<typename MessageT, typename CallbackT>
|
|
||||||
typename rclcpp::subscription::Subscription<MessageT>::SharedPtr
|
|
||||||
create_subscription(
|
|
||||||
const std::string & topic_name,
|
|
||||||
size_t qos_history_depth,
|
|
||||||
CallbackT callback,
|
|
||||||
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr,
|
|
||||||
bool ignore_local_publications = false,
|
|
||||||
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
|
||||||
msg_mem_strat = nullptr);
|
|
||||||
|
|
||||||
/// Create and return a Subscription.
|
/// Create and return a Subscription.
|
||||||
/**
|
/**
|
||||||
* \param[in] topic_name The topic to subscribe on.
|
* \param[in] topic_name The topic to subscribe on.
|
||||||
|
@ -164,6 +139,31 @@ public:
|
||||||
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
||||||
msg_mem_strat = nullptr);
|
msg_mem_strat = nullptr);
|
||||||
|
|
||||||
|
/// Create and return a Subscription.
|
||||||
|
/**
|
||||||
|
* \param[in] topic_name The topic to subscribe on.
|
||||||
|
* \param[in] qos_history_depth The depth of the subscription's incoming message queue.
|
||||||
|
* \param[in] callback The user-defined callback function.
|
||||||
|
* \param[in] group The callback group for this subscription. NULL for no callback group.
|
||||||
|
* \param[in] ignore_local_publications True to ignore local publications.
|
||||||
|
* \param[in] msg_mem_strat The message memory strategy to use for allocating messages.
|
||||||
|
* \return Shared pointer to the created subscription.
|
||||||
|
*/
|
||||||
|
/* TODO(jacquelinekay):
|
||||||
|
Windows build breaks when static member function passed as default
|
||||||
|
argument to msg_mem_strat, nullptr is a workaround.
|
||||||
|
*/
|
||||||
|
template<typename MessageT, typename CallbackT>
|
||||||
|
typename rclcpp::subscription::Subscription<MessageT>::SharedPtr
|
||||||
|
create_subscription(
|
||||||
|
const std::string & topic_name,
|
||||||
|
size_t qos_history_depth,
|
||||||
|
CallbackT callback,
|
||||||
|
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr,
|
||||||
|
bool ignore_local_publications = false,
|
||||||
|
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
||||||
|
msg_mem_strat = nullptr);
|
||||||
|
|
||||||
/// Create a timer.
|
/// Create a timer.
|
||||||
/**
|
/**
|
||||||
* \param[in] period Time interval between triggers of the callback.
|
* \param[in] period Time interval between triggers of the callback.
|
||||||
|
@ -262,16 +262,6 @@ private:
|
||||||
|
|
||||||
publisher::Publisher<rcl_interfaces::msg::ParameterEvent>::SharedPtr events_publisher_;
|
publisher::Publisher<rcl_interfaces::msg::ParameterEvent>::SharedPtr events_publisher_;
|
||||||
|
|
||||||
template<typename MessageT>
|
|
||||||
typename subscription::Subscription<MessageT>::SharedPtr
|
|
||||||
create_subscription_internal(
|
|
||||||
const std::string & topic_name,
|
|
||||||
const rmw_qos_profile_t & qos_profile,
|
|
||||||
rclcpp::subscription::AnySubscriptionCallback<MessageT> callback,
|
|
||||||
rclcpp::callback_group::CallbackGroup::SharedPtr group,
|
|
||||||
bool ignore_local_publications,
|
|
||||||
typename message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr msg_mem_strat);
|
|
||||||
|
|
||||||
template<
|
template<
|
||||||
typename ServiceT,
|
typename ServiceT,
|
||||||
typename FunctorT,
|
typename FunctorT,
|
||||||
|
|
|
@ -216,14 +216,12 @@ Node::create_subscription(
|
||||||
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
typename rclcpp::message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr
|
||||||
msg_mem_strat)
|
msg_mem_strat)
|
||||||
{
|
{
|
||||||
rclcpp::subscription::AnySubscriptionCallback<MessageT> any_subscription_callback;
|
|
||||||
any_subscription_callback.set(callback);
|
|
||||||
rmw_qos_profile_t qos = rmw_qos_profile_default;
|
rmw_qos_profile_t qos = rmw_qos_profile_default;
|
||||||
qos.depth = qos_history_depth;
|
qos.depth = qos_history_depth;
|
||||||
return this->create_subscription_internal(
|
return this->create_subscription(
|
||||||
topic_name,
|
topic_name,
|
||||||
qos,
|
qos,
|
||||||
any_subscription_callback,
|
callback,
|
||||||
group,
|
group,
|
||||||
ignore_local_publications,
|
ignore_local_publications,
|
||||||
msg_mem_strat);
|
msg_mem_strat);
|
||||||
|
@ -242,25 +240,7 @@ Node::create_subscription(
|
||||||
{
|
{
|
||||||
rclcpp::subscription::AnySubscriptionCallback<MessageT> any_subscription_callback;
|
rclcpp::subscription::AnySubscriptionCallback<MessageT> any_subscription_callback;
|
||||||
any_subscription_callback.set(callback);
|
any_subscription_callback.set(callback);
|
||||||
return this->create_subscription_internal(
|
|
||||||
topic_name,
|
|
||||||
qos_profile,
|
|
||||||
any_subscription_callback,
|
|
||||||
group,
|
|
||||||
ignore_local_publications,
|
|
||||||
msg_mem_strat);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename MessageT>
|
|
||||||
typename subscription::Subscription<MessageT>::SharedPtr
|
|
||||||
Node::create_subscription_internal(
|
|
||||||
const std::string & topic_name,
|
|
||||||
const rmw_qos_profile_t & qos_profile,
|
|
||||||
rclcpp::subscription::AnySubscriptionCallback<MessageT> callback,
|
|
||||||
rclcpp::callback_group::CallbackGroup::SharedPtr group,
|
|
||||||
bool ignore_local_publications,
|
|
||||||
typename message_memory_strategy::MessageMemoryStrategy<MessageT>::SharedPtr msg_mem_strat)
|
|
||||||
{
|
|
||||||
using rosidl_generator_cpp::get_message_type_support_handle;
|
using rosidl_generator_cpp::get_message_type_support_handle;
|
||||||
|
|
||||||
if (!msg_mem_strat) {
|
if (!msg_mem_strat) {
|
||||||
|
@ -286,7 +266,7 @@ Node::create_subscription_internal(
|
||||||
subscriber_handle,
|
subscriber_handle,
|
||||||
topic_name,
|
topic_name,
|
||||||
ignore_local_publications,
|
ignore_local_publications,
|
||||||
callback,
|
any_subscription_callback,
|
||||||
msg_mem_strat);
|
msg_mem_strat);
|
||||||
auto sub_base_ptr = std::dynamic_pointer_cast<SubscriptionBase>(sub);
|
auto sub_base_ptr = std::dynamic_pointer_cast<SubscriptionBase>(sub);
|
||||||
// Setup intra process.
|
// Setup intra process.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue