-
Notifications
You must be signed in to change notification settings - Fork 425
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
add : get clients, servers info #2569
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Minju, Lee <[email protected]>
Dependencies |
* \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
?
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 |
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;}; |
} | ||
} | ||
|
||
// 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 |
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;}; |
Add get clients, servers info
Refer to ros2/ros2cli#916