ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

keyboard_teleop

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

andreapatri gravatar image

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

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 -0600

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

Question Tools

Stats

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

Seen: 953 times

Last updated: Oct 15 '12