ros-industrial / reach_ros2

ROS2 packages for REACH

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`runReachStudy` function does not accept terminal input in ROS2

marip8 opened this issue · comments

The runReachStudy function has an argument for waiting for keyboard input to keep the reach study objects alive until the user is done interacting with the reach study in Rviz. The ROS2 launch system apparently does not allow terminal inputs to be passed to the launched nodes, so the reach study node hangs indefinitely until the program is manually terminated. We should think of an alternate method of handling this that works correctly in ROS2

I can confirm that this happens when launching the software via a ROS launch file. This bug does not happen when the code is started with the Python interface.
I think the corresponding issue in ROS 2 launch is this one ros2/launch#635
There are of course other ways to get the keyboard input than using cin but all of these seem to be platform specific.
A hacky solution for this problem is adding prefix='xterm -e', to the launch file, as it will create a new terminal window with access to cin for the node. Of course this can not be the solution for this problem.