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

[ros2node] Add option to info verb to display hidden names #373

Merged
merged 3 commits into from
Oct 21, 2019

Conversation

jacobperron
Copy link
Member

Changes behavior so that hidden names are not shown by default.

Before this change, if we ran turtlesim and retrieved the node info we'd see hidden topics and services related to the action server, e.g.

$ ros2 run turtlesim turtlesim_node
$ ros2 node info /turtlesim
/turtlesim
  Subscribers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /turtle1/cmd_vel: geometry_msgs/msg/Twist
  Publishers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /rosout: rcl_interfaces/msg/Log
    /turtle1/color_sensor: turtlesim/msg/Color
    /turtle1/pose: turtlesim/msg/Pose
    /turtle1/rotate_absolute/_action/feedback: turtlesim/action/RotateAbsolute_FeedbackMessage
    /turtle1/rotate_absolute/_action/status: action_msgs/msg/GoalStatusArray
  Services:
    /clear: std_srvs/srv/Empty
    /kill: turtlesim/srv/Kill
    /reset: std_srvs/srv/Empty
    /spawn: turtlesim/srv/Spawn
    /turtle1/rotate_absolute/_action/cancel_goal: action_msgs/srv/CancelGoal
    /turtle1/rotate_absolute/_action/get_result: turtlesim/action/RotateAbsolute_GetResult
    /turtle1/rotate_absolute/_action/send_goal: turtlesim/action/RotateAbsolute_SendGoal
    /turtle1/set_pen: turtlesim/srv/SetPen
    /turtle1/teleport_absolute: turtlesim/srv/TeleportAbsolute
    /turtle1/teleport_relative: turtlesim/srv/TeleportRelative
    /turtlesim/describe_parameters: rcl_interfaces/srv/DescribeParameters
    /turtlesim/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
    /turtlesim/get_parameters: rcl_interfaces/srv/GetParameters
    /turtlesim/list_parameters: rcl_interfaces/srv/ListParameters
    /turtlesim/set_parameters: rcl_interfaces/srv/SetParameters
    /turtlesim/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
  Action Servers:
    /turtle1/rotate_absolute: turtlesim/action/RotateAbsolute
  Action Clients:

Now, we can get the same output if we add the --include-hidden option, but by default we don't see the hidden entities like /turtle1/rotate_absoulte/_action/cancel_goal:

/turtlesim
  Subscribers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /turtle1/cmd_vel: geometry_msgs/msg/Twist
  Publishers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /rosout: rcl_interfaces/msg/Log
    /turtle1/color_sensor: turtlesim/msg/Color
    /turtle1/pose: turtlesim/msg/Pose
  Services:
    /clear: std_srvs/srv/Empty
    /kill: turtlesim/srv/Kill
    /reset: std_srvs/srv/Empty
    /spawn: turtlesim/srv/Spawn
    /turtle1/set_pen: turtlesim/srv/SetPen
    /turtle1/teleport_absolute: turtlesim/srv/TeleportAbsolute
    /turtle1/teleport_relative: turtlesim/srv/TeleportRelative
    /turtlesim/describe_parameters: rcl_interfaces/srv/DescribeParameters
    /turtlesim/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
    /turtlesim/get_parameters: rcl_interfaces/srv/GetParameters
    /turtlesim/list_parameters: rcl_interfaces/srv/ListParameters
    /turtlesim/set_parameters: rcl_interfaces/srv/SetParameters
    /turtlesim/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
  Action Servers:
    /turtle1/rotate_absolute: turtlesim/action/RotateAbsolute
  Action Clients:

Changes behavior so that hidden names are not shown by default.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron added the enhancement New feature or request label Oct 21, 2019
ros2node/ros2node/api/__init__.py Outdated Show resolved Hide resolved
ros2node/ros2node/api/__init__.py Outdated Show resolved Hide resolved
* Remove check for empty topic
* Pass keyword arg by name

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Which it uses for identifier component containers.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron jacobperron added the in review Waiting for review (Kanban column) label Oct 21, 2019
@@ -38,28 +38,34 @@ def add_arguments(self, parser, cli_name):
'node_name',
help='Node name to request information')
argument.completer = NodeNameCompleter()
parser.add_argument(
'--include-hidden', action='store_true',
help='Display hidden topics, services, and actions as well')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a user wants to see hidden nodes but not hidden topics / services / actions - or the other way around? Just a thought...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume you mean them wanting to see hidden topics, but not hidden services / actions (or some combination). I thought about it, but I figured it's a rare case to want to see any of the hidden names, let alone a subset.

Copy link
Member

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner output. LGTM thanks!

@jacobperron jacobperron merged commit c41da46 into master Oct 21, 2019
@delete-merged-branch delete-merged-branch bot deleted the jacob/node_info_hidden branch October 21, 2019 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants