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

Fix printing of integer and double arrays. #804

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

clalancette
Copy link
Contributor

In the ros2param code, we get integer and double arrays as literal Python arrays. When printing that out in ros2 param get, they look something like:

Double values are: array('d', [1.4, 1.5])

But that isn't really what we want the user to see. So call .tolist() on these before we print, so it looks like:

Double values are: [1.4, 1.5]

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

In the ros2param code, we get integer and double arrays as
literal Python arrays.  When printing that out in ros2 param get,
they look something like:

Double values are: array('d', [1.4, 1.5])

But that isn't really what we want the user to see.  So call .tolist()
on these before we print, so it looks like:

Double values are: [1.4, 1.5]

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

CI:

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

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

lgtm

ros2param/ros2param/verb/set.py Show resolved Hide resolved
@clalancette clalancette merged commit cd85c14 into rolling Feb 13, 2023
@delete-merged-branch delete-merged-branch bot deleted the clalancette/fix-array-printing branch February 13, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants