-
Notifications
You must be signed in to change notification settings - Fork 157
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
ros2node info: add action category #345
Conversation
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Yup, sorry I didn't really explain that part in the initial issue. All the results with The output should be like this comment. Also, did nothing come up under |
I would propose adding ros2cli/ros2topic/ros2topic/verb/list.py Line 33 in 3c30b34
|
I believe because this is the Fibonacci example, there wouldn't be any subscribers, maybe turtlesim would be more representative now that an action has been included. |
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.
This is definitely an improvement 👍
I think it would be even better if instead of a single list of actions, we made two lists for action clients and action servers, e.g.
Subscribers:
Publishers:
/fibonacci/_action/feedback: action_tutorials_interfaces/action/Fibonacci_FeedbackMessage
/fibonacci/_action/status: action_msgs/msg/GoalStatusArray
/parameter_events: rcl_interfaces/msg/ParameterEvent
/rosout: rcl_interfaces/msg/Log
Services:
/fibonacci/_action/cancel_goal: action_msgs/srv/CancelGoal
/fibonacci/_action/get_result: action_tutorials_interfaces/action/Fibonacci_GetResult
/fibonacci/_action/send_goal: action_tutorials_interfaces/action/Fibonacci_SendGoal
/fibonacci_action_server/describe_parameters: rcl_interfaces/srv/DescribeParameters
/fibonacci_action_server/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
/fibonacci_action_server/get_parameters: rcl_interfaces/srv/GetParameters
/fibonacci_action_server/list_parameters: rcl_interfaces/srv/ListParameters
/fibonacci_action_server/set_parameters: rcl_interfaces/srv/SetParameters
/fibonacci_action_server/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
Actions clients:
Action servers:
/fibonacci: action_tutorials_interfaces/action/Fibonacci
It should be possible with the action graph functions: get_action_client_names_and_types_by_node
and get_action_server_names_and_types_by_node
.
The same could be done for services, i.e. splitting it into two lists for distinguishing clients from servers (but I would worry about services in a separate PR).
I think that hiding the hidden services and topics related to actions can be addressed in a follow-up PR (or this one if you like), since it's kind of a separate issue. |
I'll split up the action into client and server, then make another PR hiding the hidden services and splitting service into client and server. |
Signed-off-by: claireyywang <clairewang@openrobotics.org>
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.
Some nitpicks about indentation, otherwise LGTM with green CI
ros2node/ros2node/api/__init__.py
Outdated
def get_action_server_info(*, node, remote_node_name): | ||
remote_node = parse_node_name(remote_node_name) | ||
names_and_types = get_action_server_names_and_types_by_node( | ||
node, remote_node.name, remote_node.namespace) |
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.
nitpick: Though PEP 8 states that 4-space indentation is optional for continuation lines, I think it is preferred when possible (e.g. when it doesn't lead to visual ambiguity). I think it would also look more consistent with our Python code elsewhere if this were indented 4 spaces.
Same for other instances below.
ros2node/ros2node/api/__init__.py
Outdated
def get_action_client_info(*, node, remote_node_name): | ||
remote_node = parse_node_name(remote_node_name) | ||
names_and_types = get_action_client_names_and_types_by_node( | ||
node, remote_node.name, remote_node.namespace) |
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: use 4-space indentation
ros2node/ros2node/verb/info.py
Outdated
@@ -52,5 +54,13 @@ def main(self, *, args): | |||
services = get_service_info(node=node, remote_node_name=args.node_name) | |||
print(' Services:') | |||
print_names_and_types(services) | |||
actions_servers = get_action_server_info( | |||
node=node, remote_node_name=args.node_name) |
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: use 4-space indentation
ros2node/ros2node/verb/info.py
Outdated
print(' Actions Servers:') | ||
print_names_and_types(actions_servers) | ||
actions_clients = get_action_client_info( | ||
node=node, remote_node_name=args.node_name) |
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: use 4-space indentation
Signed-off-by: claireyywang <clairewang@openrobotics.org>
Signed-off-by: claireyywang clairewang@openrobotics.org
Resolves #344
Adds separate action category to
ros2 node info
. Output looks likeShould I also modify
Services
category? It seems to include more than what's mentioned in #344