-
Notifications
You must be signed in to change notification settings - Fork 258
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
keyboard controls for pause/resume toggle and play-next: #847
Conversation
fdbfddd
to
07bf455
Compare
High level - I'm inclined to not have the keys be configurable via CLI options. Simplifies this code a bit - if we want to have some remapping later, maybe we do it via Node parameters for the Player Node. if anything is configurable, maybe it's enable/disable keyboard handler. Thoughts? |
c0c0f6b
to
c73888f
Compare
Ok. I'll take that out and add disable to the cli |
95dd236
to
fee38a6
Compare
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.
I would prefer to hard code key codes for play_next
and pause
operations rather than providing them via player options. We have to many options and this key bindings pretty much trivial just need to agree upon on them.
Also have some concern about using time measurements in unit tests for validation.
It's used to lead to the flakiness on CI.
Also need to properly handle case when we registered callbacks and Player got destroyed but KeyboardHandler
still active.
Pointer to this
will become dangling pointer. Please refer to the KeybordHandler design document for reference.
fee38a6
to
918ffd3
Compare
918ffd3
to
d0c73e4
Compare
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
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.
@lihui815 thank you for taking actions and fixing previous comments/requests.
However I would like to request more changes.
Generic comment:
- Don't need to use base class
KeyboardHandlerBase
to refer to the key codes and basic functionality defined in it.
Please useKeyboardHandler
alias directly instead.
e48fac3
to
fa67c87
Compare
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.
Only tiny nitpicks
rosbag2_transport/test/rosbag2_transport/mock_keyboard_handler.hpp
Outdated
Show resolved
Hide resolved
fa67c87
to
8a42ac5
Compare
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.
@lihui815 Implementation looks good to me.
However I would encourage you to make some "nitpick" changes in unit tests.
rosbag2_transport/test/rosbag2_transport/test_keyboard_controls.cpp
Outdated
Show resolved
Hide resolved
rosbag2_transport/test/rosbag2_transport/test_keyboard_controls.cpp
Outdated
Show resolved
Hide resolved
ac3c0c6
to
14f5ea5
Compare
Signed-off-by: Sonia Jin <[email protected]>
14f5ea5
to
e1dbf82
Compare
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.
Looks good to me with green CI.
Signed-off-by: Emerson Knapp <[email protected]>
Signed-off-by: Emerson Knapp <[email protected]>
4ddc8de
to
979cd20
Compare
NOTE: still can't merge this until ros2/ros2#1184 is merged |
Closes #55
Depends on ros2/ros2#1184
adds keyboard controls for
ros2 bag play
action-ros-ci-repos-supplemental: https://gist.githubusercontent.com/lihui815/5edccb5d36176ccc6a779fd8a26122db/raw/5b9ce9db3628fddce2329118bbf2b6ab6a9ce2a3/kh.repos