Touchbot gesture library utilities addition

The old way of writing programs to the robot's eeprom was very
cumbersome.  It required a lot of duplicated code and was almost
impossible to read as each instruction involved ~5 lines of python code,
so even simple gestures were unweildy.

Here I add a some functions to the roibot module to wraps virtually all of
the functionality required for writing programs to the eeprom in a
couple easy functions.  They auto-increment line numbers and point table
entries, and retry every instruction behind the scenes.  Each
instruction also raises exceptions now if they fail, so the whole script
can be wrapped in a single try: statement to stop on any failure.

To additionally offload more of the overhead a run_program.py gesture
was added.  This has a run_program() function that essentially loads a
new program that you pass it into eeprom and then runs it for you
without each gesture script having to do all the setup individually.
You can also run the run_program gesture all on its own to simply
execute whatever program is currently in memory.  This saves eeprom
write cycles which are limited, and is convenient when doing many
repeated runs of the same script.

basic.py has been rewritten to use the new methodology of programming
and serve as an example for future gestures.  The other gestures will be
converted at a later date

BUG=chromium-os:34930
TEST=From the gestures directory, run "make" to build the wrapper
scripts, then use "./basic" to make sure that it can program a new set
of instructions to the eeprom and run them.  Once it has completed, run
"./run_program" to re-execute what it currently in memory without
re-writing it.

Change-Id: If5549d82ed52da2fc71cba6f89eaa8a822fedc2d
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34386
Reviewed-by: Mark Koudritsky <kamrik@chromium.org>
4 files changed
tree: 01eab0420ff9ac11d8fb631e00522d455f555c3a
  1. README
  2. devices/
  3. documentation/
  4. gestures/
  5. roibot/
  6. test/