Surveyor Robotics Journal |
|||||
|
Surveyor Corporation home page
Subscribe to a syndicated RSS feed. Archives |
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 ... |
||||