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

Revision history [back]

click to hide/show revision 1
initial version

Most of the bardcode readers I've seen emulate a keyboard; which is probably why you're seeing the input come is as a command followed by a newline, and of course a random bardcode is not a valid command, so when the shell tries to execute it you get command not found

Getting the barcode scanner to NOT act like a keyboard (or at least not send input to your terminal) means interacting with the linux kernel's input subsystem. This post seems to discuss the correct way to do the setup and get an exclusive lock on the barcode scanner, but it's in ruby.

It looks like python-evdev provides the same functionality in Python, and even includes a grab() method so that you don't have to handle the process of getting an exclusive lock manually.