-
Notifications
You must be signed in to change notification settings - Fork 465
add : get clients, servers info #2569
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
base: rolling
Are you sure you want to change the base?
Conversation
Dependencies |
rclcpp/include/rclcpp/node.hpp
Outdated
* \throws std::runtime_error if internal error happens. | ||
*/ | ||
RCLCPP_PUBLIC | ||
std::vector<rclcpp::TopicEndpointInfo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost same comment for rclpy.
probably we can extend EndpointType
with service server and client as endpoint types.
and introduce new base class EndpointInfo
, and based on that we could have TopicEndpointInfo
and ServiceEndpointInfo
classes here?
FunctionT rcl_get_info_by_topic) | ||
bool is_service, | ||
FunctionT rcl_get_info_by_topic_or_service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extend this function to support endpoint based on EndpointTypes
with topics, services (and actions in the future?) there is already the template based on EndpointTypes
so extend EndpointTypes
with service types makes this function more generic like get_info_by_endpoint
?
rclcpp/test/rclcpp/test_node.cpp
Outdated
EXPECT_TRUE(node->get_clients_info_by_service(fq_service_name).empty()); | ||
EXPECT_TRUE(node->get_servers_info_by_service(fq_service_name).empty()); | ||
|
||
// Add a publisher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
// Add a publisher | |
// Add a client |
rclcpp/test/rclcpp/test_node.cpp
Outdated
auto client = node->create_client<test_msgs::srv::Empty>(service_name, qos); | ||
// Wait for the underlying RMW implementation to catch up with graph changes | ||
auto client_is_generated = | ||
[&]() {return node->get_clients_info_by_service(fq_service_name).size() > 0u;}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[&]() {return node->get_clients_info_by_service(fq_service_name).size() > 0u;}; | |
[&]() {return node->get_clients_info_by_service(fq_service_name).size() == 1u;}; |
rclcpp/test/rclcpp/test_node.cpp
Outdated
} | ||
} | ||
|
||
// Add a subscription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
// Add a subscription | |
// Add a service server |
rclcpp/test/rclcpp/test_node.cpp
Outdated
auto server = node->create_service<test_msgs::srv::Empty>(service_name, callback, qos2); | ||
// Wait for the underlying RMW implementation to catch up with graph changes | ||
auto server_is_generated = | ||
[&]() {return node->get_servers_info_by_service(fq_service_name).size() > 0u;}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precisely this should be 1, right? is there any possibility that goes over 1?
[&]() {return node->get_servers_info_by_service(fq_service_name).size() > 0u;}; | |
[&]() {return node->get_servers_info_by_service(fq_service_name).size() == 1u;}; |
Signed-off-by: Minju, Lee <[email protected]>
da404d2
to
680cf79
Compare
Signed-off-by: Minju, Lee <[email protected]>
Pulls: ros2/rmw#371, ros2/rmw_implementation#238, ros2/rcl#1161, #2569, ros2/rclpy#1307, ros2/rmw_zenoh#679, ros2/rmw_fastrtps#771, ros2/rmw_cyclonedds#499, ros2/rmw_connextdds#154, ros2/ros2cli#916 |
Add get clients, servers info
Refer to ros2/ros2cli#916