Ask Your Question
0

keyboard_teleop

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

andreapatri gravatar image

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

Hola
Can someone explain me this code?:

def getKey():

tty.setraw(sys.stdin.fileno())

select.select([sys.stdin], [], [], 0)

key = sys.stdin.read(1)

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

return key
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

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 http://docs.python.org/library/termios.html

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

Stats

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

Seen: 399 times

Last updated: Oct 15 '12