Global Keyboard Panic button implementation
Hi,
I am working in a project with several robots including one quadcopter.
When I am designing new control codes for the quadcopter, some times I make mistakes and end up with a high speed uncontrollable quadcopter flying in my lab. When this happens I go very fast to the terminal in which I launched the controller and kill the process. I always run a reliable code in parallel which sends stable commands to the quadcopter which I switch to when this happens. This process takes time (seconds) and it usually results on quadcopter crash with a wall or something.
I would like to program a node with a sort of Panic Button on the keyboard that doesn't require having focus on the terminal to run so in case of a controller fault I can override the bad controller. I don't want to have focus on the terminal because I generally have a LOT of terminals working simultaneously and I don't want to waste some seconds finding the right terminal.
Any ideas on the best way of implementing this? I think ROS should provide this kind of safety mechanisms for moving robots, maybe I haven't looked in the right places.
I am programming on Ubuntu 14.04 with ROS Indigo.
Bests,
You essentially need to write keylogger, right?
As an idea, if you have a joystick or some other device, you could use it without focusing the terminal.