Surveyor Robotics Journal |
|||||
|
email:
web:
rss: Archives |
Thu, 13 Nov 2008 Robot Lisp for Surveyor SRV-1/SVS A new version of Lisp has been added to the latest test version of Surveyor SRV-1/SVS firmware, as discussed on the Surveyor Robotics Forum. The code is based on "Scheme In One Defun" (SIOD) by George J. Carrette. Lisp can be run interactively or loaded with a program from the flash buffer. There is a rich set of built-in functions, based on the Scheme dialect - cons, car, cdr, set-car!, set-cdr!, +, -, *, /, <, >, =, eq?, eqv?, assq, read, print, eval, define, lambda, if, while, begin, set!, or, and, quote, oblist, copy-list, gc-status, pair?, symbol?, number?, quit, not, null?, reverse. We have extended this with some SRV-1/SVS specific functions -
So the command (robot 8) will move the robot forward, and (robot 5) will stop it You could define the commands - (define fwd 8) (define back 2) (define stop 5) (define left 4) (define right 6) Then the command (robot fwd) would have the same effect as (robot 8) Here is a very simple program to control the robot from the keyboard, using the digits 8, 5, 2, 4, and 6 as defined above, and 0 to exit the program ... (while (> (set! x (input)) 0) (robot x)) This is just the beginning. It is very easy to extend the language, and the next step is to add some image processing functions to enable search for objects(colors), avoidance of colors, etc. Posted Thu, 13 Nov 2008 21:06 | HTML Link | see additional stories ... |
||||