Page 368 - Hacking Roomba
P. 368

Chapter 15 — RoombaCam: Adding Eyes to Roomba                     349




                               Listing 15-4 Continued

                                 -v, -- verbose=NUM            Be verbosive (use more for more
                               verbose)
                                 -f, -- forward                Go forward at current speed
                                 -b, -- backward               Go backward at current speed
                                 -l, -- spin-left              Spin left at current speed
                                 -r, -- spin-right             Spin right at current speed
                                 -s, -- stop                   Stop a moving Roomba
                                 -w, -- wait=millis            Wait some milliseconds
                                 -v, -- velocity=val           Set current speed to val (1 to
                               500)
                                 -S, -- sensors                Read Roomba sensors,display
                               nicely
                                 -R, -- sensors-raw            Read Roomba sensors,display in
                               hex
                                     -- debug                  Print out boring details
                               Examples:
                                roombacmd -p /dev/ttyS0 -v 250 -- forward
                                roombacmd -p /dev/ttyS0 -- spin-left
                                roombacmd -p /dev/ttyS0 -- sensors
                                roombacmd -p /dev/ttyS0 -- stop
                               Notes:
                               - The ‘-p’ port option must be first option and is required.
                               - All options/commands can be cascaded & are executed in order,
                               like:
                                   roombacmd -p /dev/ttyS0 -f -w 1000 -b -w 1000 -s
                                   to go forward for 1 sec, go back for 1 sec, then stop.





                             Building roombacmd for OpenWrt
                             To immediately try out a version of roombacmd for OpenWrt, a pre-compiled ipkg package
                             has been made that you can fetch and install:
                             root@OpenWrt:~# wget http://roombahacking.com/software/openwrt/ i
                             roombacmd_1.0-1_mipsel.ipk
                             root@OpenWrt:~# ipkg install roombacmd_1.0-1_mipsel.ipk

                             You’ll then have /usr/bin/roombacmd at your disposal on your OpenWrt system.
                             Building a version of roombacmd for OpenWrt is not as easy as building it for a desktop OS,
                             because you have to cross-compile. That is, you have to produce an executable for one architec-
                             ture on another. This is what you did when producing Arduino sketches, but Arduino hides all
                             that from you. The language, GCC, is the same. But compiling embedded Linux programs is a
   363   364   365   366   367   368   369   370   371   372   373