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