Surveyor Robotics Journal
   



email:
support@surveyor.com

web:
Surveyor Corporation

rss:
Subscribe

Archives
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
Februray 2006
January 2006

       
Sun, 23 Nov 2008

Laser pointer ranging function added to SRV-1 firmware

We now have a laser_range() function which uses the laser pointers and onboard camera in combination to estimate distance to the nearest obstacle. The function is accessed by console with 'R' or 'r' commands, the C interpreter via "range()", or the Lisp interpreter with "(range)". The 'r' console command dumps lots of diagnostic data, in case you want to see what the laser_range() function is thinking.

Here is a sample program for the C interpreter using the range() function:
main()
{
    int x;
    char ch;

    ch = 0;
    while (ch == 0) {
        x = range(); /* user laser pointer ranging */
        print("range = " x);
        if (x < 30) {
            motors(-50 , 50);
        } else {
            motors(50, 50);
        }
        delay(500);
        ch = input(); /* continue until any console input */
    }
    motors(0, 0);
}

A version of code for the new Lisp interpreter looks like this:
(define (stop) (robot 5))
(define (left) (robot 4))
(define (right) (robot 6))
(define (forward)
    (begin
        (robot 8)
        (delay 500)
        (robot 5)
    )
)
(define (back)
    (begin
        (robot 2)
        (delay 500)
        (robot 5)
    )
)

(define (branch)
    (begin
        (set! x (range))
        (print x)
        (if (< x 30) (right) (forward))
    )
)

(while (not (signal))
    (branch)
)

Note that while the Lisp version is longer, most of the code is creating some library functions such as stop, left, right ... that can easily be used later. A detailed discussion of the new firmware version is found here on the Surveyor Robotics Forum.

Posted Sun, 23 Nov 2008 18:08 | HTML Link | see additional stories ...

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 -
  • (rand x) - return a number ranging from 0 to x
  • (time) - return current RTC value (milliseconds since last reboot)
  • (delay x) - delay x milliseconds
  • (input) - take input from console - currently limited to single digit 0-9
  • (lasers x) - any non-zero value of x turns them on, 0 turns them off
  • (robot x) - move SRV-1 - 8=fwd, 2=back, 4=left, 6=right, 5=stop
  • (compass) - return reading from optional HMC6352 compass
  • (ping x) - get value from optional Maxbotics modules 1-4
Lisp can be run interactively, or loaded with a program from the flash buffer. The next code release will combine these features - you will be able to load a program from the buffer and then continue interactively. To run interactively via terminal , send '!'. To run from the buffer, send 'P'.

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

Sun, 02 Nov 2008

one more pass at color segmentation + edge detection

Code for transferring data between processors via SPI bus on the SVS (stereo vision system) is in place, so now we need to decide what data to transfer for the purpose of building basic depth maps. There is no question that we will eventually need to move toward more robust feature detectors such as SIFT or SURF, but we should be able to get useful results from the simple combination of an edge detector and basic color segmentation.

The previous robotics journal post showed an edge detector combined with a 16-color segmentation based on just 4 levels of U and 4 levels of V, but no Y component. Shown below is 16-color segmentation based on the 'vz1' filter with 4 levels of Y, 2 levels of U and 2 levels of V. Combined with the edge detector, this approach seems to provide better feature differentiation than the UV-only approach, so that is the approach we will use as a basis for correlating between left and right views, though it is easy enough to change to other segmentation schemes.


Shown above - left and right views from the SVS using the 'g2' filter,
displayed using SRV1Test.java

Posted Sun, 02 Nov 2008 19:18 | HTML Link | see additional stories ...