-
Notifications
You must be signed in to change notification settings - Fork 914
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
[rostopic] Fix rostopic echo for non rosmsg field #909
Conversation
If you run
Therefore I would expect
but it actually prints:
|
@@ -1389,6 +1389,12 @@ def eval_fn(m): | |||
|
|||
def create_value_transform(echo_nostr, echo_noarr): | |||
def value_transform(val): | |||
if not isinstance(val, genpy.Message): | |||
if echo_nostr and isinstance(val, str): | |||
return None |
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.
What about this instead:
return '<string length: %s>' % len(val)
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.
Nice.
if echo_nostr and isinstance(val, str): | ||
return None | ||
elif echo_noarr and isinstance(val, list): | ||
return None |
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.
Here I don't see how we could print the type information (<array type: ??? ...>
):
return '<array length: %s>' % len(val)
With 47adb6d,
|
With 9dd94cf, Before
After
|
The current patch duplicates a lot of code / logic. I would recommend to create a function like this:
and call it from the two locations accordingly. |
This looks good to me. Thank you for providing this patch so fast. |
Thanks for the quick turnaround, all. |
Close #908