The quality of service interactive publisher and subscriber are run like the following:
ros2 run quality_of_service_demo_cpp interactive_publisher
or
ros2 run quality_of_service_demo_cpp interactive_subscriber
Both demos are interactive in the sense that they listen for keyboard commands to do certain actions. One of those actions is to quit, which is done by hitting the 'x' button.
Unfortunately, this doesn't work and doesn't exit the program for either of them. The basic problem is that the keyboard handling code that is common to both demos is doing the equivalent of a getch with no timeout in a thread. So when the user hits 'x', the executor is shutdown, but nothing makes the getch return and thus lets the thread complete.
I'm not quite sure how to solve it at the moment, but it should be looked into.
The quality of service interactive publisher and subscriber are run like the following:
or
Both demos are interactive in the sense that they listen for keyboard commands to do certain actions. One of those actions is to quit, which is done by hitting the 'x' button.
Unfortunately, this doesn't work and doesn't exit the program for either of them. The basic problem is that the keyboard handling code that is common to both demos is doing the equivalent of a
getch
with no timeout in a thread. So when the user hits 'x', the executor is shutdown, but nothing makes thegetch
return and thus lets the thread complete.I'm not quite sure how to solve it at the moment, but it should be looked into.
This came out of the testing in https://github.com/osrf/ros2_test_cases/issues/783