personalrobotics / ada_feeding

Robot-assisted feeding demos and projects for the ADA robot
4 stars 4 forks source link

Added a `start_nano.py` script #185

Closed amalnanavati closed 2 months ago

amalnanavati commented 5 months ago

Description

Current State

We currently launch the camera code on nano through an ssh session that runs a bash script. However, the downside is that sometimes, passing SIGINT (Ctrl+c) to the ssh session only terminates the ssh session, and not the bash script running on nano. This results in the camera code still running, which causes an error when we re-run the robot's start script. Currently, we've been addressing this by ssh-ing into nano, listing all processes with "camera" in them (ps -aux | grep camera) and manually killing their PID (e.g., kill {pid}).

PR Change

This PR improves upon the above by adding a script for nano to run the camera within a screen session. Because it keeps using the the same screen shell to run the camera, even if the previous invokation did not properly terminate the camera, this invokation will first terminate the camera and then re-run it. Thus, you should never have multiple cameras running in parallel.

Configuring this code to run on nano

Testing procedure

Before opening a pull request

Before Merging