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

add ros2 param describe #367

Merged
merged 2 commits into from
Oct 17, 2019
Merged

Conversation

dirk-thomas
Copy link
Member

Fixes #362.

I chose to use the parameter name as the item without indentation and all other keys are then indented one level. That works nicely for multiple parameters and doesn't use extra empty lines. See example output:

$ ros2 param describe turtlesim background_r background_g
Parameter name: background_r
  Type: integer
  Description: Red channel of the background color
  Constraints:
    Min value: 0
    Max value: 255
Parameter name: background_g
  Type: integer
  Description: Green channel of the background color
  Constraints:
    Min value: 0
    Max value: 255
    Additional constraints: foo

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas dirk-thomas added enhancement New feature or request in review Waiting for review (Kanban column) labels Oct 17, 2019
@dirk-thomas dirk-thomas self-assigned this Oct 17, 2019
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.

LGTM once the flake8 blank line is clear.

ros2param/ros2param/verb/describe.py Outdated Show resolved Hide resolved
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM. Since we can know the list of parameters, I think it would make for a nice feature if no parameter names are provided, then we describe all of them.

@dirk-thomas
Copy link
Member Author

Since we can know the list of parameters, I think it would make for a nice feature if no parameter names are provided, then we describe all of them.

We could query the list with an additional service call. Unfortunately the DescribeParameter service doesn't offer a way to query all parameters without specifying them.

@dirk-thomas
Copy link
Member Author

Sanity linter check:

  • Linux Build Status

@dirk-thomas dirk-thomas merged commit 780923c into master Oct 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the dirk-thomas/ros2-param-describe branch October 17, 2019 20:31
@jacobperron
Copy link
Member

jacobperron commented Oct 17, 2019

We could query the list with an additional service call. Unfortunately the DescribeParameter service doesn't offer a way to query all parameters without specifying them.

But I guess the tool knows about them from an additional service call since auto-completion is working?

@dirk-thomas
Copy link
Member Author

But I guess the tool knows about them from an additional service call since auto-completion is working?

Not sure I understand but currently we don't call the list service. While it is being invoked during completion it is not run during the actual command.

As I said: it can certainly be added (with the extra call time). Feel free to do so in a new PR.

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.

[ros2param] Add verb to describe parameters
3 participants