[rostopic] Show stat when rostopic echo --noarr/nostr#724
[rostopic] Show stat when rostopic echo --noarr/nostr#724wkentaro wants to merge 7 commits intoros:indigo-develfrom
Conversation
b30b6e0 to
5037d5b
Compare
There was a problem hiding this comment.
This might be easier to read like this:
value_untransform_fn = None
if value_transform:
val, value_untransform_fn = value_transform(val)
text = genpy.message.strify_message(val, indent=indent, time_offset=time_offset, current_time=current_time, field_filter=field_filter, fixed_numeric_width=fixed_numeric_width)
if value_untransform_fn is not None:
# this operation is necessary because value_transform does change the type of message
# and that causes not strified values next time
val = value_untransform_fn(val)There was a problem hiding this comment.
Thanks, I updated the commit.
|
Looks reasonable to me. |
5037d5b to
a59ac5a
Compare
|
Thanks for the feedback, I updated the commit. |
| offset_time=False, count=None, | ||
| field_filter_fn=None, fixed_numeric_width=None): | ||
| field_filter_fn=None, value_transform_fn=None, | ||
| fixed_numeric_width=None): |
There was a problem hiding this comment.
Please do not change the order of existing arguments but add new arguments at the end.
Same below.
|
I have updated |
|
Some of the unit tests are currently failing. Please see the referenced Jenkins builds. |
dc650c3 to
9b7b996
Compare
| :param count: number of messages to echo, ``None`` for infinite, ``int`` | ||
| :param field_filter_fn: filter the fields that are strified for Messages, ``fn(Message)->iter(str)`` | ||
| :param field_filter_fn: filter the fields that are stringified for Messages, ``fn(Message)->iter(str)`` | ||
| :param value_transform_fn: transform the values of Messages, ``fn(Message)->Message`` |
There was a problem hiding this comment.
thanks, I have fixed.
da1963f to
afbb4b1
Compare
| return val, untransform_fn | ||
| return value_transform | ||
|
|
||
| def create_field_filter(echo_nostr, echo_noarr): |
There was a problem hiding this comment.
I am not sure if this function is used anywhere outside by now it doesn't filter anything anymore.
afbb4b1 to
b57a5bb
Compare
|
Removed the field_filter function. |
|
Since you have removed all unit tests for |
|
I'm not planning to readd them, because filtering field it not supported after this PR. |
|
Is this solution OK? I removed the |
|
|
b57a5bb to
1da29f8
Compare
|
@dirk-thomas And also, I found a bug of this code with nested messages as below. AFTER |
|
@ros-pull-request-builder rostest this please |
|
Test passed. Please review again when you have time. |
|
The patch looks good. But I was thinking if the effort for transforming and then untransforming the message is necessary. Wouldn't it be easier to just copy the message and update the copied message? For efficiency you could also implement a custom copy operation which already avoids to copy the string / array fields in the first place? |
Thanks for the suggestion. I worked around for a while, and the problem when the transformed message was untransformed will be fixed by correct |
1a62372 to
19fb710
Compare
|
ping |
1 similar comment
|
ping |
|
I am sorry for the late response but I currently have to focus on a different project and don't have much time to review ROS tickets. The patch looks good now. Thank you for iterating on it. I cherry-picked the changed to the kinetic-devel branch with two small cosmetic changes: e0f6397 |
|
Thanks! |
Should this be another option like
--statarr?Because this kind of function is not needed for string for me but for only array field.