Keyboard key pressed
Hello
I created a robot model in gazebo, and also a plugin through which I can control the model. There is also a ROS application which communicates with plugin by messages. In that application, I should catch the keyboard input, send the masseges based on input, and finally, control the model. I dont know how to catch keyboard input. Is there something like "isPressed("key")" function?
Ubuntu 12.04, ROS Groovy, c++
EDIT: Now I have another problem. Is there a way to find out that there is no key pressed? Something like timeout for getch() function? In the example explained in the post bellow, the while() loop stops on the int c = getch(); line and waits for inupt.
Thank you!