hello-robot / stretch_visual_servoing

Example code for visual servoing using Stretch 3's gripper camera
Other
5 stars 3 forks source link

Zombie process when running without a display (e.g., over SSH) #4

Open hello-amal opened 4 months ago

hello-amal commented 4 months ago

Problem

If a user runs python3 visual_servoing_demo.py from an SSH session without X11 forwarding, it aborts due to there not being a display to show the OpenCV images. However, it doesn't terminate cleanly; running htop still shows python3 visual_servoing_demo.py as a process, and stretch_free_robot_process.sh is unable to free it. A user has to manually get the PID (e.g., from htop) and kill <pid>.

Suggested Solution(s)

The visual servoing demo should detect if there is a display or not (e.g., check if the DISPLAY environment variable is set). If not, it should either: (a) print an error and terminate cleanly; or (b) run as usual, without the cv2.imshow.