-
Notifications
You must be signed in to change notification settings - Fork 288
Add option to disable recorder keyboard controls #1607
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
Add option to disable recorder keyboard controls #1607
Conversation
3230d8b to
7b8f375
Compare
|
Hi @berndpfrommer I am the author of the KeyboardHandler package.
It messes up your terminal because we instantiate rosbag2/rosbag2_transport/src/rosbag2_transport/recorder.cpp Lines 748 to 753 in 1bb7a0e
However, in the cases when rosbag2 recorder or player instantiating via composition signals are not handled by the rosbag2 anymore. Therefore need to instantiate the KeyboardHandler class in those cases with See description for KeyboardHandler constructor here
|
Signed-off-by: Bernd Pfrommer <bernd.pfrommer@gmail.com>
7b8f375 to
6e988b7
Compare
MichaelOrlov
left a comment
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.
@berndpfrommer LGTM after adding a lot more above your original commit.
I've made a rebase on top of the latest Rolling and made the following changes:
- Add CLI option --disable-keyboard-controls for rosbag2 recorder
- Instantiate KeyboardHandler with installed signal handler by default
in the recorded and player constructors to mitigate issues when CTRL+C
not handled on upper layers as when player and recorder constructed via
composition. - Explicitly construct KeyboardHandler with disabled signal handler from
rosbag2_py layer since we have our own signals handler on that layer. - Add test coverage for parameters parser for disable_keyboard_controls
parameters. - Regenerate Python stub files (.pyi) for rosbag2_py package.
Please review and test that it works as you expected.
With the latest fixes recorder and player shall not "mess up" terminal output when player or recorder constructed via composition even with disable_keyboard_controls = false
- Add CLI option --disable-keyboard-controls for rosbag2 recorder - Instantiate KeyboardHandler with installed signal handler by default in the recorded and player constructors to mitigate issues when CTRL+C not handled on upper layers as when player and recorder constructed via composition. - Explicitly construct KeyboardHandler with disabled signal handler from rosbag2_py layer since we have our own signals handler on that layer. - Add test coverage for parameters parser for disable_keyboard_controls parameters. - Regenerate Python stub files (.pyi) for rosbag2_py package. Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
8e02417 to
85d9c93
Compare
|
Gist: https://gist.githubusercontent.com/MichaelOrlov/43a20975aa8e739bcbce1d49a7a02379/raw/ec8c69bbd8e43a7ed596cd692b447bff7983a981/ros2.repos |
|
Wow. What happened to my little PR :) ? |
|
@berndpfrommer Thanks for the review. |
|
Giving up on trying to test this. I cannot build anymore on Ubuntu 22.04/rolling without complete build from source. |
|
@berndpfrommer Hmm. I always compile from sources. |
Currently only the Player node has an option to disable the keyboard control. This PR adds the same feature to the Recorder node.
When I instantiate the Recorder within C++ as a node and directly run it with e.g. a SingleThreaded executor, it messes up my terminal to the point that I can no longer read the output and need to reset the terminal. Very annoying. Also, I don't want to see output about allowed keystrokes in my log files. This output may have made sense when the recorder was only run from the CLI, but now that the Recorder is a bona-fide composable node, the logging is unwanted.
It turns out that already instantiating (not just using) a KeyboardHandler messes up my terminal, so this PR avoids creating a KeyboardHandler altogether when record_options.disable_keyboard_controls is true.