-
Notifications
You must be signed in to change notification settings - Fork 170
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
support multiple fields in ros2topic echo #964
support multiple fields in ros2topic echo #964
Conversation
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.
the implementation looks good to me.
@sangteak601 can you add the multiple fields test aligned with
ros2cli/ros2topic/test/test_cli.py
Lines 579 to 617 in f3fc36c
@launch_testing.markers.retry_on_failure(times=5, delay=1) | |
def test_topic_echo_field(self): | |
with self.launch_topic_command( | |
arguments=['echo', '/arrays', '--field', 'alignment_check'], | |
) as topic_command: | |
assert topic_command.wait_for_output(functools.partial( | |
launch_testing.tools.expect_output, expected_lines=[ | |
'0', | |
'---', | |
], strict=True | |
), timeout=10) | |
assert topic_command.wait_for_shutdown(timeout=10) | |
@launch_testing.markers.retry_on_failure(times=5, delay=1) | |
def test_topic_echo_field_nested(self): | |
with self.launch_topic_command( | |
arguments=['echo', '/cmd_vel', '--field', 'twist.angular'], | |
) as topic_command: | |
assert topic_command.wait_for_output(functools.partial( | |
launch_testing.tools.expect_output, expected_lines=[ | |
'x: 0.0', | |
'y: 0.0', | |
'z: 0.0', | |
'---', | |
], strict=True | |
), timeout=10) | |
assert topic_command.wait_for_shutdown(timeout=10) | |
@launch_testing.markers.retry_on_failure(times=5, delay=1) | |
def test_topic_echo_field_not_a_member(self): | |
with self.launch_topic_command( | |
arguments=['echo', '/arrays', '--field', 'not_member'], | |
) as topic_command: | |
assert topic_command.wait_for_output(functools.partial( | |
launch_testing.tools.expect_output, expected_lines=[ | |
"Invalid field 'not_member': 'Arrays' object has no attribute 'not_member'", | |
], strict=True | |
), timeout=10) | |
assert topic_command.wait_for_shutdown(timeout=10) |
@sangteak601, you need to add the test files in test_cli.py for the tests to pass. Once you add them, it should work. I faced the same issue, but it got fixed after doing this." |
Signed-off-by: Sangtaek Lee <[email protected]> Signed-off-by: Sangtaek Lee <[email protected]>
Signed-off-by: Sangtaek Lee <[email protected]>
Signed-off-by: Sangtaek Lee <[email protected]>
366cbe2
to
17cb712
Compare
Signed-off-by: Sangtaek Lee <[email protected]>
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.
lgtm with green CI.
Pulls: #964 |
@sangteak601 thank you very much for your contribution, PR has been merged 👍 |
Added support for multiple fields in
ros2 topic echo
. Fixes #951