Surveyor Robotics Journal
   



email: support@surveyor.com

SRV-1 home page

Surveyor Corporation home page

Subscribe to a syndicated RSS feed.

Subscribe with Bloglines

Archives
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

       
Thu, 30 Nov 2006

using the image processing extensions in SRV-1 BASIC (113006 firmware)

As a result of code testing, a few small SRV_protocol changes have been made. In the BASIC interpreter, a COMMENT command was added, PRINTX was removed, and BITDIR / BITSET / BITGET were activated. For the moment, we haven't activated the INPUT command, thinking instead that we might add some kind of non-blocking read to check for incoming data, but haven't yet decided on the best approach.

In the core robot functions, two commands were added to manage flash memory - 'zs' to set the current flash sector number (default is 00) and 'zg' to get the current flash sector number. At the moment, the code only allows access to flash sector #00, but this limit will eventually be lifted.

Here's an example of how to use some of the image functions in SRV-1 BASIC to create a very primitive version of "wander mode":

COLORCAP 1 25 55 1 8
100 IMGCAP
SCAN 1
PRINT X,Y,Z
IF X < Z THEN MOTORS 75 25
IF Z < X THEN MOTORS 25 75
IF X = Z THEN MOTORS 50 50
IF X + Z = 0 THEN MOTORS 0 0
GOTO 100
END

This code takes an initial color sample of nearby pixels (columns 25-55, rows 1-8), and stores the sample in color bin #1. It then looks at the left ('X') and right ('Z') Scan sectors (in BASIC SCAN, there are only 3 regions, not 80), turning one way or the other if one region seems more open. A useful extension to this code would be to also look at the center ('Y') region, and spin 45-degrees if all 3 regions were blocked, but I wanted to keep this simple.

Here are the latest download links -

Posted Thu, 30 Nov 2006 19:48 | HTML Link | see additional stories ...

Wed, 29 Nov 2006

image processing extensions to BASIC now in SRV-1 firmware (112906 test version)

The following BASIC language functions have been added to the firmware as described below:
  • COMMENT - just to make code more readable
  • COLORCAP 0-15 - sets a color based on samples from a region
  • COLORSET 0-15 - allows program to set the colors
  • COLORGET 0-15 - retrieves the stored colors
  • SCAN 0-15 - looks for blockage based on a given color
  • BLOB 0-15 - looks for blob matching a given color
There's a lot of new capability, but all of this needs to be tested more completely. The Scan and Blob functions are somewhat simpler that the "vs" and "vb" functions in the SRV-1 command protocol, but they should be adequate to do some interesting things. I hope to post some code samples tomorrow demonstrating the "wander" mode and some simple soccerbot commands all coded in BASIC with this set of functions. In the mean time, if anyone has a chance to test this update to make certain we haven't broken any core functionality, that would be appreciated.

Here are the download links -

CommandResponseDescription
BASIC Commands
IMGCAPcapture image at 160x128 resolution (stored as 80x64 YUV)
COLORCAPcaptures colors from latest image in box bounded by x1 x2 y1 y2, and stores to designated color bin, e.g.
COLORCAP 0 20 40 1 5 captures to color bin #0 from x=20 to x=40, y=1 to y=5
COLORSETsets the colors in a color bin - format is somewhat different from the "vs" command, as data is Y, U, V, Y-range, U-range, V-range, rather than min/max values
COLORGETlists the colors in a specified color bin using same format at COLORSET. to view values, PRINT Y, U, V
to view ranges (for Y U V), PRINT R, S, T e.g.

COLORSET 0 128 89 95 15 10 10
COLORGET 0
PRINT Y, U, V
PRINT R, S, T

output will be
   128   89   95
   15   10   10
SCANsimilar to the "vs" Scan function above, but divides the image into 3 overlapping areas, saved into X = front left, Y = front, Z = front right. if a region is blocked, the value will be zero. if it's not blocked, the value will be positive, with a higher number indicating more open space in that region, e.g.

IMGCAP
SCAN 0
PRINT X,Y,Z

might output
   7   12   0
indicating that the right is blocked, but forward and left are both open
BLOBsimilar to the "vb" Blob function above, but only returns the largest blob matching the specified color, with results saved into X = centroid x coordinate, Y = centroid y coordinate, Z = blob width. e.g.

IMGCAP
BLOB 0
PRINT X,Y,Z

might output
   40   30   15
for a blob centered at (40,30) with a width of 15 pixels

a width of 0 would indicate that no matching blob was found

Posted Wed, 29 Nov 2006 18:35 | HTML Link | see additional stories ...

Mon, 27 Nov 2006

Tiny BASIC interpreter added to SRV-1 firmware (112706 test version)

Beyond the additions to the 112206 version of SRV-1 firmware, there's now a BASIC interpreter built in.

This is a limited version of BASIC, in that there are no arrays, variables are all single character 'A' - 'Z', and labels are numeric, but it does support branching and arithmetic/logic operations, plus we've extended the language for robot-specific commands.

All programs are executed out of flash memory. It takes some effort to load a program, as the only available method at the moment is the new "zw" command, so you need to know in advance how long your program is and transfer via a terminal program. Also, the robot has to be power-cycled after the flash is written (we're working on that), but you can check that the program loaded with the "zr" command. The "Q" command then launches the program that you stored. Note that there's no way to break out of an infinite loop at the moment besides restarting the robot, but if a program terminates normally, it returns to the core SRV-1 control loop.

We do plan to create a better method for program loading and editing, but at the moment, just want to find bugs and make certain we haven't broken any other functionality. This seems like it will have a lot of potential once we make it easier to use, and it adds less than 10kb of program memory usage.

Here are the download links -

CommandResponseDescription
BASIC Commands
'Q'runs BASIC program stored in first sector of flash memory
ASSIGNA = B / 20
OPERATORS+ - * / ^ % = ; ( ) , > < & |
VARIABLES32-bit signed integers - 'A' - 'Z'
PRINTprints strings, variables, constants
PRINTXsame as PRINT, but with hex output
INPUTnot yet activated
IF ... THEN ...IF H < 11 THEN GOTO 200
FOR ... TO ...FOR J = 1 TO 100
NEXTend of FOR loop
GOTOGOTO 100
GOSUBGOSUB 300
TIMEsave current time (milliseconds since startup) in 'T' variable
DELAYDELAY 500 delays 500 milliseconds
MOTORSMOTORS 50 50 or MOTORS A B - set left and right motor output
IRIR <1,2,3,4> - read sensor and save in 'X' variable.
IR 1 = forward, 2 = left, 3 = back, 4 = right
IMGCAPnot yet added
GETCOLORSnot yet added
SETCOLORSnot yet added
SCANnot yet added
BLOBnot yet added
DBITSnot yet added
WBITSnot yet added
RBITSnot yet added
exampleA = 50 ^M^J
B = -50 ^M^J
100 IR 1 ^M^J
IF X < 20 THEN MOTORS A A ^M^J
IF X > 19 THEN MOTORS A B ^M^J
DELAY 500 ^M^J
GOTO 100 ^M^J
END ^M^J^@

this program checks the front IR (IR 1) and returns the reading in 'X', moves forward if below a threshold or turns right if above the threshold. an easier way to code this would be MOTORS 50 50 and MOTORS 50 -50, but the MOTORS command can't yet handle negative values, so we put the negative value in B. available variables are 'A' through 'Z'. note the CR LF ^M^J at the end of each line

Posted Mon, 27 Nov 2006 18:24 | HTML Link | see additional stories ...

Wed, 22 Nov 2006

test version of SRV-1 firmware with new vision, flash and data functions

A new version of firmware is available for testing. It includes most of the extensions proposed in the previous post, with the addition of 2 color management functions.

This code has been tested, but the additions are complex, so there are likely to be some bugs. None of the previous firmware functionality has changed except for a small formatting difference in the "Scan" command (data sent as hex instead of decimal), so this firmware should function fine with the current SRV1Console. If there are any problems, please report them via email to support@surveyor.com or note them on the Surveyor Robotics Forum.

Here are the download links -

Here are the new commands - they look quite complicated, but are actually not too difficult to use. At present, there's no direct support for theses commands in SRV1Console, so you'll have to test them through a terminal / console. There will be additional posts here and on the forum about using these new functions.

CommandResponseDescription
'ddxx''##dd\n'set data direction for i/o pins, 1=output, 0=input, xx = [0 0 0 E9 E10 E11 E12 E13]
'dr''##drxx\n'xx = read levels of E9 E10 E11 E12 E13 in this order - [0 0 0 E9 E10 E11 E12 E13]
'dwxx''##dw\n'write output levels for bits on i/o pins, 1=high, 0=low, xx = [0 0 0 E9 E10 E11 E12 E13]
e.g sets E9, E11 and E13 to output - "dd15", set E11 and E13 high - "dw05"
'zwxxdddd...''##zwxx\n'write xx bytes to robot flash memory (0xff bytes max), dddd = ASCII data to be written, e.g 'zw10my name is srv-1' writes the 16 byte string 'my name is srv-1' to flash
Note - take care when using this command, as it is possible to overrun the robot's 16-byte FIFO if 'zw' command is issued when robot is not ready to take data
'zrxx''##zrxxdddd...\n'read xx bytes from robot flash memory (0xff bytes max), dddd = ASCII data from flash, e.g 'zr10' returns '##zr10my name is srv-1\n'
'vgcx1x2y1y2''##vgcy1y2u1u2v1v2\n'the 'vg' command grabs and samples the range of YUV colors in a rectangular region defined by x1, x2, y1, y2, and save info to color bin #c. there are 16 possible color bins, ranging from 0x0 to 0xF.
e.g. 'vg010200515' will sample colors for color bin #0, ranging from column 16 (0x10) through column 32 (0x20) at heights ranging from line 5 to line 21 (0x15), where line 0 is the lowest line in the image. the robot will return a string with 'vg' followed by the color bin number, then y1=Ymin, y2=Ymax, u1=Umin, u2=Umax, v1=Vmin, v2=Vmax.
as an example, when sampling an area that contained an orange golf ball using the 'vg' command for color bin #0, the robot returned '##vg079B056719AC4\n'. a graphical interface for defining the "region of interest" to be sampled would be especially helpful in using this command.
'vrc''##vrcy1y2u1u2v1v2\n'the 'vr' command retrieves the stored color info from color bin #c.
this command will return string with 'vr' followed by the color bin number, followed by y1=Ymin, y2=Ymax, u1=Umin, u2=Umax, v1=Vmin, v2=Vmax.
in the above example where colors for an orange golf ball were captured using the 'vg' command for color bin #0, issuing a 'vr0' command will return the colors stored in color bin #0 - e.g. '##vr079B056719AC4\n'.
'vccy1y2u1u2v1v2''##vcc\n'the 'vc' command directly sets the contents of color bin #c.
this command will return string with 'vc' followed by the color bin number.
for example, we could save a set of colors to color bin #3 corresponding to measurements taken at another time, such as the above mentioned orange golf ball color measurement, using 'vc379B056719AC4'. we could then confirm that the colors were properly stored by issuing the command 'vr3' to retrieve the contents of color bin #3.
'vsc''##vsc010203...\n'same function as the "Scan" command above for viewing raw "pixel column vector" data , except that we can specify which color bin to use when scanning.
01, 02, 03, etc represents hex value from 0x00-0x40 for each pixel column (80 or 0x50 columns total), so a low value indicates blockage nearby, high value indicates open column (vector). the value is roughly proportional to distance from robot to blockage. note that the "Scan" command is using the colors stored in color bin #0, so issuing the 'S' command or 'vs0' will return the same results, except for the first few characters of the response ('##Scan - ...' vs 'vs0...')
'vbc''##vbcx1x2y1y2ssssx1x2y1y2ssss...\n'the 'vb' command searches for blobs matching the colors in color bin #c, and returns coordinates of an x1, x2, y1, y2 rectangular region containing the matching pixels, along with a count of matching pixels in the blob. up to 16 blobs can be returned, and the blobs are sent in order of pixel count, though blobs smaller than MIN_BLOB_SIZE (currently set to 5 pixels) aren't shown.

an easy way to test this function is to use the 'm' command, which is hardwired to grab color samples from columns 20-59 (0x14-0x3B) in rows 0-5 and store them in color bin #0, then try the 'vb0' command to see what blobs show up. if an object is large enough to cover that hardwired area of the image, you should get pretty good tracking, and can try moving the robot away from the object to see how the blob is tracked.

Posted Wed, 22 Nov 2006 21:11 | HTML Link | see additional stories ...

Sun, 19 Nov 2006

some planned extensions to SRV_protocol ...

We have assembled a list of customer requests along with some functions we have been planning, and are preparing to add these to the SRV-1 firmware:
  • In the current firmware, the data returned from 'S' Scan is decimal, and we plan to change this to hex so that it is consistent with the format of other the commands.

  • We are going to add a few more functions to make the Scan function more useful plus adding a blob detect function. There will actually be three new functions:

    • Grab color samples - returns [Ymax, Ymin, Umax, Umin, Vmax, Vmin] from an area of the image bounded by a set of upper left / lower right coordinates. This function will also initialize the on-board image processing mode (similar to 'w' or 'm', except that the host controls the sample area)

    • Scan image, similar to current Scan function, but using specified color range [Ymax, Ymin, Umax, Umin, Vmax, Vmin]. Returns a set of column vectors showing location of first mismatch in each column

    • Blob search - searches image in specified color range [Ymax, Ymin, Umax, Umin, Vmax, Vmin], and returns list of blobs [upper left, lower right, density] that fit the search criteria

  • We will be adding a set of 3 functions to interface to the digital i/o pins E5-E13.

    • ddxxxx (returns ##ddir) - sets data bit direction - xxxx is 4 hex digits

    • dsxxxx (returns ##dset) - sets data bits - xxxx is 4 hex digits

    • dg (returns ##dgetxxxx) - gets data bits - xxxx is 4 hex digits

  • We will add functions to write a sector of onboard flash memory and retrieve that sector. A sector is 256 bytes. Basically, this will create a form of permanent storage for information which might help personalize an individual robot (name, motor/sensor calibration data, neural nets, etc).

  • Finally, we will be adding a function similar to the 'I' Image Grab command that allows image data to be transferred in smaller chunks instead of one continuous transfer, allowing a host program to interleave other commands while grabbing a large image.

If there's anything we have missed, please let us know via email or the Surveyor Robotics Forum

Posted Sun, 19 Nov 2006 02:32 | HTML Link | see additional stories ...

Thu, 16 Nov 2006

more progress on soccerbots ...

Our first soccerbot ball scoops just arrived from the machinist.



These scoops have less curve (a larger radius) than the original prototype - we'll have to experiment to see whether this is desirable, but in any case, they look good and mount easily to the front of the SRV-1.



It will be interesting to run these soccerbots under control of Pyro and Webots, as both robot simulation / control packages have fully developed RoboCup simulators. We'll soon be adding some basic image processing functions to the firmware that will enable location / tracking of the ball and goals.


Posted Thu, 16 Nov 2006 12:50 | HTML Link | see additional stories ...

Sat, 11 Nov 2006

additional software support for the SRV-1 ...

We have been working on a variety of projects to add support within other robotics programming environments for the SRV-1. We are at various stages of development with all of these porting efforts, and some should be complete quite soon. All of these projects are interfacing through our published SRV-1 control protocol and employ existing versions of SRV-1 firmware without modification.
  • Pyro - http://www.pyrorobotics.org - Pyro stands for Python Robotics. The goal of the project is to provide a programming environment for easily exploring advanced topics in artificial intelligence and robotics without having to worry about the low-level details of the underlying hardware. Pyro is written in Python.

  • Webots - http://www.cyberbotics.com - The Webots mobile robotics simulation software provides a rapid prototyping environment for modelling, programming and simulating mobile robots under Windows, Mac OS/X and Linux. The 3D modeling and physics are outstanding.

  • URBI - http://www.urbiforge.com - URBI is a Universal Real-time Behavior Interface which provides a simple but powerful way to control any robot or complex system like a video game, using a convenient and easy to use scripting language that can be interfaced with several popular programming languages (C++, Java, Matlab,...) and OS (Windows, Mac OSX, Linux).

  • Microsoft Robotics Studio - http://www.microsoft.com/robotics/ - The Microsoft Robotics Studio is a Windows-based environment for academic, hobbyist and commercial developers to easily create robotics applications across a wide variety of hardware. Key features and benefits include: end-to-end robotics development platform, lightweight services-oriented runtime, and a scalable / extensible platform.

  • Player/Stage - http://playerstage.sourceforge.net - The Player Project creates Free Software (GPL) that enables research in robot and sensor systems. The Player robot server is probably the most widely used robot control interface in the world. Its simulation backends, Stage and Gazebo, are also very widely used.

We'll post notices to this journal when release versions of any interface code become available. In case anyone is already actively working with any of these tools and has interest in testing SRV-1 support in advance of general release, please let us know at support@surveyor.com.

Posted Sat, 11 Nov 2006 11:57 | HTML Link | see additional stories ...

Sun, 05 Nov 2006

SRV-1 featured in Robot Magazine (winter 2006)

We knew that an article on the SRV-1 was in the works, but it was quite a surprise to find the new issue of Robot Magazine - http://www.botmag.com on the magazine shelves of our local Barnes & Noble in a section called "Hot Picks". There's a very nice feature article about the SRV-1 starting on page 36.






Posted Sun, 05 Nov 2006 13:17 | HTML Link | see additional stories ...