Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub functions to get publisher and subcription informations like QoS policies from topic name #959

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions rclcpp/include/rclcpp/node_interfaces/node_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ class NodeGraph : public NodeGraphInterface
size_t
count_subscribers(const std::string & topic_name) const override;

RCLCPP_PUBLIC
std::vector<rmw_topic_endpoint_info_t>
get_publishers_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const override;

RCLCPP_PUBLIC
std::vector<rmw_topic_endpoint_info_t>
get_subscriptions_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const override;

RCLCPP_PUBLIC

const rcl_guard_condition_t *
Expand Down
17 changes: 17 additions & 0 deletions rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vector>

#include "rcl/guard_condition.h"
#include "rmw/topic_endpoint_info.h"

#include "rclcpp/event.hpp"
#include "rclcpp/macros.hpp"
Expand Down Expand Up @@ -89,6 +90,22 @@ class NodeGraphInterface
size_t
count_subscribers(const std::string & topic_name) const = 0;

/// Return a vector of publisher infos publishing to a given topic.
RCLCPP_PUBLIC
virtual
std::vector<rmw_topic_endpoint_info_t>
get_publishers_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const = 0;

/// Return a vector of subscription infos publishing to a given topic.
RCLCPP_PUBLIC
virtual
std::vector<rmw_topic_endpoint_info_t>
get_subscriptions_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const = 0;

/// Return the rcl guard condition which is triggered when the ROS graph changes.
RCLCPP_PUBLIC
virtual
Expand Down
16 changes: 16 additions & 0 deletions rclcpp/src/rclcpp/node_interfaces/node_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,22 @@ NodeGraph::count_subscribers(const std::string & topic_name) const
return count;
}

std::vector<rmw_topic_endpoint_info_t>
NodeGraph::get_publishers_info_by_topic(
const std::string & /*topic_name*/,
bool /*no_demangle*/) const
{
return std::vector<rmw_topic_endpoint_info_t>();
}

std::vector<rmw_topic_endpoint_info_t>
NodeGraph::get_subscriptions_info_by_topic(
const std::string & /*topic_name*/,
bool /*no_demangle*/) const
{
return std::vector<rmw_topic_endpoint_info_t>();
}

const rcl_guard_condition_t *
NodeGraph::get_graph_guard_condition() const
{
Expand Down