ros-industrial / reach_ros2

ROS2 packages for REACH
Apache License 2.0
17 stars 4 forks source link

`runReachStudy` function does not accept terminal input in ROS2 #6

Open marip8 opened 1 year ago

marip8 commented 1 year ago

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

SammyRamone commented 1 year ago

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 https://github.com/ros2/launch/issues/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.