ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question


asked 2012-10-15 12:47:26 -0500

andreapatri gravatar image

updated 2012-10-15 12:48:00 -0500

Can someone explain me this code?:

def getKey():

tty.setraw(sys.stdin.fileno())[sys.stdin], [], [], 0)

key =

termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)

return key
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-15 21:49:29 -0500

fergs gravatar image

This isn't really ROS specific code -- basically, it is accessing the keyboard (stdin) using standard Python methods to get one keypress at a time. See

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-10-15 12:47:26 -0500

Seen: 587 times

Last updated: Oct 15 '12